"Not a valid password" message

  • Thread starter !pro-progammer:)
  • Start date
P

!pro-progammer:)

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.
 
M

mscertified

Why don't you link to the table via the Linked Table manager? Then you will
specify the password at link time.

-Dorian
 
K

Klatuu

Here is another way to do this programmatically:

Dim tdf As TableDef

With CurrentDb
Set tdf = .CreateTableDef("CDSchedule", dbAttachSavePWD,
"tblSchedule", _
";Database=" & strPath & ";Pwd=downwind")
.TableDefs.Append tdf
.Execute ("qryUpdateCDMD"), dbFailOnError
End With

DoCmd.DeleteObject acTable, "CDSchedule"
Set tdf = Nothing

strPath will be the path and name of the database
 
P

!pro-progammer:)

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 that I want is just run an SQL command.

Thank you anyway.
 
K

Klatuu

What is so hard about what I posted?
It does exactly what you are wanting to do.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top