473,395 Members | 1,631 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,395 software developers and data experts.

ASP Connection Statement Problem, Please help

3
I am very much a beginner in dealing with connection statments. I am getting the following error:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/default.asp, line 32


Here is my connection include:

<%
FileName="Connection_odbc_conn_dsn.htm"
Type="ADO"
HTTP="false"
Catalog=""
Schema=""
var MM_connCustomers_STRING = "dsn=access_customers2.dsn;"
%>

Here is my javascript page coding:

<%@LANGUAGE="JAVASCRIPT"%>

<!--#include file="Connections/connCustomers.asp" -->
<script language=vbscript runat=server>
cr = Request.Form("cbxRemember")
If (cr = "yes") Then
Response.Cookies("ckPassword") = Request.Form("txtPassword")
Response.Cookies("ckPassword").Expires = Date + 90

End If

</script>
<script language=vbscript runat=server>
cr = Request.Form("cbxRemember")
If (cr = "yes") Then
Response.Cookies("ckUserID") = Request.Form("txtusername")
Response.Cookies("ckUserID").Expires = Date + 90

End If

</script>
<%
var rsLogin = Server.CreateObject("ADODB.Recordset");
rsLogin.ActiveConnection = MM_connCustomers_STRING;
rsLogin.Source = "SELECT * FROM customers";
rsLogin.CursorType = 0;
rsLogin.CursorLocation = 2;
rsLogin.LockType = 3;
rsLogin.Open();
rsLogin_numRows = 0;
%>
<%
// *** Validate request to log in to this site.
var MM_LoginAction = Request.ServerVariables("URL");
if (Request.QueryString!="") MM_LoginAction += "?" + Request.QueryString;
var MM_valUsername=String(Request.Form("txtusername")) ;
if (MM_valUsername != "undefined") {
var MM_fldUserAuthorization="AccessGroup";
var MM_redirectLoginSuccess="LoginOK.asp";
var MM_redirectLoginFailed="Register.asp";
var MM_flag="ADODB.Recordset";
var MM_rsUser = Server.CreateObject(MM_flag);
MM_rsUser.ActiveConnection = MM_connCustomers_STRING;
MM_rsUser.Source = "SELECT ID, UserID, Password, AccessGroup, PA, ITB, PDA, UNV1, UNV2, UNV3, UNV4, UNV5, UNV6, UNV7, ICMS, CFocus, Formation";
if (MM_fldUserAuthorization != "") MM_rsUser.Source += "," + MM_fldUserAuthorization;
MM_rsUser.Source += " FROM customers WHERE UserID='" + MM_valUsername + "' AND Password='" + String(Request.Form("txtpassword")) + "'";
MM_rsUser.CursorType = 0;
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;
Session('svID') = MM_rsUser.Fields('ID').Value;
Session('svAccessGroup') = MM_rsUser.Fields('AccessGroup').Value
Session('svPA') = MM_rsUser.Fields('PA').Value;
Session('svITB') = MM_rsUser.Fields('ITB').Value;
Session('svPDA') = MM_rsUser.Fields('PDA').Value;
Session('svUNV1') = MM_rsUser.Fields('UNV1').Value;
Session('svUNV2') = MM_rsUser.Fields('UNV2').Value;
Session('svUNV3') = MM_rsUser.Fields('UNV3').Value;
Session('svUNV4') = MM_rsUser.Fields('UNV4').Value;
Session('svUNV5') = MM_rsUser.Fields('UNV5').Value;
Session('svUNV6') = MM_rsUser.Fields('UNV6').Value;
Session('svUNV7') = MM_rsUser.Fields('UNV7').Value;
Session('svICMS') = MM_rsUser.Fields('ICMS').Value;
Session('svFocus') = MM_rsUser.Fields('CFocus').Value;
Session('svFormation') = MM_rsUser.Fields('Formation').Value;
if (MM_fldUserAuthorization != "") {
Session("MM_UserAuthorization") = String(MM_rsUser.Fields.Item(MM_fldUserAuthorizati on).Value);
} else {
Session("MM_UserAuthorization") = "";
}
if (String(Request.QueryString("accessdenied")) != "undefined" && true) {
MM_redirectLoginSuccess = Request.QueryString("accessdenied");
}
MM_rsUser.Close();
Response.Redirect(MM_redirectLoginSuccess);
}
MM_rsUser.Close();
Response.Redirect(MM_redirectLoginFailed);
}
%>
<script language=vbscript runat=server>
' *** Set A Session Variable
' *** MagicBeat Server Behavior - 2006 - by Jag S. Sidhu - www.magicbeat.com

</script>

The site is bieng hosted by godaddy and a valid dsn is in place under the name:
access_customers2.dsn

Please help this is driving me nuts. It will serve to be a login and customer information update.

Thanks
Nov 1 '06 #1
0 1335

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Paul Robinson | last post by:
I am developing a website in ASP that connects to a Sybase database. However, when I try to open a connection to the database the page will not load. The script does not timeout, nor the...
17
by: AMC | last post by:
Hi, I'm using an include file to store the connection string to a database. Whenever I try to reference that string to open a connection in the page that includes the file I get the error 'empy...
0
by: JWM | last post by:
I am trying to implement Oracle connection pooling for the following code, which was written by someone else. Here is my main question -- this java file creates code that is executed every hour,...
0
by: Nilesh | last post by:
The problem i am facing is described as below: I have one client application which execute some stored procedure using SqlExecDirect and just after executing the statement if connection with...
20
by: fniles | last post by:
I am using VB.NET 2003, SQL 2000, and SqlDataReader. As I read data from tblA, I want to populate tblB. I use SQLDataReader for both tables. I do not use thread. When I ExecuteReader on tblB, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.