Dim objConn As System.Data.OleDb.OleDbConnection
Dim objCmd As System.Data.OleDb.OleDbCommand
Dim strConnString,strSQL As String
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("database/mydatabase.mdb")&";Jet OLEDB:Database Password=;"
objConn = New System.Data.OleDb.OleDbConnection(strConnString)
objConn.Open()
strSQL = "INSERT INTO customer (CustomerID,Name,Email,CountryCode,Budget,Used) " & _
"VALUES ('C005','Weerachai Nukitram','[email protected]','TH','2000000','1000000')"
objCmd = New System.Data.OleDb.OleDbCommand(strSQL,objConn)
Try
objCmd.ExecuteNonQuery()
Catch ex As Exception
lblText.Text = lblText.Text & "<br> - Record not insert was (" & ex.Message & ")"
End Try
objCmd = Nothing
objConn.Close()
objConn = Nothing
ASP.NET System.Data.OleDb & ExecuteNonQuery() - Access Database