Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Connection Error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Connection Error

 Post Reply Post Reply
Author
ziwez0 View Drop Down
Groupie
Groupie


Joined: 15 July 2002
Location: United Kingdom
Status: Offline
Points: 144
Post Options Post Options   Thanks (0) Thanks(0)   Quote ziwez0 Quote  Post ReplyReply Direct Link To This Post Topic: Connection Error
    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?



Edited by ziwez0
If anything takes long to do its worth doing.
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ziwez0 View Drop Down
Groupie
Groupie


Joined: 15 July 2002
Location: United Kingdom
Status: Offline
Points: 144
Post Options Post Options   Thanks (0) Thanks(0)   Quote ziwez0 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 19 March 2003 at 1:01pm

Try this:

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



Edited by fernan82
FeRnAN
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.