"Not a valid password" message

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.
0
Utf
11/8/2007 2:22:01 PM
access 16762 articles. 3 followers. Follow

2 Replies
812 Views

Similar Articles

[PageSpeed] 20

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/microsoft.public.access.modulesdaovba/browse_thread/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:)" wrote:

> 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.
0
Utf
11/8/2007 5:50:00 PM
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" wrote:

> 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/microsoft.public.access.modulesdaovba/browse_thread/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:)" wrote:
> 
> > 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.
0
Utf
11/9/2007 5:00:00 AM
Reply:

Similar Artilces:

"Not a valid password" message
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/microsoft.public.access.modulesdaovba/browse_thread/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...