Forum Moderators: open
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & strdbpath
RS=Server.CreateObject("ADODB.RecordSet")
sqlstmt =vbNullString
SQLStmt = sqlstmt & "UPDATE linksdata "
SQLStmt = SQLStmt & "SET linkurl= '" & edLink1 & "' "
sqlstmt = sqlstmt & ", Title='" & edtitle & "' "
......
SQLStmt = SQLStmt & ", Adddate='" & edate & " '"
---->SQLStmt = SQLStmt & "Where Linknum="& request("item")&""
response.write SQLstmt
Conn.Execute(SQLStmt)
the line with the arrow is where the problem lies. I am trying to have it change the record which has the linknum which is sent with the form. Make sense?
Thanks
added... - Also, not sure why you have the final & "", since all that's doing is adding ...errr... nothing to the end of the string.
My guess, then would be that perhaps the data expected is not getting passed. For example, I can bring up the error "missing operator" by not including the expected request("item"). Since all you have is request("item") I can't be sure if it's expecting the data via the post or get method. If the data is expected in the URL (the get method), check to see if your URL is passing this info (for example webpage.asp?item=1234). If it's passed from a form using the post method, go back to originating page and make sure the name of the field is the same as the request on the expecting page.
Hope that helps. :)
SQLStmt = SQLStmt & " Where Linknum=" & request("item")
That & "" is a trick that converts numbers and nulls to strings, but you don't need to do that here, since request is always going to return a string.
[aside: the expression 6 & "" returns "6". null & "" returns "". "foo" & "" returns "foo". It's a handy way to convert things to strings. I actually think null & "" should have returned null, but it's now a documented bug that it returns "".]