scroots
12-06-2002, 11:02 PM
the following error is produced with my piece of code, i think it may be the connection string.
<% @LANGUAGE = VBSCRIPT %>
<% Option Explicit %>
<%
Dim uname, pword
uname = Request.Form("uname")
pword = Request.Form("pword")
Dim cmdGetUser, rsGetUser
Set cmdGetUser = Server.CreateObject.Command
cmdGetUSer.ActiveConnection = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("peeps.mdb")
cmdGetUser.CommandText = "SELECT * FROM tbl_Users WHERE tblUsers.Username = '" & uname '""
cmdGetUser.CommandType = adCmdText
Set rsGetUser = cmdGetUser.Execute
Set cmdGetUser = Nothing
While Not rsGetUser.EOF
If UCase(uname) = Ucase(rsGetUser("username")) Then
If UCase(pword) = Ucase(rsGetUser("password")) Then
Session("UserID") = rsGetUser("UserID")
Response.Redirect "success.asp"
Else
Response.Redirect "default.asp?error=password"
End If
Else
Response.Redirect "default.asp?error=username"
End If
rsGetUser.Close()
Set rsGetUser = Nothing
Wend
%>
and the error message is:
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'Server.CreateObject'
/es/login/checklogin.asp, line 9
i presume it is my connection string but i may be wrong, anyone spot any other mistakes?
cheers
scroots
<% @LANGUAGE = VBSCRIPT %>
<% Option Explicit %>
<%
Dim uname, pword
uname = Request.Form("uname")
pword = Request.Form("pword")
Dim cmdGetUser, rsGetUser
Set cmdGetUser = Server.CreateObject.Command
cmdGetUSer.ActiveConnection = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("peeps.mdb")
cmdGetUser.CommandText = "SELECT * FROM tbl_Users WHERE tblUsers.Username = '" & uname '""
cmdGetUser.CommandType = adCmdText
Set rsGetUser = cmdGetUser.Execute
Set cmdGetUser = Nothing
While Not rsGetUser.EOF
If UCase(uname) = Ucase(rsGetUser("username")) Then
If UCase(pword) = Ucase(rsGetUser("password")) Then
Session("UserID") = rsGetUser("UserID")
Response.Redirect "success.asp"
Else
Response.Redirect "default.asp?error=password"
End If
Else
Response.Redirect "default.asp?error=username"
End If
rsGetUser.Close()
Set rsGetUser = Nothing
Wend
%>
and the error message is:
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'Server.CreateObject'
/es/login/checklogin.asp, line 9
i presume it is my connection string but i may be wrong, anyone spot any other mistakes?
cheers
scroots