New to the forum, so thanks for having me.
I'm submitting a form, and attempting to save it to a local copy of an ACCESS 2007 database. When I am submitting the form, I get the following error:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.
/JustBorn/form_submit.asp , line 414
Line 414 is: rs.Open "customer",myco nn,adOpenStatic ,adLockOptimist ic
been pouring over this for a while now, and finally breaking down and asking. The DB and form_submit.asp are in the same directory on an IIS server, held locally, but will be posted eventually. Any and all help would be appreciated.
Anthony
Beginner Programmer
I'm submitting a form, and attempting to save it to a local copy of an ACCESS 2007 database. When I am submitting the form, I get the following error:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.
/JustBorn/form_submit.asp , line 414
Line 414 is: rs.Open "customer",myco nn,adOpenStatic ,adLockOptimist ic
been pouring over this for a while now, and finally breaking down and asking. The DB and form_submit.asp are in the same directory on an IIS server, held locally, but will be posted eventually. Any and all help would be appreciated.
Anthony
Beginner Programmer
Code:
<%
DIM repID, cusName, cusPhone, cusAddress, cusCity, cusState, cusZip, product, upccode, mfgcode, bestByDate, purchased, store, notes, contacted, spokewith
repID = request.form("repID")
cusPhone = request.form("cusPhone")
cusAddress = request.form("cusAddress")
cusCity = request.form("cusCity")
cusState = request.form("cusState")
cusZip = request.form("cusZip")
product = request.form("product")
upccode = request.form("upccode")
mfgcode = request.form("mfgcode")
bestByDate = request.form("bestByDate")
purchased = request.form("purchased")
store = request.form("store")
notes = request.form("notes")
contacted = request.form("contacted")
spokewith = request.form("spokewith")
DIM myconn, RS, curDate, dbPath, dbName
curDate = Date
dbName = "JustBorn.accdb"
dbPath = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Server.MapPath(dbName) & ";Persist Security Info=False;"
Set myconn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
myconn.Open = dbPath
rs.Open "customer",myconn,adOpenStatic,adLockOptimistic
rs.AddNew
rs("CurDate") = curDate
rs("RepID") = repID
rs("CusName") = cusName
rs("CusPhone") = cusPhone
rs("CusAddress") = cusAddress
rs("CusCity") = cusCity
rs("CusState") = cusState
rs("CusZip") = cusZip
rs("Product") = product
rs("UPCCode") = upccode
rs("MFGCode") = mfgcode
rs("BestByDate") = bestByDate
rs("Purchased") = purchased
rs("Store") = store
rs("Notes") = notes
rs("Contacted") = contacted
rs("spokewith") = spokewith
rs.Update
'grab the ID value
DIM ID
ID = RS(0)
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Just Born</title>
</head>
<body>
<p align="center">
<table align="center" cellpadding="5" border="3" bordercolordark="#707070" bordercolorlight="#E0E3DC">
<tr>
<td align="center" valign="middle">
SAVE CONFIRMED
</td>
<tr>
<td align="center" valign="middle" bgcolor="#E6EFF7">
<p style="font-family:sans-serif;">
Record <%=ID%> Saved<br>
<input type="Button" value="CONTINUE" onClick="window.location='<%=ReturnTo%>'">
</p>
</td>
</tr>
</table>
<!--#include file="footer.asp"-->
</p>
</body>
</html>
<%
'cleanup
rs.Close
set rs=nothing
myconn.close
set myconn=nothing
%>
Comment