copying a table (NEED HELP PLEASE!!!!)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

DoCmd.RunSQL SELECT mat_tbl1.* INTO mat_tbl1
IN 'C:\test\test.mdb' FROM mat_tbl1



The code above copies the mat_tbl1 table into the
C:\test\test.mdb.

It didn't work because C:\test\test.mdb is password
protected.

The password is 1245c


How can I write this same SQL statement to copy the table
into the password protected database C:\test\test.mdb?

Thank you
 
DoCmd.RunSQL SELECT mat_tbl1.* INTO mat_tbl1
IN 'C:\test\test.mdb' FROM mat_tbl1



The code above copies the mat_tbl1 table into the
C:\test\test.mdb.

It didn't work because C:\test\test.mdb is password
protected.

You can do most things with the [square bracket] syntax: here is an
example. You should be able to pass a pwd= parameter like this.

SELECT *
INTO [ODBC;DSN=mysql_pullach;UID=wwwrun;PWD=xxxxxxxxx;].ACCOUNTS
FROM SYSADM_ACCOUNTS

There are more details in help under SELECT INTO and then IN CLAUSE, and
under the DAO .Connect property. I think you could experiment along the
lines of

SELECT ALL *
INTO mat_tbl1
IN [database=C:\test\test.mdb;pwd=eric;]
FROM mat_tbl1

but it's not a syntax I use myself very often.

Hope it helps all the same!


Tim F
 
Back
Top