PDA

View Full Version : خطای بروز نمودن بانک اطلاعاتی (upload) در asp با access



mehranmus
جمعه 27 بهمن 1385, 11:06 صبح
با سلام خدمت دوستان عزیز

من می خوام یه رکورد به بانک اطلاعاتی اضافه کنم

اما یه خطا دیونم کرده

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only.
/sample/ch04/counter2.asp, line 38
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
Page:
GET /sample/ch04/counter2.asp
Time:
Friday, February 16, 2007, 11:24:08 AM

کسی می تونه کمکم کنه
پوشه وب خودم و کد صفحه دارای خطا رو براتون می زارم
نام فایل add.asp

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>شمارنده</title>
<!-- #include file="adovbs.inc" -->
</head>
<body>
<font face="Nazanin" align="right">
<p dir="rtl">


<p align="center">
<%
add = request.servervariables("path_info")
response.write "<p>" & add & ":آدرس این صفحه</p>" &vbcrlf
set add1 = server.createobject("adodb.connection")
openstr = "driver={microsoft access driver (*.mdb)};"&_
"dbq=" & server.mappath("main.mdb")
add1.open openstr,"",""
sql = "SELECT url, count"& _
" FROM count" & _
" WHERE url = '" & add & "';"

set rshits = server.createobject("adodb.recordset")
rshits.open sql, add1, adopendynamic, adLockOptimistic , adcmdtext
If rsHits.EOF Then
Response.Write "<p>شما برای اولین بار از این صفحه بازدید می نمایید</P>"
rshits.addnew
rshits("url") = add
count =1
else
Response.Write "<p>" & rshits("count") & ":"& "تعداد بازدید از این صفحه</P>"
count = rshits("count") + 1
end If
rshits("count") = count
rshits.update
'rshits.Close
set rshits = nothing
add1.close
set add1 = nothing
%>
</p>
</body>
</html>