日期:2014-05-20  浏览次数:20526 次

.NET 操作必须使用一个可更新的查询
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

高手帮帮忙,看一下,权限我都设置了啊,可是还是这样的问题

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