Hi there
I have 2 Access 2000 databases DB1.mdb and DB2.mdb
DB1.mdb is unprotected, but DB2.mdb is protected with password. The password is "mypassword".
In DB1.mdb there is a table named table1 and in
DB2.mdb there is a table named table2.
I would like to copy all data from table1 in DB1.mdb into
table2 in DB2.mdb
Is there a way to do this?
I have tried many different ways but it doesnot work.
This is what I have in VB:
Dim strPathtoDB1 As String 'path to database
Dim strPathtoDB2 As String
Dim cn1 As ADODB.Connection
Dim cn2 As ADODB.Connection
Set cn1 = New Connection
Set cn2 = New Connection
strPathtoDB1 = App.Path & "\DB1.mdb" 'unprotected database
cn1.CursorLocation = adUseClient
cn1.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPathtoDB1
strPathtoDB2 = App.Path & "\DB2.mdb" 'protected database
cn2.CursorLocation = adUseClient
cn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strPathtoDB2 & _
";Jet OLEDBatabase Password=mypassword"
cn1.Execute "INSERT INTO table2 IN DB2.mdb SELECT * FROM table1"
Thanks in advance,
pel
I have 2 Access 2000 databases DB1.mdb and DB2.mdb
DB1.mdb is unprotected, but DB2.mdb is protected with password. The password is "mypassword".
In DB1.mdb there is a table named table1 and in
DB2.mdb there is a table named table2.
I would like to copy all data from table1 in DB1.mdb into
table2 in DB2.mdb
Is there a way to do this?
I have tried many different ways but it doesnot work.
This is what I have in VB:
Dim strPathtoDB1 As String 'path to database
Dim strPathtoDB2 As String
Dim cn1 As ADODB.Connection
Dim cn2 As ADODB.Connection
Set cn1 = New Connection
Set cn2 = New Connection
strPathtoDB1 = App.Path & "\DB1.mdb" 'unprotected database
cn1.CursorLocation = adUseClient
cn1.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPathtoDB1
strPathtoDB2 = App.Path & "\DB2.mdb" 'protected database
cn2.CursorLocation = adUseClient
cn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strPathtoDB2 & _
";Jet OLEDBatabase Password=mypassword"
cn1.Execute "INSERT INTO table2 IN DB2.mdb SELECT * FROM table1"
Thanks in advance,
pel