"Not a valid password" message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I coding "DoCMD.RunSQL 'Select <some field> FROM <a table> IN <another
database>' " but that database is password protected, I always get "Not a
valid password" message.

Could anyone help me on this?

Thanks.
 
Help you in what way? You mean how can you supply the password in your
code? if so look at

http://groups.google.ca/group/micro...read/thread/3e847ea236aa4815/42bdffa21467982f

A brief extract from the post is below

Here is a bit of the code which works:
dbName is a variable containing the path and db name.


SQLString = "SELECT Min([Date ToR Agreed]) AS MinDate FROM BarChart Barchart
IN '" & dbName & "';"

Set db = OpenDatabase(dbName, False, False, "MS Access; pwd=ThePassword")
Set rs = db.OpenRecordset(SQLString)

If this isn't what you need as help, please explain what you need help with
exactly.
 
It seems that there's no simple way to run the SQL command to get data from
another password-protected database and then insert them into current
database.

All what I want is just run an SQL command.

Thank you anyway.


Daniel said:
Help you in what way? You mean how can you supply the password in your
code? if so look at

http://groups.google.ca/group/micro...read/thread/3e847ea236aa4815/42bdffa21467982f

A brief extract from the post is below

Here is a bit of the code which works:
dbName is a variable containing the path and db name.


SQLString = "SELECT Min([Date ToR Agreed]) AS MinDate FROM BarChart Barchart
IN '" & dbName & "';"

Set db = OpenDatabase(dbName, False, False, "MS Access; pwd=ThePassword")
Set rs = db.OpenRecordset(SQLString)

If this isn't what you need as help, please explain what you need help with
exactly.
--
Hope this helps,

Daniel P








!pro-progammer:) said:
When I coding "DoCMD.RunSQL 'Select <some field> FROM <a table> IN <another
database>' " but that database is password protected, I always get "Not a
valid password" message.

Could anyone help me on this?

Thanks.
 
Back
Top