Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: Trouble making connection - first time user


Message #1 by jviscomi@s... on Tue, 31 Jul 2001 15:37:39
Hi All;



This is my first time in this medium so if I do something cloth-headed (like talk too much) please let me 

know.



I'm a new ASP user and have been working with VB and db's for about 18 months now.



I have the database and web page in the same location on our web-server.



I'm working from Beginning ASP Databases on page 198, trying a DNS-less connection.  I have cut and 

pasted the code so it is (I think) word for word from the text.  I get the following error message:



Microsoft OLE DB Provider for ODBC Drivers error '80004005' 



[Microsoft][ODBC Microsoft Access Driver] Not a valid file name.



I went to MSDN and found several pages that were close to my message.  A page called "INFO: 

Troubleshooting Guide for 80004005 and Other Error Messages" said that basically the message was 

saying "I couldn't get at your data for some reason."  There were several examples on this page but not 

one that said ' Not a valid file name '.  Also, in the examples, the errors (in the 2nd. line) alternate 

between "ODBC Microsoft Access Driver" and " ODBC Microsoft Access 97 Driver"  I am using office 97 

(as in the above text, pg. 197) but my error says "ODBC Microsoft Access Driver"  so could that be 

where my problem lies?  However, if I edit my code from:



strSource = "Driver={Microsoft Access Driver (*.mdb)}"

strSource = strSource& "; DBQ= http://cstl.syr.edu/staff/joe/Sailors.mdb; Uid=Admin; Pwd=;"

oConn.ConnectionString = strSource



to the following:



strSource = "Driver={Microsoft Access 97 Driver (*.mdb)}"

strSource = strSource& "; DBQ=http://cstl.syr.edu/staff/joe/Sailors.mdb; Uid=Admin; Pwd=;"

oConn.ConnectionString = strSource



I get a different error message:



Microsoft OLE DB Provider for ODBC Drivers error '80004005' 



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





What I have appears to be right to me, judging by some of the web pages I have visited.  I have written 

simple asp pages and they have worked fine, and I have tried several versions of the above using (and 

not using) uid and password.  I have also opened this database on my desktop and performed the 

above query and this produces the expected results.



I don't know if this helps (clarify) but our web person uses FrontPage exclusively (we are just getting 

into web database apps); is it possible that some of the components (MADC, drivers, etc) are not loaded 

on the server?  We use NT4 and I think the options pack was loaded.



I've looked around on the web and have found similar problems but no solutions that seem to help; I'm 

really stumped and would greatly appreciate any help or direction to help.

Thanks much.

Joe



My complete code follows below:



<%Option Explicit%>

<html>



<head>

<title>2726-06-Connection TIO #4 DSN-Less Connection</title>

</head>



<body>



<h2>Chapter 06 - Connections </h2>

<h3>Try It Out #4 DSN-Less Connection</h3>

<% 

dim oConn

dim oRS

dim strSource



set oCOnn=server.CreateObject("adodb.connection")

set ors=server.CreateObject("adodb.recordset")

strSource = "Driver={Microsoft Access Driver (*.mdb)}"

strSource = strSource& "; DBQ=http://cstl.syr.edu/staff/joe/Sailors.mdb; Uid=Admin; Pwd=;"

oConn.ConnectionString = strSource

oConn.Open 



sqltext = "Select PeopleNameFirst, PeopleNameLast, PeopleProfessionalCLass "

sqltext = sqltext & " FROM People WHERE PeopleprofessionalCLass=2;"

ors.Open sqltext, oConn

 

Response.write "<table border=1><tr><td>"

Response.Write ors.GetString(,-1,"</td><td>","</td></tr><tr><td>"," ")

Response.write "</td></tr></table>"



oRS.Close

Set oRS=nothing

oConn.close

Set oConn=nothing

%>



</BODY>

</HTML>
Message #2 by "Cole, R. MR DOIM" <8r8251@e...> on Tue, 31 Jul 2001 11:00:13 -0400
I had a similar problem.  The issue was resolved by setting the correct

permissions on the correct key in the system registry.  I believe it's in

the second section of the MSDN troubleshooting guide you found which talks

about applying a security pack from an SDK.



Rich Cole

Signal Corporation



-----Original Message-----

From: jviscomi@s... [mailto:jviscomi@s...]

Sent: Tuesday, July 31, 2001 11:38 AM

To: ASP Database Setup

Subject: [asp_database_setup] Trouble making connection - first time

user





Hi All;



This is my first time in this medium so if I do something cloth-headed (like

talk too much) please let me 

know.



I'm a new ASP user and have been working with VB and db's for about 18

months now.



I have the database and web page in the same location on our web-server.



I'm working from Beginning ASP Databases on page 198, trying a DNS-less

connection.  I have cut and 

pasted the code so it is (I think) word for word from the text.  I get the

following error message:



Microsoft OLE DB Provider for ODBC Drivers error '80004005' 



[Microsoft][ODBC Microsoft Access Driver] Not a valid file name.



I went to MSDN and found several pages that were close to my message.  A

page called "INFO: 

Troubleshooting Guide for 80004005 and Other Error Messages" said that

basically the message was 

saying "I couldn't get at your data for some reason."  There were several

examples on this page but not 

one that said ' Not a valid file name '.  Also, in the examples, the errors

(in the 2nd. line) alternate 

between "ODBC Microsoft Access Driver" and " ODBC Microsoft Access 97

Driver"  I am using office 97 

(as in the above text, pg. 197) but my error says "ODBC Microsoft Access

Driver"  so could that be 

where my problem lies?  However, if I edit my code from:



strSource = "Driver={Microsoft Access Driver (*.mdb)}"

strSource = strSource& "; DBQ= http://cstl.syr.edu/staff/joe/Sailors.mdb;

Uid=Admin; Pwd=;"

oConn.ConnectionString = strSource



to the following:



strSource = "Driver={Microsoft Access 97 Driver (*.mdb)}"

strSource = strSource& "; DBQ=http://cstl.syr.edu/staff/joe/Sailors.mdb;

Uid=Admin; Pwd=;"

oConn.ConnectionString = strSource



I get a different error message:



Microsoft OLE DB Provider for ODBC Drivers error '80004005' 



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

driver specified





What I have appears to be right to me, judging by some of the web pages I

have visited.  I have written 

simple asp pages and they have worked fine, and I have tried several

versions of the above using (and 

not using) uid and password.  I have also opened this database on my desktop

and performed the 

above query and this produces the expected results.



I don't know if this helps (clarify) but our web person uses FrontPage

exclusively (we are just getting 

into web database apps); is it possible that some of the components (MADC,

drivers, etc) are not loaded 

on the server?  We use NT4 and I think the options pack was loaded.



I've looked around on the web and have found similar problems but no

solutions that seem to help; I'm 

really stumped and would greatly appreciate any help or direction to help.

Thanks much.

Joe



My complete code follows below:



<%Option Explicit%>

<html>



<head>

<title>2726-06-Connection TIO #4 DSN-Less Connection</title>

</head>



<body>



<h2>Chapter 06 - Connections </h2>

<h3>Try It Out #4 DSN-Less Connection</h3>

<% 

dim oConn

dim oRS

dim strSource



set oCOnn=server.CreateObject("adodb.connection")

set ors=server.CreateObject("adodb.recordset")

strSource = "Driver={Microsoft Access Driver (*.mdb)}"

strSource = strSource& "; DBQ=http://cstl.syr.edu/staff/joe/Sailors.mdb;

Uid=Admin; Pwd=;"

oConn.ConnectionString = strSource

oConn.Open 



sqltext = "Select PeopleNameFirst, PeopleNameLast, PeopleProfessionalCLass "

sqltext = sqltext & " FROM People WHERE PeopleprofessionalCLass=2;"

ors.Open sqltext, oConn

 

Response.write "<table border=1><tr><td>"

Response.Write ors.GetString(,-1,"</td><td>","</td></tr><tr><td>"," ")

Response.write "</td></tr></table>"



oRS.Close

Set oRS=nothing

oConn.close

Set oConn=nothing

%>



</BODY>

</HTML>

  Return to Index