|
-
February 14th, 2009, 06:55 AM
#1
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
-
February 14th, 2009, 02:54 PM
#2
-
February 15th, 2009, 05:03 AM
#3
Re: update problem
Yes, This query is working in Access 2000.
Last edited by sanjeev111; February 15th, 2009 at 05:15 AM.
-
February 15th, 2009, 09:37 PM
#4
Re: update problem
Paste it here, The query that WORKS in Access (with all values)
-
February 16th, 2009, 07:24 AM
#5
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
-
February 17th, 2009, 04:06 AM
#6
Re: update problem
Could it be the log in info? I don't user a user or password... perhaps getting read only access?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|