Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Can anyone see whats wrong with this
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Can anyone see whats wrong with this

 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: Can anyone see whats wrong with this
    Posted: 05 February 2004 at 9:13am

<%

Dim Conn, dbPath
dbPath = Server.MapPath("/htdocs/data/pricepannel.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 OceanClub"


UserRecordset.Open sqlstring, conn

While NOT UserRecordset.EOF
objthur1 = UserRecordset("thursday1")
objsun1 = UserRecordset("Sunday1")
obj4n = UserRecordset("4nts")
obj7n = UserRecordset("7nts")
obj10n = UserRecordset("10nts")
obj11n = UserRecordset("11nts")
obj14n = UserRecordset("14nts")

wend
UserRecordset.Close : Set UserRecordset=nothing
conn.close : Set conn=nothing
%>

 

its been awhile since ive been programming in asp, do i ned to set up a odbc connection? or is this a DNS LESS connection? i forgot -opps!

 

If anything takes long to do its worth doing.
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2004 at 9:34am

what is actually the problem? do you get an error?

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: 05 February 2004 at 9:35am
it does not display any of the items that are in the database
If anything takes long to do its worth doing.
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2004 at 9:42am

oh.. you havnt sent an output command to the server..

use response.write like this:

Response.Write(UserRecordset("thursday1"))
Response.Write(UserRecordset("Sunday1"))

instead of this

objthur1 = UserRecordset("thursday1")
objsun1 = UserRecordset("Sunday1")

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: 05 February 2004 at 10:02am

Hi, oppps i have actually done it i just did not want to paste all of that code but here it is

 

<html>
<title>Ocean Club Price List</title>

<head>
<LINK href="/data/active.css" rel=stylesheet>

 

 


</head>

<body>
<table cellpadding=0 cellspacing=0 bgcolor="#D6E4FC" width="500">
<tr><td bgcolor="#000099"><img src="ocean_title.gif"></td></tr>
</table>

<TABLE border=0 height="250" WIDTH="500"  CELLPADDING=3 CELLSPACING=0 bgcolor="#D6E4FC" class="main_font">

<tr><td><b>Thursday Departures<br>(7, 10 or 14nts)</b></td>
<td><b>Sunday Departures<br>(7, 11 or 14nts)</b></td>
<td><b>4nts</b></td>
<td><b>7nts</b></td>
<td><b>10nts</b></td>
<td><b>11nts</b></td>
<td><b>14nts</b></td></tr>
<tr height='2'bgcolor="#000066"><td ></td><td ></td><td ></td><td </td><td></td><td></td><td& gt;</td></tr>

<%

 

 

Dim Conn, dbPath
dbPath = Server.MapPath("/htdocs/data/pricepannel.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 OceanClub"


UserRecordset.Open sqlstring, conn

While NOT UserRecordset.EOF
objthur1 = UserRecordset("thursday1")
objsun1 = UserRecordset("Sunday1")
obj4n = UserRecordset("4nts")
obj7n = UserRecordset("7nts")
obj10n = UserRecordset("10nts")
obj11n = UserRecordset("11nts")
obj14n = UserRecordset("14nts")


 Response.Write "<tr><td>" & objthur1 & "</td><td>" & objsun1 & "</td><td>" & obj4n & "</td><td>" & obj7n & "</td><td>" & obj10n & "</td><td>" & obj11n & "</td><td>" & obj14n & "</td></tr>"
Response.Write "<tr height='2'bgcolor='#000066'><td ></td><td ></td><td ></td><td </td><td></td><td></td><td& gt;</td></tr>"
    UserRecordset.MoveNext
wend
UserRecordset.Close : Set UserRecordset=nothing
conn.close : Set conn=nothing
%>


</TABLE>
<p>
<table>
<tr><td class="main_font">
Prices are per person and include flights, all taxes, transfers, accommodation and daily breakfast. Based on two perople sharing a twin room.
<br>Supplement for single room £7 per night.
</td></tr>
</table>
</body>
</html>

If anything takes long to do its worth doing.
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 06 February 2004 at 8:37am
don't know if it'll make a difference, but make sure you always declare your object variables before you initialize them... (i.e. the recordset variable)
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: 06 February 2004 at 10:05am

Well the code actually has worked before, we have moved to a new host

i cant remember if i set up a ODBC connection, does the above need that, or is it just a DNS less connection <-- i think

-

David

If anything takes long to do its worth doing.
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.