Hello,
Once you create a .dsn file, the connection data is located in the file. To then reconnect using a .dsn file, then connect to the file with the DataSource command.
Here is database connection code to a .dsn file
//ODBC Connection to a Microsoft Access 2007 database
Dim db as ODBCDatabase
db = new ODBCDatabase
db.DataSource="filedsn=c:\user\test.dsn;DBQ=C:\UserMyContactList.mdb;User Id=admin;Password=;"
if db.Connect() then
MsgBox "Connected"
else
MsgBox "Connection failed: " + db.ErrorMessage
end if
db.Close
Here is what is in the .dsn file
[ODBC]
DRIVER=Microsoft Access Driver (*.mdb, *.accdb)
UID=admin
UserCommitSync=Yes
Threads=3
SafeTransactions=0
PageTimeout=5
MaxScanRows=8
MaxBufferSize=2048
FIL=MS Access
DriverId=25
DefaultDir=C:\user
DBQ=C:\user\MyContactList.mdb
Happy to help,
Eugene
I Wish I Knew How To… Program Access 2010 with Real Studio Desktop Apps in WindowsAuthor Website:
http://scispec.ca/Realbasic/Publish/Publish.htmVendor Website:
http://great-white-software.com/rblibrary/index.php?main_page=index&manufacturers_id=34