Forums
This topic is locked
dsnless connection to ACCESS DB
Posted 02 May 2006 23:43:05
1
has voted
02 May 2006 23:43:05 Scott Ripkin posted:
I keep running into the following problem.The host company is not much help either.
The host server doesn't allow dsn connections so I am trying to set up a dsnless connection. I can get it to work everywhere but the host server. I included the error and some of the code. Any help would be appreciated.
I ran a Response.Write Server.MapPath(planmore.mdb) and it returned a value so I know the database is there.
-----Error Message--------
ADODB.Recordset.1 error '800a0bb9'
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.
/index2.asp, line 16
---------------------------
------Code for Include (planmore2.asp) File-----------
// FileName="Connection_ado_conn_string.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="false"
// Catalog=""
// Schema=""
var MM_planmore_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" + Server.MapPath("planmore.mdb"
--------------------------------------------------
-------Code for Index2.asp File (Login Page)-----------ASP/Javascript
include file="planmore2.asp"
// *** Validate request to log in to this site.
var MM_LoginAction = Request.ServerVariables("URL"
if (Request.QueryString!="" MM_LoginAction += "?" + Server.HTMLEncode(Request.QueryString);
var MM_valUsername=String(Request.Form("admin_username");
if (MM_valUsername != "undefined" {
var MM_fldUserAuthorization="";
var MM_redirectLoginSuccess="Search.asp";
var MM_redirectLoginFailed="Index.asp";
var MM_flag="ADODB.Recordset";
var MM_rsUser = Server.CreateObject(MM_flag);
MM_rsUser.ActiveConnection = MM_planmore_STRING;
MM_rsUser.Source = "SELECT admin_username, admin_password";
if (MM_fldUserAuthorization != "" MM_rsUser.Source += "," + MM_fldUserAuthorization;
MM_rsUser.Source += " FROM tbl_admin WHERE admin_username='" + MM_valUsername.replace(/'/g, "''" + "' AND admin_password='" + String(Request.Form("admin_password").replace(/'/g, "''" + "'";
MM_rsUser.CursorType = 1;
MM_rsUser.CursorLocation = 2;
MM_rsUser.LockType = 3;
MM_rsUser.Open();
if (!MM_rsUser.EOF || !MM_rsUser.BOF) {
// username and password match - this is a valid user
Session("MM_Username" = MM_valUsername;
if (MM_fldUserAuthorization != "" {
Session("MM_UserAuthorization" = String(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value);
} else {
Session("MM_UserAuthorization" = "";
}
if (String(Request.QueryString("accessdenied") != "undefined" && false) {
MM_redirectLoginSuccess = Request.QueryString("accessdenied"
}
MM_rsUser.Close();
Response.Redirect(MM_redirectLoginSuccess);
}
MM_rsUser.Close();
Response.Redirect(MM_redirectLoginFailed);
}