Wrox Programmer Forums
|
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 8th, 2004, 06:35 PM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 80004005 error


Dear friends,
I'm trying to get my database works through the hosting server, but without success.
I'm getting the following message error.

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/login.asp, line 14(on the code, line 14 is: ( MM_rsUser.ActiveConnection = MM_conn_bouk_website_STRING)

It's works perfectely on the testing server but on remote server.
The following code is the login.asp page that I'm trying to test through the remote server.
Is,any conflict between the testing server (IIS) and the remote server.
Please help!!!!!



MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("username"))
If MM_valUsername <> "" Then
  MM_fldUserAuthorization="userGroup"
  MM_redirectLoginSuccess="index.asp"
  MM_redirectLoginFailed="login_failed.asp"
  MM_flag="ADODB.Recordset"
  set MM_rsUser = Server.CreateObject(MM_flag)
  MM_rsUser.ActiveConnection = MM_conn_bouk_website_STRING
  MM_rsUser.Source = "SELECT username, pwd"
  If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
  MM_rsUser.Source = MM_rsUser.Source & " FROM tbl_users WHERE username='" & Replace(MM_valUsername,"'","''") &"' AND pwd='" & Replace(Request.Form("pwd"),"'","''") & "'"
  MM_rsUser.CursorType = 0
  MM_rsUser.CursorLocation = 2
  MM_rsUser.LockType = 3
  MM_rsUser.Open
  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 true 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
%>

 
Old January 2nd, 2005, 07:08 AM
Authorized User
 
Join Date: Oct 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have the same problem. Have you found a solution yet? Alison

 
Old January 2nd, 2005, 07:32 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Does the connection string variable (MM_conn_bouk_website_STRING in the example below) contain a valid connection string??

To find out, modify the code and add a Response.Write and Response.End statement, like this:
Code:
set MM_rsUser = Server.CreateObject(MM_flag)
  MM_rsUser.ActiveConnection = MM_conn_bouk_website_STRING
  Response.Write("Conn " & MM_conn_bouk_website_STRING & "<br />")
  Response.End
What do you get when you run this page? How does the connection string look like??

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old January 2nd, 2005, 10:14 AM
Authorized User
 
Join Date: Oct 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm getting closer. I changed my code to look like:

connectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("student.mdb")
set myconnection = Server.CreateObject("ADODB.Connection")
set rsTitleList = Server.CreateObject("ADODB.Recordset")

and now get a different error, which I posted in a separate listing.
However, wher would I pu the code you suggested? infront of the above statements?

Thanks
Alison

 
Old January 2nd, 2005, 10:17 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The first two lines of the code I posted were from your code block, so you should have added the additional two lines (Response.Write(...) and Response.End) right after the two lines.

But it seems you fixed it; apparently your connection string wasn't OK, but this one looks fine.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
ODBC Drivers error '80004005' sanju2006 Classic ASP Professional 3 August 31st, 2006 09:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.