473,327 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

If must end with a matching End It

Does anyone know what is causing the error below. The following scipt runs
in .asp but not .aspx??? Please help.

Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30081: 'If' must end with a matching 'End If'.

<%
'Set Session ID for each visitor to the site.
if Request.Cookies("SID") = "" then
if Session("SID") = "" then
Function CreateGUID()
Dim oTypeLib, sGUID
set oTypeLib = Server.CreateObject("Scriptlet.Typelib")
sGUID = oTypeLib.GUID
sGUID = LCase(sGUID)
sGUID = Mid(sGUID, 1, Len(sGUID) - 2)
Set oTypeLib = Nothing
CreateGUID = sGUID
End Function
Response.Cookies("SID")=CreateGUID
Response.Cookies("SID").Expires = Date + 365
Session("SID") = CreateGUID
end if
end if
if Request.Cookies("SID") <> "" then
if Session("SID") = "" then
Session("SID") = Request.Cookies("SID")
end if
end if
if Session("SID") <> "" then
if Request.Cookies("SID") = "" then
Response.Cookies("SID") = Session("SID")
Response.Cookies("SID").Expires = Date + 365
end if
end if
'Set Tracking Variables for each visitor to the site.
if LEN(session("id")) < 1 then
if LEN(Request.QueryString("id")) <> 0 then
if LEN(Request.Cookies("id")) < 1 then
Session("id") = Request.QueryString("id")
Response.Cookies("id")=Request.QueryString("id")
Response.Cookies("id").Expires = Date + 365
Session("keywords") = Request.QueryString("keywords")
Response.Cookies("keywords")=Request.QueryString(" keywords")
Response.Cookies("keywords").Expires = Date + 365
Session("campaignno") = Request.QueryString("campaignno")
Response.Cookies("campaignno")=Request.QueryString ("campaignno")
Response.Cookies("campaignno").Expires = Date + 365
Session("adgroup") = Request.QueryString("adgroup")
Response.Cookies("adgroup")=Request.QueryString("a dgroup")
Response.Cookies("adgroup").Expires = Date + 365
end if
end if
end if
if LEN(Request.Cookies("id")) <> 0 then
Session("id") = Request.Cookies("id")
Session("keywords") = Request.Cookies("keywords")
Session("campaignno") = Request.Cookies("campaignno")
Session("adgroup") = Request.Cookies("adgroup")
end if
'Set session Referring URL, IP, Broswer Type so that it can be captured with
order.
if LEN(Session("referer")) < 1 then
Session("referer") = Request.ServerVariables("HTTP_REFERER")
Session("scriptname") = Request.ServerVariables("SCRIPT_NAME")
Session("useragent") = Request.ServerVariables("HTTP_USER_AGENT")
Session("remotehost") = Request.ServerVariables("REMOTE_HOST")
end if
%>

Nov 21 '05 #1
4 4017
Even in ASP, you really shouldn't put global code (i.e. function, sub,
class) inside an if-then block.Since I used code-behind, I don't know if it
is even allowed in ASP.Net.

--
Jonathan Allen
"William" <da@northernit.net> wrote in message
news:B_**************@twister.nyroc.rr.com...
Does anyone know what is causing the error below. The following scipt
runs
in .asp but not .aspx??? Please help.

Description: An error occurred during the compilation of a resource
required
to service this request. Please review the following specific error
details
and modify your source code appropriately.

Compiler Error Message: BC30081: 'If' must end with a matching 'End If'.

<%
'Set Session ID for each visitor to the site.
if Request.Cookies("SID") = "" then
if Session("SID") = "" then
Function CreateGUID()
Dim oTypeLib, sGUID
set oTypeLib = Server.CreateObject("Scriptlet.Typelib")
sGUID = oTypeLib.GUID
sGUID = LCase(sGUID)
sGUID = Mid(sGUID, 1, Len(sGUID) - 2)
Set oTypeLib = Nothing
CreateGUID = sGUID
End Function
Response.Cookies("SID")=CreateGUID
Response.Cookies("SID").Expires = Date + 365
Session("SID") = CreateGUID
end if
end if
if Request.Cookies("SID") <> "" then
if Session("SID") = "" then
Session("SID") = Request.Cookies("SID")
end if
end if
if Session("SID") <> "" then
if Request.Cookies("SID") = "" then
Response.Cookies("SID") = Session("SID")
Response.Cookies("SID").Expires = Date + 365
end if
end if
'Set Tracking Variables for each visitor to the site.
if LEN(session("id")) < 1 then
if LEN(Request.QueryString("id")) <> 0 then
if LEN(Request.Cookies("id")) < 1 then
Session("id") = Request.QueryString("id")
Response.Cookies("id")=Request.QueryString("id")
Response.Cookies("id").Expires = Date + 365
Session("keywords") = Request.QueryString("keywords")
Response.Cookies("keywords")=Request.QueryString(" keywords")
Response.Cookies("keywords").Expires = Date + 365
Session("campaignno") = Request.QueryString("campaignno")
Response.Cookies("campaignno")=Request.QueryString ("campaignno")
Response.Cookies("campaignno").Expires = Date + 365
Session("adgroup") = Request.QueryString("adgroup")
Response.Cookies("adgroup")=Request.QueryString("a dgroup")
Response.Cookies("adgroup").Expires = Date + 365
end if
end if
end if
if LEN(Request.Cookies("id")) <> 0 then
Session("id") = Request.Cookies("id")
Session("keywords") = Request.Cookies("keywords")
Session("campaignno") = Request.Cookies("campaignno")
Session("adgroup") = Request.Cookies("adgroup")
end if
'Set session Referring URL, IP, Broswer Type so that it can be captured
with
order.
if LEN(Session("referer")) < 1 then
Session("referer") = Request.ServerVariables("HTTP_REFERER")
Session("scriptname") = Request.ServerVariables("SCRIPT_NAME")
Session("useragent") = Request.ServerVariables("HTTP_USER_AGENT")
Session("remotehost") = Request.ServerVariables("REMOTE_HOST")
end if
%>

Nov 21 '05 #2
William,

When this runs in ASP, than it is in my opinion a bug that you are using.
This is in not in anyway right coding.

Just my thought,

Cor
Nov 21 '05 #3
I don't see the bug. Suggestion: try removing each of the IF blocks until
the code compiles correctly. The last one you removed is the offending one.
Then add it back in and remove the contents, leaving only the conditionals.
If it compiles, then the problem is in the body.

One thing to look for: are you using a double-quote from ASCII and a
double-quote from another character set?

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"William" <da@northernit.net> wrote in message
news:B_**************@twister.nyroc.rr.com...
Does anyone know what is causing the error below. The following scipt
runs
in .asp but not .aspx??? Please help.

Description: An error occurred during the compilation of a resource
required
to service this request. Please review the following specific error
details
and modify your source code appropriately.

Compiler Error Message: BC30081: 'If' must end with a matching 'End If'.

<%
'Set Session ID for each visitor to the site.
if Request.Cookies("SID") = "" then
if Session("SID") = "" then
Function CreateGUID()
Dim oTypeLib, sGUID
set oTypeLib = Server.CreateObject("Scriptlet.Typelib")
sGUID = oTypeLib.GUID
sGUID = LCase(sGUID)
sGUID = Mid(sGUID, 1, Len(sGUID) - 2)
Set oTypeLib = Nothing
CreateGUID = sGUID
End Function
Response.Cookies("SID")=CreateGUID
Response.Cookies("SID").Expires = Date + 365
Session("SID") = CreateGUID
end if
end if
if Request.Cookies("SID") <> "" then
if Session("SID") = "" then
Session("SID") = Request.Cookies("SID")
end if
end if
if Session("SID") <> "" then
if Request.Cookies("SID") = "" then
Response.Cookies("SID") = Session("SID")
Response.Cookies("SID").Expires = Date + 365
end if
end if
'Set Tracking Variables for each visitor to the site.
if LEN(session("id")) < 1 then
if LEN(Request.QueryString("id")) <> 0 then
if LEN(Request.Cookies("id")) < 1 then
Session("id") = Request.QueryString("id")
Response.Cookies("id")=Request.QueryString("id")
Response.Cookies("id").Expires = Date + 365
Session("keywords") = Request.QueryString("keywords")
Response.Cookies("keywords")=Request.QueryString(" keywords")
Response.Cookies("keywords").Expires = Date + 365
Session("campaignno") = Request.QueryString("campaignno")
Response.Cookies("campaignno")=Request.QueryString ("campaignno")
Response.Cookies("campaignno").Expires = Date + 365
Session("adgroup") = Request.QueryString("adgroup")
Response.Cookies("adgroup")=Request.QueryString("a dgroup")
Response.Cookies("adgroup").Expires = Date + 365
end if
end if
end if
if LEN(Request.Cookies("id")) <> 0 then
Session("id") = Request.Cookies("id")
Session("keywords") = Request.Cookies("keywords")
Session("campaignno") = Request.Cookies("campaignno")
Session("adgroup") = Request.Cookies("adgroup")
end if
'Set session Referring URL, IP, Broswer Type so that it can be captured
with
order.
if LEN(Session("referer")) < 1 then
Session("referer") = Request.ServerVariables("HTTP_REFERER")
Session("scriptname") = Request.ServerVariables("SCRIPT_NAME")
Session("useragent") = Request.ServerVariables("HTTP_USER_AGENT")
Session("remotehost") = Request.ServerVariables("REMOTE_HOST")
end if
%>

Nov 21 '05 #4
I would suspect that the inbedded function is confusing the compiler - try
removing it and see it compiles. If so, then engineer the function external
to the main global code (as suggested previously).

Regards
Simon
"William" <da@northernit.net> wrote in message
news:B_**************@twister.nyroc.rr.com...
Does anyone know what is causing the error below. The following scipt
runs
in .asp but not .aspx??? Please help.

Description: An error occurred during the compilation of a resource
required
to service this request. Please review the following specific error
details
and modify your source code appropriately.

Compiler Error Message: BC30081: 'If' must end with a matching 'End If'.

<%
'Set Session ID for each visitor to the site.
if Request.Cookies("SID") = "" then
if Session("SID") = "" then
Function CreateGUID()
Dim oTypeLib, sGUID
set oTypeLib = Server.CreateObject("Scriptlet.Typelib")
sGUID = oTypeLib.GUID
sGUID = LCase(sGUID)
sGUID = Mid(sGUID, 1, Len(sGUID) - 2)
Set oTypeLib = Nothing
CreateGUID = sGUID
End Function
Response.Cookies("SID")=CreateGUID
Response.Cookies("SID").Expires = Date + 365
Session("SID") = CreateGUID
end if
end if
if Request.Cookies("SID") <> "" then
if Session("SID") = "" then
Session("SID") = Request.Cookies("SID")
end if
end if
if Session("SID") <> "" then
if Request.Cookies("SID") = "" then
Response.Cookies("SID") = Session("SID")
Response.Cookies("SID").Expires = Date + 365
end if
end if
'Set Tracking Variables for each visitor to the site.
if LEN(session("id")) < 1 then
if LEN(Request.QueryString("id")) <> 0 then
if LEN(Request.Cookies("id")) < 1 then
Session("id") = Request.QueryString("id")
Response.Cookies("id")=Request.QueryString("id")
Response.Cookies("id").Expires = Date + 365
Session("keywords") = Request.QueryString("keywords")
Response.Cookies("keywords")=Request.QueryString(" keywords")
Response.Cookies("keywords").Expires = Date + 365
Session("campaignno") = Request.QueryString("campaignno")
Response.Cookies("campaignno")=Request.QueryString ("campaignno")
Response.Cookies("campaignno").Expires = Date + 365
Session("adgroup") = Request.QueryString("adgroup")
Response.Cookies("adgroup")=Request.QueryString("a dgroup")
Response.Cookies("adgroup").Expires = Date + 365
end if
end if
end if
if LEN(Request.Cookies("id")) <> 0 then
Session("id") = Request.Cookies("id")
Session("keywords") = Request.Cookies("keywords")
Session("campaignno") = Request.Cookies("campaignno")
Session("adgroup") = Request.Cookies("adgroup")
end if
'Set session Referring URL, IP, Broswer Type so that it can be captured
with
order.
if LEN(Session("referer")) < 1 then
Session("referer") = Request.ServerVariables("HTTP_REFERER")
Session("scriptname") = Request.ServerVariables("SCRIPT_NAME")
Session("useragent") = Request.ServerVariables("HTTP_USER_AGENT")
Session("remotehost") = Request.ServerVariables("REMOTE_HOST")
end if
%>

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: gsv2com | last post by:
One of my weaknesses has always been pattern matching. Something I definitely need to study up on and maybe you guys can give me a pointer here. I'm looking to remove all of this code and just...
176
by: Thomas Reichelt | last post by:
Moin, short question: is there any language combining the syntax, flexibility and great programming experience of Python with static typing? Is there a project to add static typing to Python? ...
17
by: Andrew McLean | last post by:
I have a problem that is suspect isn't unusual and I'm looking to see if there is any code available to help. I've Googled without success. Basically, I have two databases containing lists of...
1
by: Henry | last post by:
I have a table that stores a list of zip codes using a varchar column type, and I need to perform some string prefix pattern matching search. Let's say that I have the columns: 94000-1235 94001...
10
by: bpontius | last post by:
The GES Algorithm A Surprisingly Simple Algorithm for Parallel Pattern Matching "Partially because the best algorithms presented in the literature are difficult to understand and to implement,...
5
by: olaufr | last post by:
Hi, I'd need to perform simple pattern matching within a string using a list of possible patterns. For example, I want to know if the substring starting at position n matches any of the string I...
1
by: solarin | last post by:
Hi, I've developed a program under VS 6.0. I can compile it and run it, but when I try to debbug , all my breakpoints are dissabled and I can see the following messages: Loaded...
2
by: santhoshs | last post by:
Hello I am required to parse two files that contain email addresses and figure out a way to get the matching and non-matching email addresses from both the files. I was able to get the matching...
11
by: tech | last post by:
Hi, I need a function to specify a match pattern including using wildcard characters as below to find chars in a std::string. The match pattern can contain the wildcard characters "*" and "?",...
1
by: sora | last post by:
Hi, I've developed a MFC program under VS 6.0. My debugger *was* working fine and I've used it often for my project. Then, one day, the errors below appear and they prevent me from using the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.