I am trying to connect to a database in my bin/ and instead of setting up a oldDbConn at design time, I am coding it at run time.
Try
Dim app As AppDomain
Dim p As Application
Dim myPath1 = p.StartupPath
Dim myPath = app.CurrentDomain.BaseDirectory
myConnStr="Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data Source=" & myPath1 &" \myDatabase.mdb;etc..etc
mydb = New OleDbConnection(myConnStr)
mydb.Open() ===>Unknown ERROR
myState = mydb.State()
Catch myerror As OleDbException
MessageBox.Show(myerror.Message, "Database Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
I keep getting an UnKNOWN error at mydb.Open()...
Any suggestions as to what I am doing wrong ?
Thanks
Try
Dim app As AppDomain
Dim p As Application
Dim myPath1 = p.StartupPath
Dim myPath = app.CurrentDomain.BaseDirectory
myConnStr="Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data Source=" & myPath1 &" \myDatabase.mdb;etc..etc
mydb = New OleDbConnection(myConnStr)
mydb.Open() ===>Unknown ERROR
myState = mydb.State()
Catch myerror As OleDbException
MessageBox.Show(myerror.Message, "Database Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
I keep getting an UnKNOWN error at mydb.Open()...
Any suggestions as to what I am doing wrong ?
Thanks