Login | |
|
 |
Re: asp insert statement - 1/27/2005 6:14:54 AM
|
|
 |
|
| |
Snipah
Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
|
remove the quotes if it's a VAR. b/c this line looks correct, so it must be later in the script. Post more of this script excerpt, to find out if the error is a little later (sometimes it happens that the error is shown in the first line of the Function, while the actual error is somewhere inside the function) [8)]
|
|
| |
|
|
|
 |
Re: asp insert statement - 1/30/2005 8:29:51 PM
|
|
 |
|
| |
carlb007
Posts: 7
Score: 0
Joined: 1/20/2005
From:
Status: offline
|
sql="insert into events(paragraph1,paragraph2,paragraph3,date,Event)values('"&p1&"','"&p2&"','"&p3&"','"&my_date&"','"&head1&"')" error---------------------------------------^ (expected end of statement) ------------------------------------------------------------------------------ <% my_date=request.form("startdateday")&"/"&request.form("startdatemonth")&"/"&request.form("startdateyear")%> <% head=request.form("p1")%> <% p1=request.form("p1")%> <% p2=request.form("p2")%> <% p3=request.form("p3")%> <% response.write(my_date)%> <% todo=request.querystring("todo")%> <% what=request.querystring("what")%> <% id=request.querystring("id")%> <% Dim oConn2, oRs2, Ofld2 Set oConn2=Server.CreateObject("ADODB.Connection") oConn2.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../fpdb/new_db.mdb") Set oRs2=Server.CreateObject("ADODB.Recordset") oRs2.open "select * from events order by Date DESC",oConn2 %> <% if what="event" and todo="create" then%> <% sql="insert into events(paragraph1,paragraph2,paragraph3,date,Event)values('"&p1&"','"&p2&"','"&p3&"','"&my_date&"','"&head&"')"%> <% oconn2.execute(sql) %> item created <% end if%> <% if what="event" and todo="del" then%> <% sql="delete from events where id="&id %> <% oconn2.execute(sql)%> item deleted <% end if%> <%ors2.Close%> <%oconn2.close%> <%Set ors2 = Nothing%> <%Set oConn2 = Nothing%> that is ALL of my code :( the lower update statement works fine if i remove the other one out. i have tried inserting all the same variables in the columns with the same error. How can this be when the p1,p2,p3 variables are going through ok and the error is only been hit at the end? there seems to be no logic to this error at all its driving me nuts. Please help!!
|
|
| |
|
|
|
 |
Re: asp insert statement - 1/30/2005 8:52:10 PM
|
|
 |
|
| |
carlb007
Posts: 7
Score: 0
Joined: 1/20/2005
From:
Status: offline
|
also: <% sql="insert into events(paragraph1,paragraph2,paragraph3,date,event)values('"&p1&"','"&p2&"','"&p3&"','"&my_date&"','test')"%> <% sql="insert into events(paragraph1,paragraph2,paragraph3,date)values('"&p1&"','"&p2&"','"&p3&"','"&my_date&"')"%> both the above lines work! so im getting more lost :( sorry for spamming on post didnt mean to :(
|
|
| |
|
|
|
|
|