Private Sub cmdupdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdupdate.Click
Dim updatesql As String
updatesql = "update authors set au_id='" & txtid.Text & "',au_fname='" & txtfirstname.Text & "',au_lname='" & txtlastname.Text & "',phone='" & txtphone.Text & "',address='" & txtaddress.Text & "',city='" & txtcity.Text & "',state='" & txtstate.Text & "',zip='" & txtzip.Text & "',contract='" & Int(chkcontract.Checked) & "'where au_id='" & lstauthor.SelectedItem.Value & "'"
Dim con As New OleDbConnection(connectionstring)
Dim cmd As New OleDbCommand(updatesql, con) Try
con.Open()
Dim updated As Integer
updated = cmd.ExecuteNonQuery
lblstatus.Text = updated.ToString() & "records updated."
Catch err As Exception
lblstatus.Text = "error updating author."
lblstatus.Text &= err.Message
Finally
If (Not con Is Nothing) Then
con.Close()
End If
End Try
End Sub高手帮帮忙,看一下,权限我都设置了啊,可是还是这样的问题
Dim updatesql As String
updatesql = "update authors set au_id='" & txtid.Text & "',au_fname='" & txtfirstname.Text & "',au_lname='" & txtlastname.Text & "',phone='" & txtphone.Text & "',address='" & txtaddress.Text & "',city='" & txtcity.Text & "',state='" & txtstate.Text & "',zip='" & txtzip.Text & "',contract='" & Int(chkcontract.Checked) & "'where au_id='" & lstauthor.SelectedItem.Value & "'"
Dim con As New OleDbConnection(connectionstring)
Dim cmd As New OleDbCommand(updatesql, con) Try
con.Open()
Dim updated As Integer
updated = cmd.ExecuteNonQuery
lblstatus.Text = updated.ToString() & "records updated."
Catch err As Exception
lblstatus.Text = "error updating author."
lblstatus.Text &= err.Message
Finally
If (Not con Is Nothing) Then
con.Close()
End If
End Try
End Sub高手帮帮忙,看一下,权限我都设置了啊,可是还是这样的问题
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html