Print Page | Close Window

Connection Error

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=1119
Printed Date: 29 March 2026 at 7:08am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Connection Error
Posted By: ziwez0
Subject: Connection Error
Date Posted: 18 March 2003 at 3:42pm

Im using a dsn less connection (my first time, used to using ODBC)

and im getting the following error..

Microsoft JET Database Engine error '80004005'

'C:\WINNT\system32\whathappenedwhen.co.uk\htdocs\Database\photolibary.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

/photos2.asp, line 9

Hers is the code..

 

<!--#include file="Top.asp" -->

<%


Dim Conn, dbPath
  dbPath = "whathappenedwhen.co.uk/htdocs/Database/photolibary.mdb"
  Set Conn = Server.CreateObject("ADODB.Connection")
  Conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0; DATA SOURCE=" & dbPath

Set UserRecordset = Server.CreateObject("ADODB.Recordset")
sqlstring = "select * from Photo where Catergory = 'Florida'"


UserRecordset.Open sqlstring, DatabaseConnection

Set objid = UserRecordset("ID")
set objLargeImage = UserRecordset("LargeImage")
Set objSmallImage = UserRecordSet("SmallImage")

While NOT UserRecordset.EOF

%>

<a href="">1</a><p>
<a href="">2</a><p>
<a href="">3</a><p>
<a href="">4</a>

<%
UserRecordset.MoveNext
wend
%>
<!--#include file="bottom.asp" -->

Any ideas?



-------------
If anything takes long to do its worth doing.



Replies:
Posted By: MorningZ
Date Posted: 18 March 2003 at 8:11pm
yeah, the error reporting doesn't lie.... it cannot find the database at the location you provided, which was:

dbPath = "whathappenedwhen.co.uk/htdocs/Database/photolibary.mdb"

you need to feed it the FULL path... "c:\blah blah blah"
or

dbPath = Server.MapPath("/htdocs/Database/photolibary.mdb")

-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: ziwez0
Date Posted: 19 March 2003 at 12:43pm

thanx for your help that solved the problem, but ive now got this error..

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name too long

/photos2.asp, line 16

<!--#include file="Top.asp" -->


<%


Dim Conn, dbPath
  dbPath = Server.MapPath("/Database/photolibary.mdb")
  Set Conn = Server.CreateObject("ADODB.Connection")
  Conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0; DATA SOURCE=" & dbPath

Set UserRecordset = Server.CreateObject("ADODB.Recordset")
sqlstring = "select * from Photo where Catergory = 'Florida'"


UserRecordset.Open sqlstring, dbpath

Set objid = UserRecordset("ID")
set objLargeImage = UserRecordset("LargeImage")
Set objSmallImage = UserRecordSet("SmallImage")

While NOT UserRecordset.EOF

%>

<a href="">1</a><p>
<a href="">2</a><p>
<a href="">3</a><p>
<a href="">4</a>

<%
UserRecordset.MoveNext
wend
%>
<!--#include file="bottom.asp" -->

 

any ideas?



-------------
If anything takes long to do its worth doing.


Posted By: fernan82
Date Posted: 19 March 2003 at 1:01pm

Try this:

sqlstring = "select Photo.* from Photo where Photo.Catergory = 'Florida'"



-------------
FeRnAN
http://www.danasoft.com/">


Posted By: MorningZ
Date Posted: 19 March 2003 at 2:42pm
thats not it....

you arent using the connection object

UserRecordset.Open sqlstring, Conn

-------------
Contribute to the working anarchy we fondly call the Internet



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net