Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Password, Access, Select statement
Message
From
16/06/2003 03:40:21
 
 
To
16/06/2003 03:05:00
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00800231
Message ID:
00800257
Views:
23
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
Map
View

Click here to load this message in the networking platform