Last post Apr 09, 2008 02:47 PM by m00gsFTW
Apr 09, 2008 02:04 PM|m00gsFTW|LINK
here are the basics. i am using:
when i try to delete a record from a table, i get the following error message:
Keyword not supported: 'provider'.
here is my connection string:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Documents and Settings\me\My Documents\Access\mb\mb.accdb;
i am able to add records and edit existings ones, but i can't seem to delete records. i have tried connecting to my database via
System.Data.SqlClient and System.Data.OleDb, but still no deletes. i even treid removing the provider from the string, but it barks at me with another error.
here are the procedure i am using:
Public Sub DeleteRow()
ExecNonQuerySQL("delete from " & pDT.TableName & " where " & pIdentityField & "=" & pDT.Rows(0).Item(pIdentityField))
Public Sub ExecNonQuerySQL(ByVal SQLText As String)
If Conn.State = Data.ConnectionState.Open Then
Dim comm As New Data.SqlClient.SqlCommand(SQLText, Conn)
'Dim comm As New Data.OleDb.OleDbCommand(SQLText, Conn)
comm.CommandType = Data.CommandType.Text
thanks in advance.
Apr 09, 2008 02:18 PM|Mikesdotnetting|LINK
Where's the code for creating the connection and applying the string? For Access, you should only use System.Data.OleDb.
Apr 09, 2008 02:47 PM|m00gsFTW|LINK
doh! i am a total noob. you're right, i have to use the oledb interface. i thought i had tried both, but i must have confused that with another set of operations.
thanks for making that obvious to me =D