PDA

View Full Version : What's wrong with this code??


plasterx
10-31-2005, 03:16 AM
Hi all,

I seriously can't figure out what's wrong with this piece of code that gave me the error 'Expected end of statement'

<%
Set Conn = Server.CreateObject ("ADODB.Connection")
Set RS = Server.CreateObject ("ADODB.RecordSEt")
strConn = "DSN .... "
Conn.Open strConn

For i = 1 to Request("Delete").count
If Request("Delete")(i)<>"" then
SQL ="Delete from WholeCakes where WholeCakesCode = '"&Trim(Request("Delete")(i))"'"
RS.Open SQL,Conn

End if
NExt
Response.Redirect("show.asp")
%>

pls help. .thanks!

Roelf
10-31-2005, 09:18 AM
Hi all,

I seriously can't figure out what's wrong with this piece of code that gave me the error 'Expected end of statement'

<%
Set Conn = Server.CreateObject ("ADODB.Connection")
Set RS = Server.CreateObject ("ADODB.RecordSEt")
strConn = "DSN .... "
Conn.Open strConn

For i = 1 to Request("Delete").count
If Request("Delete")(i)<>"" then
SQL ="Delete from WholeCakes where WholeCakesCode = '"&Trim(Request("Delete")(i))&"'"
RS.Open SQL,Conn

End if
NExt
Response.Redirect("show.asp")
%>

pls help. .thanks!
I think you are missing the red ampersand