G
Guest
Can I use ADO.NET to connect to a mdb database? I have not been able to find
anything on this.
Also, I am trying to use ADO in VB.NET and for some reason I can't seem to
get a command to work.
The code is below
Imports System.Data.Odbc
Imports System.Data
Imports System.Data.OleDb
Dim oODBCConnection As OdbcConnection
Dim sConnString As String = Masterconn
oODBCConnection = New Odbc.OdbcConnectio(sConnString)
Dim cmdUpdateDB As New ADODB.Command
With cmdUpdateDB
.ActiveConnection.ConnectionString =
oODBCConnection.ConnectionString
.CommandType = ADODB.CommandTypeEnum.adCmdText
.CommandText = "Insert into tbl_Songs (title) values ('" &
txtNewSong.Text & "')"
.Execute()
End With
I know the connection string is good because I use it to connect to the
database and load data into a recordset.
ANy ideas?
anything on this.
Also, I am trying to use ADO in VB.NET and for some reason I can't seem to
get a command to work.
The code is below
Imports System.Data.Odbc
Imports System.Data
Imports System.Data.OleDb
Dim oODBCConnection As OdbcConnection
Dim sConnString As String = Masterconn
oODBCConnection = New Odbc.OdbcConnectio(sConnString)
Dim cmdUpdateDB As New ADODB.Command
With cmdUpdateDB
.ActiveConnection.ConnectionString =
oODBCConnection.ConnectionString
.CommandType = ADODB.CommandTypeEnum.adCmdText
.CommandText = "Insert into tbl_Songs (title) values ('" &
txtNewSong.Text & "')"
.Execute()
End With
I know the connection string is good because I use it to connect to the
database and load data into a recordset.
ANy ideas?