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高手帮帮忙,看一下,权限我都设置了啊,可是还是这样的问题

解决方案 »

  1.   

    access? 是不是在程序运行时,ACCESS在软件中是表打开的状态? 把access软件关了再试试.
      

  2.   

    检查用户权限, aspnet(iis5) network service(iis6)的写入权限另检查文件是不是只读
      

  3.   

    看看updatesql 的值直接拉到access运行看看
      
    *****************************************************************************
    欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html