vb组件中recordset对象的错误(附代码)
源代码如下:
Dim pWarn, pName, pContent, dName, uName, pSDate, pEDate
Dim oConn As New ADODB.Connection
Dim oRS As New ADODB.Recordset
Dim strSql As String
On Error GoTo ErrHander
oConn.Open getConn
pWarn = Request.Form("pWarn")
pName = Request.Form("pName")
pContent = Request.Form("pContent")
dName = Request.Form("dName")
uName = Request.Cookies("uName")
pSDate = Request.Form("pSDate")
pEDate = Request.Form("pEDate")
''''''''''''''''''''''''''''''''''''''''
'strSql = "insert into db_plan(pWarn,pName,pContent,dName,uName,pSDate,pEDate) values(" & pWarn & ",'" & pName & "','" & pContent & "','" & dName & "','" & uName & "','" & pSDate & "','" & pEDate & "')"
'oConn.Mode = adModeReadWrite
'oConn.Execute strSql
'''''''''''''''''''''''''''''''''''''''''
strSql = "select * from db_plan"
oRS.Open strSql, oConn, adOpenDynamic, adLockPessimistic
Response.Write strSql
oRS.AddNew
oRS("pWarn") = pWarn
oRS("pName") = pName
oRS("pContent") = pContent
oRS("dName") = dName
oRS("uName") = uName
oRS("pSDate") = pSDate
oRS("pEDate") = pEDate
oRS.Update
Response.Write "ok"
oRS.Close
Set oRS = Nothing
oConn.Close
Set oConn = Nothing
ErrHander:
Response.Write Err.Description
错误提示:
select * from db_plan不能打开,数据库或对象为只读
我确认我的数据库不是只读的,请问如何修改上述代码?
谢谢