mkusza
-
Total Posts
:
2
- Scores: 0
-
Reward points
:
0
- Joined: 4/27/2009
-
Status: offline
|
Unterminated String Constant
Monday, April 27, 2009 2:30 AM
( permalink)
I am getting an "Unterminated String Constant" during my login redirect script. I have tried several different combinations and usually receive a syntax error when i do that. It is saying this error is occuring Microsoft VBScript compilation error '800a0409' Unterminated string constant /jblproduction/loginauth2BU.asp, line 30 MM_redirectLoginSuccess = "<%=(RS_Login.Fields.Item(Link).Value) -----------------------------------------------------------------------------------^ Here is my code, if you have any ideas what I am missing I would appreciate the help.
1 <%@LANGUAGE="VBSCRIPT"%>
2 <!--#include virtual="/DCG/Connections/catalog.asp" -->
3 <%
4 Dim RS_Login
5 Dim RS_Login_cmd
6 Dim RS_Login_numRows
7
8 Set RS_Login_cmd = Server.CreateObject ("ADODB.Command")
9 RS_Login_cmd.ActiveConnection = MM_catalog_STRING
10 RS_Login_cmd.CommandText = "SELECT Link FROM login"
11 RS_Login_cmd.Prepared = true
12
13 Set RS_Login = RS_Login_cmd.Execute
14 RS_Login_numRows = 0
15 %>
16 <%
17 ' *** Validate request to log in to this site.
18 MM_LoginAction = Request.ServerVariables("URL")
19 If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
20 MM_valUsername = CStr(Request.Form("userId"))
21 If MM_valUsername <> "" Then
22 Dim MM_fldUserAuthorization
23 Dim MM_redirectLoginSuccess
24 Dim MM_redirectLoginFailed
25 Dim MM_loginSQL
26 Dim MM_rsUser
27 Dim MM_rsUser_cmd
28
29 MM_fldUserAuthorization = "Access"
30 MM_redirectLoginSuccess = "<%=(RS_Login.Fields.Item(Link).Value)%>"
31
32 MM_redirectLoginFailed = "jblcontact.html"
33 MM_loginSQL = "SELECT UserID, Password"
34 If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
35 MM_loginSQL = MM_loginSQL & " FROM login WHERE UserID = ? AND Password = ?"
36 Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
37 MM_rsUser_cmd.ActiveConnection = MM_catalog_STRING
38 MM_rsUser_cmd.CommandText = MM_loginSQL
39 MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 50, MM_valUsername) ' adVarChar
40 MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 50, Request.Form("Password")) ' adVarChar
41 MM_rsUser_cmd.Prepared = true
42 Set MM_rsUser = MM_rsUser_cmd.Execute
43 If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
44 ' username and password match - this is a valid user
45 Session("MM_Username") = MM_valUsername
46 If (MM_fldUserAuthorization <> "") Then
47 Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
48 Else
49 Session("MM_UserAuthorization") = ""
50 End If
51 if CStr(Request.QueryString("accessdenied")) <> "" And false Then
52 MM_redirectLoginSuccess = Request.QueryString("accessdenied")
53 End If
54 MM_rsUser.Close
55 Response.Redirect(MM_redirectLoginSuccess)
56 End If
57 MM_rsUser.Close
58 Response.Redirect(MM_redirectLoginFailed)
59 End If
60 %>
|
|
|
|
mkusza
-
Total Posts
:
2
- Scores: 0
-
Reward points
:
0
- Joined: 4/27/2009
-
Status: offline
|
RE: Unterminated String Constant
Tuesday, April 28, 2009 4:31 AM
( permalink)
Solved my issue...here is the new code.
<%@LANGUAGE="VBSCRIPT"%>
<!--#include virtual="/DCG/Connections/catalog.asp" -->
<%
MM_valUsername = CStr(Request.Form("userId"))
Dim RS_Login
Dim RS_Login_cmd
Dim RS_Login_numRows
If MM_valUsername <> "" Then
Set RS_Login_cmd = Server.CreateObject ("ADODB.Command")
RS_Login_cmd.ActiveConnection = MM_catalog_STRING
RS_Login_cmd.CommandText = "SELECT [Access], [Link] FROM login WHERE [UserID] = ?"
RS_Login_cmd.Parameters.Append RS_Login_cmd.CreateParameter("param3", 200, 1, 50, MM_valUsername) ' adVarChar
RS_Login_cmd.Prepared = true
Set RS_Login = RS_Login_cmd.Execute
RS_Login_numRows = 0
Do While Not RS_Login.EOF
'Get the link for this username
MM_redirectLoginSuccess = RS_Login("Link")
RS_Login.MoveNext
Loop
Set RS_Login = Nothing
End If
%>
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
If MM_valUsername <> "" Then
Dim MM_fldUserAuthorization
Dim MM_redirectLoginSuccess
Dim MM_redirectLoginFailed
Dim MM_loginSQL
Dim MM_rsUser
Dim MM_rsUser_cmd
MM_fldUserAuthorization = "Access"
MM_redirectLoginFailed = "jblcontact.html"
MM_loginSQL = "SELECT UserID, Password"
If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
MM_loginSQL = MM_loginSQL & " FROM login WHERE UserID = ? AND Password = ?"
Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
MM_rsUser_cmd.ActiveConnection = MM_catalog_STRING
MM_rsUser_cmd.CommandText = MM_loginSQL
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 50, MM_valUsername) ' adVarChar
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 50, Request.Form("Password")) ' adVarChar
MM_rsUser_cmd.Prepared = true
Set MM_rsUser = MM_rsUser_cmd.Execute
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
|
|
|
|