Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error "Expected end of statement"

Status
Not open for further replies.

Snappy2873

Programmer
Mar 29, 2002
54
0
0
US
Good afternoon,
I'm getting the dreaded "expected end of statement" error on the GetDetails function. Can anyone see where the syntax needs to be fixed?

if Request.QueryString("CRUD") = "C" then
RW "Entry successful" & RW GetDetails("empNameFirst","tblUser",Session("USER")) &
RW "your Document Number is" & Request.Form("txtdocident")
end if

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/techlibrary/docentryconfirm.asp, line 109

RW "Entry successful" & RW GetDetails("empNameFirst","tblUser",Session("USER")) &
---------------------------^
Thanks,
snappy


 
did you Response.Write when you wrote RW

try this:

if Request.QueryString("CRUD") = "C" then
RW "Entry successful" & GetDetails("empNameFirst","tblUser",Session("USER")) &
RW "your Document Number is" & Request.Form("txtdocident")
end if

-DNG
 
Yes RW is my Response.write.
I took the RW off the getdetails function and it now bombs at the end of the ampersand.

Microsoft VBScript compilation error '800a03ea'

Syntax error

/techlibrary/docentryconfirm.asp, line 109

RW "Entry successful" & GetDetails("empNameFirst","tblUser",Session("USER")) &
--------------------------------------------^

Thanks,
snappy
 
Microsoft VBScript compilation error '800a03ea'

Syntax error

/techlibrary/docentryconfirm.asp, line 109

RW "Entry successful" & GetDetails("empNameFirst","tblUser",Session("USER")) &
------------------------------------------------------------------------------^
the one on the far end
 
lets break down first to smaller code:

if Request.QueryString("CRUD") = "C" then
GetDetails("empNameFirst","tblUser",Session("USER"))
end if

does that work??

-DNG
 
Well it's not liking my parenthesis in this situation.
Microsoft VBScript compilation error '800a0414'

Cannot use parentheses when calling a Sub

/techlibrary/docentryconfirm.asp, line 109

GetDetails("empNameFirst","tblUser",Session("USER"))
----------------------------------------------------^

This code from another page works fine:
<table>
<tr>
<td class="header">Welcome Back <%RW GetDetails("empNameFirst","tblUser",Session("USER")) & " " & GetDetails("empNameLast","tblUser",Session("USER"))%>!</td>
</tr>
</table>

I'm really just trying to maintain a user session from page to page, similar to what the above code does.

Thanks for your help,
snappy
 
Sounds like the error says that GetDetails is declared as a Sub and not a Function that returns a value. Show your code for that.

Lee
 
how about this:
if Request.QueryString("CRUD") = "C" then
RW "Entry successful<BR/>"
RW GetDetails("empNameFirst","tblUser",Session("USER"))
RW "<BR/>"
RW "your Document Number is" & Request.Form("txtdocident")
end if

-DNG
 
Hey guys,
my session variables r outta whack, i'm gonna check my code, i'll get back to ya'll.
Thanks for your help
snappy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top