I built a rather large form to update the database, with a second page to handle inserting the form data. I was getting the above error and decided in order to trouble shoot, that I would take the form down to one item to insert and the page with the SQL down to the same.
It states that the issue is with line 46. Line 46 is:
stk is setup as text in my database, due to the customer being the one to enter their stock number (some of which will have letters incorporated into the numbers). The ListingID is actually a number that is auto assigned.
The form page looks like so:
The page handling the insertion looks like so:
I am trying to use ListingID to identify the specific listing to be edited.
~E
It states that the issue is with line 46. Line 46 is:
Code:
Set Rec = oConn.Execute("UPDATE cust_inventory SET [STK]="& frmstk &" WHERE [ListingID]= '"& listing &"' ")
stk is setup as text in my database, due to the customer being the one to enter their stock number (some of which will have letters incorporated into the numbers). The ListingID is actually a number that is auto assigned.
The form page looks like so:
Code:
<%=Response.Write("Welcome ")%>
<%=Response.Write(Session("sessUserName"))%>
<%Response.Write("<br>")%>
<%listing=Request.Querystring("listing")%>
</head>
<body>
Edit Listings
<form name="inventory" method="post" action="editlistings2.asp">
STK:<input name="stk" type="text" size="6" maxlength="6"><br>
<input name="Submit" type="submit"> <input name="Clear" type="reset" value="Clear">
</form>
</body>
The page handling the insertion looks like so:
Code:
</head>
<%=Response.Write("Welcome ")%>
<%=Response.Write(Session("sessUserName"))%>
<body>
<%
UserID = Session("sessUserName")
listing=Request.Querystring("listing")
frmstk=Request.Form("stk")
if request.form("submit") <> "" Then
dim oConn, Rec, sConn, sFilePath
Set oConn = Server.CreateObject("ADODB.Connection")
sFilePath = Server.MapPath("db/logins.mdb")
sConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sFilePath & ";"
oConn.Open sConn
Set Rec = oConn.Execute("UPDATE cust_inventory SET [STK]="& frmstk &" WHERE [ListingID]= '"& listing &"' ")
'response.write(sql)
End if
Rec.Close
oConn.Close
~E