Solved

transfer the records from a passworded database

Posted on 2011-02-15
10
779 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:marian68
  • 4
  • 4
  • 2
10 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 34899124
I guess you would use something like this...

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




0
 
LVL 84
ID: 34900094
Are you doing this from the Source database or Destination database?
0
 

Author Comment

by:marian68
ID: 34900825
It doesn't work. Access sees [C:\database.mdb;PWD=mypass;] like a path and doesn't recognize it.
Thank you
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:marian68
ID: 34900842
For LSM Consulting; I'm doing this from Destination database and the passworded database is the source database.
Thank you
0
 
LVL 84
ID: 34902796
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.
0
 
LVL 77

Expert Comment

by:peter57r
ID: 34904487
I take it you have modified the path and password to your own values?
0
 

Author Comment

by:marian68
ID: 34909770
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
0
 
LVL 77

Expert Comment

by:peter57r
ID: 34914027
Both versions should work.  So it sounds like a problem with the path string .


0
 

Author Comment

by:marian68
ID: 34915718
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
0
 
LVL 77

Accepted Solution

by:
peter57r earned 250 total points
ID: 34916697
This is what I used to test the answer I posted..

INSERT INTO tbl_proid
SELECT *
FROM [L:\1Work\Databases\Database1.accdb;pwd=peter;].tbl_proid;
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question