Forum Moderators: open

Message Too Old, No Replies

Arrogant expected end of statement

Expected end of statement problem will never go away

         

LordAust

9:26 pm on Apr 11, 2004 (gmt 0)

10+ Year Member



Hi guys!

I have this totally annoying error on my page.
The code is supposed to edit the content of a ACCESS 2000 DB sent in from a normal form.

I get the error:
Expectedend of statement.
Line 25, Column 130. This is the UPDATE statement.
I cannot find the error.

I will post the source code.

<%
Qlink_id=Request.form("Reg_id") & " ";
Qlink_navn=Request.form("Reg_navn") & " ";
Qlink_active=Request.form("Reg_status") & " ";
Qlink_tekst=Request.form("Reg_tekst") & " ";
Qlink_url=Request.form("Reg_url") & " ";
Qlink_beskrivelse=Request.form("Reg_beskrivelse") & " ";
Qlink_tekst2=Request.form("Reg_link_tekst2") & " ";
Qlink_gruppe=Request.form("Reg_gruppe") & " ";

select case Request.Querystring("action")

case "edit":
Qlink_id = request.Form("Reg_id");

EditLink= "update LINK set LINK_NAME=" & trim(Qlink_navn) & ",LINK_ACTIVE='" & Qlink_active & "',LINK_TEXT='" & trim(Qlink_tekst)) & "',LINK_URL='" & trim(Qlink_url) & "',LINK_DESCRIPTION=" & trim(Qlink_beskrivelse) & ",LINK_TEXT_URL=" & trim(Qlink_tekst2) & ",LINK_GROUP='" & Qlink_gruppe & "' where LINK_ID=" & trim(Qlink_id);

'Response.Write(EditLink)
objcon.Execute EditLink, iResult;

'Response.Write("recored modified successfully")
response.Redirect("dsp_Employee.asp");

end select
%>

Got any idea?
My head is stuck in zombie mode it seems.... :(

[edited by: LordAust at 11:49 pm (utc) on April 11, 2004]

WebJoe

10:07 pm on Apr 11, 2004 (gmt 0)

10+ Year Member



Hi LordAust, welcome to WebmasterWorld [webmasterworld.com]
Uhhh...EditEmp is not defined, your UPDATE statement is in EditLink. Or did you cut out some of your code?

Birdman

10:35 pm on Apr 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm thinking the end of the sql statement should be:

where LINK_ID=" & trim(Qlink_id)

Leave out the (& "") part.

Also, I like to end all statements with a semicolon.

Birdman

LordAust

11:54 pm on Apr 11, 2004 (gmt 0)

10+ Year Member



WebJoe:
Thanks for welcoming me :)
I am hoping to stay!

To WebJoe and Birdman:
Both good advice, and I have updated my codings with the changes you suggested.

Unfortunately this had no real affect on the error message, which seems to be trying its best to ruin my day. And actually doing a good job at that, may I add.

So the problem remains.
The use of 'case', is in proper format right?

Birdman

12:01 am on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually, I think the select statement is wrong, now that you mention it. I believe it should start as:

select Request.Querystring("action")

Note: no case above

The select line should only contain the variable being compared and the cases follow.

BTW, welcome from Birdman as well.

mattglet

2:45 am on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Birdman-

You are incorrect. The proper format for a select statement is:

select case variable
case ...

end select

LordAust-
Have you tried removing all the ";" from the end of each line? I assume you are coding in VBScript, and I think they might be throwing a wrench in things.

You've also got a ":" after your case "edit". This also could be an issue.

-Matt

LordAust

10:33 am on Apr 12, 2004 (gmt 0)

10+ Year Member



"LINK_TEXT='" & trim(Qlink_tekst))"

Thats the bugger.
One ')' too much.

I'll be back with more info in this interessting case :)

Birdman

1:11 pm on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry about that guys. I knew I should've kept my nose out of this forum.