-
update problem
I am using following code to update Access 2000 table. It executes the query but database is not updated and no error is generated. any body can help?
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
Dim varGroupId As Integer
Dim str As String
cn1 = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App_Path() & "\client.mdb;")
cn1.Open()
varGroupId = dgvGroup("clmGroupId", dgvGroup.CurrentRow.Index).Value
str = "Update GroupMaster set [GroupName]='" & txtGroupName.Text & "' WHERE [GroupID]=" & varGroupId
cmd1 = New OleDbCommand(str, cn1)
dr1 = cmd1.ExecuteNonQuery()
MsgBox(dr1)
cn1.Close()
cmd1.Dispose()
End Sub
-
Re: update problem
-
Re: update problem
Yes, This query is working in Access 2000.
-
Re: update problem
Paste it here, The query that WORKS in Access (with all values)
-
Re: update problem
Query that worked in Access 2000 is
UPDATE GroupMaster SET GroupName = 'san' WHERE GroupID=2;
Table structure is:
GroupID Number
GroupName Text Required Yes AllowZeroLength No
Remark Memo
ParentGroupID Number
-
Re: update problem
Could it be the log in info? I don't user a user or password... perhaps getting read only access?