General information
Category:
Database DAO/RDO/ODBC/ADO
Plamen,
remember that I have two tables involved here. The D:\backup.mdb is the one that needs the connection.
Dim strPath = "D:\backup.mdb"
' I also have set the database password for D:\backup.mdb (as 'password').
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Jet OLEDB:Database Password = password; Data Source=""" + strPath + """"
' Opens the connection to D:\backup.mdb
connKRS.Open(strConn, "", "")
...
...
...
' These next lines will insert the selected records coming
' from "C:\localdata.mdb"
Dim stQuery As String
stQuery = "INSERT INTO remittance SELECT * FROM remittance IN " + """" + "C:\localdata.mdb" + """" + " Where (DateTimeStamp >= #6/16/2003 12:00:00 AM# And DateTimeStamp < #6/17/2003 12:00:00 AM#)"
' this will fill remittance table in the d:\backup.mdb with
' selected records coming from the remittance table in the c:\localdata.mdb,
' but since i already have a database password for localdata.mdb.. the
' Execute method won't work.
connKRS.Execute(stQuery)
connKRS.Close()
Are you saying that i should add another connection for my C:\localdata.mdb in order for me to retrieve its contents? If this is on your mind, how would you code the record "insertion" in D:\backup.mdb?
-Erik
>You must put password into connection string. Something like:
>Provider=Microsoft.Jet.OLEDB.4.0;Password="password";User ID=Admin;Data Source=C:\localdatabase.mdb;
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only