Lynus
Technical User
- Apr 12, 2003
- 69
Please help. I have an application where I want to set the ADO database paths at run time. I have the ADO objects on the app with no connection string. Then as the form loads I try to set the connection string and recorset. The database will be with the program executable when it installs.
Here is the code
Private Sub Form_Load()
Dim mypath As String
mypath = App.Path
Dim dbconnect As String
dbconnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " + mypath + "\BugDB.mdb;Persist Security Info=False"
Adodc1.ConnectionString = dbconnect
Adodc1.RecordSource = "Bugs"
When I run the app I get an error : "Data source name not found and no default driver specified" I cant figure out what I am doing wrong. Please help!
Here is the code
Private Sub Form_Load()
Dim mypath As String
mypath = App.Path
Dim dbconnect As String
dbconnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " + mypath + "\BugDB.mdb;Persist Security Info=False"
Adodc1.ConnectionString = dbconnect
Adodc1.RecordSource = "Bugs"
When I run the app I get an error : "Data source name not found and no default driver specified" I cant figure out what I am doing wrong. Please help!