16-01-2008, 18:05
|
|
|
חבר מתאריך: 22.11.07
הודעות: 131
|
|
בעיה בעידכון נתונים בaccess
חברה, אם אפשר קצת עזרה, כתבתי את הקוד הבא לעידכון נתונים בטבלת
וזה עושה לי את השגיאה הבאה: (הפעלתי את זה כשהתוכנה סגורה access
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only.
/asp/clubMembersInsert.asp, line 40
:הקוד
<html dir="rtl">
<head>
<title></title>
<meta http-equiv="content-type"
content="text/html;charset=windows-1255" />
</head>
<body>
<%
lName = Request.form("lName")
fName = Request.form("fName")
bYear = Request.form("bYear")
eMail = Request.form("eMail")
bYear = CInt(bYear)
Function fixQuotes(theString)
fixQuotes = Replace(theString, "'", "''")
End Function
lName = fixQuotes(lName)
fName = fixQuotes(fName)
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=" & Server.Mappath("db\clubMembers.mdb") & ";" & _
"Uid=admin;" & _
"Pwd=;"
Set oRS = Server.CreateObject("ADODB.Recordset")
mySQL = "SELECT * FROM tClub WHERE 1=0"
oRS.Open mySQL, oConn, 3, 3
oRS.AddNew
oRS.Fields("fName").Value = fName
oRS.Fields("lName").Value = lName
oRS.Fields("bYear").Value = bYear
oRS.Fields("eMail").Value = eMail
oRS.Update
oRS.Close
Set oRS = Nothing
oConn.Close
Set oConn = Nothing
%>
תודה לך. פרטיך נרשמו בהצלחה.
<br />
<a href="clubMembersInsert.html">
חזרה לטופס
</a>
</body>
</html>
|