G
Günter Brandstätter
Hi all,
I wanted to password-protect an Access-database just to be sure that the
tables are unintendently changed. I know, it is not top of security, but I
can live with it.
What I wanted to know now, if I want to open this database programmatically
using OLE, how do I implement the password in my code?
What I do for the moment (without password) is the following:
myDoc.MailMerge.OpenDataSource Name:=myDB _
, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=0, Connection:= _
"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data
Source=myDB;Mode=Read;Extended Properties="""";Jet OLEDB:System
database="""";Jet OLEDB:Registry Path=""""" _
, SQLStatement:="SELECT * FROM `myTable`", SQLStatement1:="", _
SubType:=wdMergeSubTypeAccess
Works fine without password.
I was trying to add "Jet OLEDBatabase Password=myPassword" in the extended
properties section of this string. This did not solve my problem.
It opens a Connection Properties windows, where I could enter the password
manually.
How do I manage to get my password inserted automatically??
any answer appreciated
I wanted to password-protect an Access-database just to be sure that the
tables are unintendently changed. I know, it is not top of security, but I
can live with it.
What I wanted to know now, if I want to open this database programmatically
using OLE, how do I implement the password in my code?
What I do for the moment (without password) is the following:
myDoc.MailMerge.OpenDataSource Name:=myDB _
, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=0, Connection:= _
"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data
Source=myDB;Mode=Read;Extended Properties="""";Jet OLEDB:System
database="""";Jet OLEDB:Registry Path=""""" _
, SQLStatement:="SELECT * FROM `myTable`", SQLStatement1:="", _
SubType:=wdMergeSubTypeAccess
Works fine without password.
I was trying to add "Jet OLEDBatabase Password=myPassword" in the extended
properties section of this string. This did not solve my problem.
It opens a Connection Properties windows, where I could enter the password
manually.
How do I manage to get my password inserted automatically??
any answer appreciated