Hi Im trying to access MS ACCESS DB via VB and I get this error ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
I have done:
- Change IIS manager -application pool App32 bits to true
- Downloaded DB drivers for Access
- Install Access Client
Nothings working at the moment, I've tried from 2 diffrent computers
This is my code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim vConnectionStringX As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\1767631\db_Assign_2.accdb;Persist Security Info=False;"
Dim rtfConn As New Data.Odbc.OdbcConnection(vConnectionStringX)
rtfConn.Open()
Dim cusFName As String = TextBox1.Text
Dim cusLName As String = TextBox2.Text
Dim cusTP As String = TextBox3.Text
Dim cusEmail As String = TextBox4.Text
Dim vSQL As String = "Insert into Customer(FirstName, LastName, Telephone, Email) Values (" & cusFName & "," & cusLName & "," & cusTP & "," & "cusEmail"")"
Try
Dim rtfSQLCMD As New Data.Odbc.OdbcCommand
rtfSQLCMD.Connection = rtfConn
rtfSQLCMD.CommandText = vSQL
Dim vResult As Integer = rtfSQLCMD.ExecuteNonQuery
MessageBox.Show("Customer registered! " & vResult)
Catch ex As Data.Odbc.OdbcException
Dim vErMsg As String = "*** Error occured while registering the customer ***" & ControlChars.NewLine
End Try
rtfConn.Close()
End Sub
Plese help me!