A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"Not a valid password" message



 
 
Thread Tools Display Modes
  #1  
Old November 8th, 2007, 02:35 PM posted to microsoft.public.access.queries
!pro-progammer:)
external usenet poster
 
Posts: 3
Default "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  
Old November 8th, 2007, 03:08 PM posted to microsoft.public.access.queries
mscertified
external usenet poster
 
Posts: 835
Default "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  
Old November 8th, 2007, 04:05 PM posted to microsoft.public.access.queries
Klatuu
external usenet poster
 
Posts: 7,074
Default "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  
Old November 9th, 2007, 04:55 AM posted to microsoft.public.access.queries
!pro-progammer:)
external usenet poster
 
Posts: 3
Default "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  
Old November 9th, 2007, 02:46 PM posted to microsoft.public.access.queries
Klatuu
external usenet poster
 
Posts: 7,074
Default "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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.