Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

not able to delete record.

Status
Not open for further replies.

kmsam2

Programmer
May 21, 2003
29
MY
After adding index key into table, not able to delete record from table.

VB. Net
using below syntax:

Public Function mtdSQLExec(ByVal v_strSQL As String) As Integer
On Error GoTo ErrorHandler

Dim conn As OdbcConnection = New OdbcConnection(g_strConnString)
conn.Open()
Dim comm As OdbcCommand = New OdbcCommand(v_strSQL, conn)
Dim nRC As Integer 'store the number of records affected

nRC = comm.ExecuteNonQuery()
conn.Close()

ExitPath:
Exit Function

ErrorHandler:
'mtdNew = Err.Number
MsgBox("Database error! Please contact xxxx")
mtdLog(v_strSQL)

mtdSQLExec = 1 'return "1" to indicate error has occured...

Resume ExitPath
End Function

Sam.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top