If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
"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. |
#2
|
|||
|
|||
"Not a valid password" message
Why don't you link to the table via the Linked Table manager? Then you will
specify the password at link time. -Dorian "!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. |
#3
|
|||
|
|||
"Not a valid password" message
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 -- Dave Hargis, Microsoft Access MVP "!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. |
#4
|
|||
|
|||
"Not a valid password" message
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. "Klatuu" wrote: 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 -- Dave Hargis, Microsoft Access MVP "!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. |
#5
|
|||
|
|||
"Not a valid password" message
What is so hard about what I posted?
It does exactly what you are wanting to do. -- Dave Hargis, Microsoft Access MVP "!pro-progammer" wrote: 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. "Klatuu" wrote: 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 -- Dave Hargis, Microsoft Access MVP "!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. |
Thread Tools | |
Display Modes | |
|
|