Link to home
Start Free TrialLog in
Avatar of marian68
marian68

asked on

transfer the records from a passworded database

How to use the "INSERT INTO" but having a passworded source database that is the table from which I transfer the records is in a passworded database.
Thank you
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

I guess you would use something like this...

INSERT INTO tblA
 SELECT *
FROM  [C:\database.mdb;PWD=mypass;].tblB;




Are you doing this from the Source database or Destination database?
Avatar of marian68
marian68

ASKER

It doesn't work. Access sees [C:\database.mdb;PWD=mypass;] like a path and doesn't recognize it.
Thank you
For LSM Consulting; I'm doing this from Destination database and the passworded database is the source database.
Thank you
Try this:

INSERT INTO DestinationTable SELECT * FROM  SourceTable IN 'C:\database.mdb;PWD=mypass;'

Obviously your DestinationTable and SourceTable would have to be identical in terms of structure. If not, you'll have to define the columns.
I take it you have modified the path and password to your own values?
for Peter57r: of course I modified the path. No problem when I transfer the data from the database with no password.
for LSMConsulting: Still access sees 'C:\database.mdb;PWD=mypass;'
like a path and I receive a message "can not find the path......"
Thank you
Both versions should work.  So it sounds like a problem with the path string .


No problem with my path string.
I tried with another database without password and when I have the path 'C:\database.mdb;' Access doesn't recognize the path. After I delete the semicomma in the end of the path (;) Access has no problem in recognizing the path. Maybe instead of (;) I have to put another sign.
Thank you
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial