database still not affected
-
hi all, many thanx to you guys .. ur really doin a great job but my problem still accours .. i have no error messages against execution but the database not affected anything after this command (dbcommand.ExecuteNonQuery()) is ignored i don't know why?!! here is the code .. Private Sub addbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addbtn.Click Dim conn As New OleDb.OleDbConnection("provider=microsoft.jet.oledb.4.0; data source=" + Server.MapPath("mydatabase.mdb")) conn.Open() Try Dim sql As String sql = "insert into table1(column1,column2) values ('" & txt1.Text & "','" & txt2.Text & "') " Dim dbcommand As New OleDb.OleDbCommand(sql, conn) dbcommand.ExecuteNonQuery() Catch ex As Exception End Try conn.Close() End Sub anyone could help me with this plz.
-
hi all, many thanx to you guys .. ur really doin a great job but my problem still accours .. i have no error messages against execution but the database not affected anything after this command (dbcommand.ExecuteNonQuery()) is ignored i don't know why?!! here is the code .. Private Sub addbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addbtn.Click Dim conn As New OleDb.OleDbConnection("provider=microsoft.jet.oledb.4.0; data source=" + Server.MapPath("mydatabase.mdb")) conn.Open() Try Dim sql As String sql = "insert into table1(column1,column2) values ('" & txt1.Text & "','" & txt2.Text & "') " Dim dbcommand As New OleDb.OleDbCommand(sql, conn) dbcommand.ExecuteNonQuery() Catch ex As Exception End Try conn.Close() End Sub anyone could help me with this plz.
Hi there, Your code looks good, IMO. How about if trying with another DB (maybe SQL server)...? if good, maybe the problem with MS Access. Try to reinstall it (my friends did experience this issue, after reinstalling, everything is fine) If you find out better way, post it here. Thanx << >>