Using INSERT INTO to open a password protected database.

  • Thread starter Thread starter dmeckley
  • Start date Start date
D

dmeckley

I'm copying the records from a table from one database to a table in
another database.

Could someone help me with the proper syntax for adding a Jet OLEDB password
to an external MSAccess database in a INSERT INTO using the IN clause? I
have not been able to get anything going on it, but it must be something
like this:

INSERT INTO EQTest IN 'C:\Development\Database.mdb'
'Microsoft.Jet.OLEDB.4.0; Jet OLEDB:Database Password=mypwd' SELECT * FROM
EQTEST

(The statement above works fine when a database password is not being used)



Thanks in advance for any advice.

Dave M.
 
Hi Dave,

I don't know if this post from Doug might help
(I have not tested for Jet OLEDB; plus you
probably want to do it all in code....):

******* quote *********
Just in case anybody is following this, I figured out how
to do it. In the Source Connect Str property of the
Query, I input the following:

MS Access;PWD=Whatever;DATABASE=C:\F2000\FalconSec.mdb

and leave the Source Database property blank. Now I
don't have to link the tables contained in this database.

Doug

//////////////////////////////
I have a Query defined: qryUsers
This query has as it's source database: c:\f2000\falconsec.mdb
falconsec.mdb is password protected.
If I double click on qryUsers, it says
"Not a valid password"
If I right click and select "Design View" I get a
Password Required box.
I then enter the password and have the design view for
the query.
If I right click and select "Datasheet View" I get
"Not a valid password"

So, a password prompt doesn't popup when I actually go to
access the data. There must be some way to enter the
password in a property, right? Or don't they want you
doing this since it wouldn't be encrypted and then people
can easily find out what the password is?

Doug
********end quote *******

Perhaps you will have to use this technique
to just create a SELECT query to your remote
table, then use that query in your INSERT.

Of course, if that is the case, you could have
just linked to the remote db.
 
Back
Top