PDA

View Full Version : Unable to load asp with server behaviour


master_m
12-08-2008, 01:29 AM
I got this problem. When I try to preview the asp vb site in IE with server behaviour (Log in), it fails to load. When I remove the behaviour, it works. What is the problem? I am using dreamweaver cs3, IIS 5.1 / xampp, ms sql 2005. Thanks for any sugguestion.

this is the error i got

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services
Error Type:
ADODB.Command (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/ims/default.asp, line 24

mangofreak
12-08-2008, 02:47 AM
Check if you have a typo or if you are using wrong values numeric instead of text or vice versa.

Post more code, I'll have a look perhaps I can help.

Javier

master_m
12-08-2008, 10:38 PM
The code is



<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/inventory.asp" -->
<%
' *** 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)
MM_valUsername = CStr(Request.Form("frmusername"))
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 = ""
MM_redirectLoginSuccess = "loginsuccess.htm"
MM_redirectLoginFailed = "loginfailed.htm"

MM_loginSQL = "SELECT tbl_username, tbl_password"
If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
MM_loginSQL = MM_loginSQL & " FROM dbo.tbl_admin WHERE tbl_username = ? AND tbl_password = ?"
Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
MM_rsUser_cmd.ActiveConnection = MM_inventory_STRING
MM_rsUser_cmd.CommandText = MM_loginSQL
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 10, MM_valUsername) ' adVarChar
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 10, Request.Form("frmpassword")) ' 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
I use DW connection so the database is set up by under database connection.