傻人问的笨问题,请帮忙解答
Private Function GetURL(ByVal ID As Int32) As String
Dim StringSQL As String
'连接数据库
//Dim ConnectString = System.Configuration.ConfigurationSettings.AppSettings( "ConnectString ")
ConnectString= "data source=E:\IIS\TouchScreenWeb\data\data.mdb;provider =microsoft.jet.oledb.4.0 "
Dim conn As OleDbConnection
conn = New OleDbConnection(ConnectString)
conn.Open()
StringSQL = "Update [T_GUIDE] set CLICKED_NUMBER=CLICKED_NUMBER+1 where [ID] = " & ID
Dim cmd As New OleDbCommand
cmd.CommandText = StringSQL
cmd.Connection = conn
cmd.ExecuteNonQuery()
cmd.CommandText = "select URL from [T_GUIDE] where [ID] = " & ID
GetURL = cmd.ExecuteScalar
conn.Close()
conn = Nothing
End Function
执行到cmd.ExecuteNonQuery(),执行更新操作是提示:
操作必须使用一个可更新的查询。
连接,应该没问题,因为把这句 "// "掉后查询没有问题!
------解决方案--------------------E:\IIS\TouchScreenWeb\data\有不有权限
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)
http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
------解决方案--------------------把你的目录加个aspnet这个用户权限