Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Help with code
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Help with code

 Post Reply Post Reply Page  12>
Author
Tegwin View Drop Down
Senior Member
Senior Member


Joined: 03 September 2003
Location: United Kingdom
Status: Offline
Points: 430
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tegwin Quote  Post ReplyReply Direct Link To This Post Topic: Help with code
    Posted: 05 November 2003 at 12:50am
In my quest to try and learn ASP, I have been trying out some of the examples on WWF for the connecting to an access database part1(Guestbook) tutorial ":-



I have been playing with one of the scripts, trying to display the data in a table, with Headings and then the data in the releavant column underneath it, this is how I want it to be  displayed, but when I try to do ir I get an error, see below :



Name Comments
Tegwin Cool
Nodbody Wicked
Someone else
Nice


Error Type:
Microsoft VBScript compilation (0x800A03EE)
Expected ')'
/gb/guestbook1.asp, line 37, column 41
Response.Write ("<TABLE BORDER=1 WIDTH=\"75%\" CELLSPACING=2 CELLPADDING=2 ALIGN=CENTER>")
--------------------------------------

This is a snippet of the code as to  how I am doing it :



'Loop through the recordset
Do While not rsGuestbook.EOF
   
     'Write the HTML to display the current record in the recordset
 

Response.Write ("<TABLE BORDER=1 WIDTH=\"75%\" CELLSPACING=2 CELLPADDING=2 ALIGN=CENTER>")
Response.Write ("<TR ALIGN=CENTER VALIGN=TOP>")
Response.Write ("<TD ALIGN=CENTER VALIGN=TOP><B>Name</B></TD>")
Response.Write ("<TD ALIGN=CENTER VALIGN=TOP><B>Comments</B></TD>")
Response.Write ("</TR>\n")


 Response.Write ("<TR ALIGN=LEFT VALIGN=TOP>");
 Response.Write("<TD ALIGN=LEFT VALIGN=TOP>rsGuestbook("Name")</TD>");
 Response.Write ("<TD ALIGN=LEFT VALIGN=TOP>rsGuestbook("Comments")</TD>");
 Response.Write ("</TR>");

     'Move to the next record in the recordset
     rsGuestbook.MoveNext

Loop   


 
Any help would be much appreciated.!!!


If you dont want my peaches, dont shake my tree
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 November 2003 at 4:39am

Try this:

'Loop through the recordset
Do While not rsGuestbook.EOF
   
     'Write the HTML to display the current record in the recordset
 

Response.Write ("<TABLE BORDER=1 WIDTH="""75%""" CELLSPACING=2 CELLPADDING=2 ALIGN=CENTER>")
Response.Write ("<TR ALIGN=CENTER VALIGN=TOP>")
Response.Write ("<TD ALIGN=CENTER VALIGN=TOP><B>Name</B></TD>")
Response.Write ("<TD ALIGN=CENTER VALIGN=TOP><B>Comments</B></TD>")
Response.Write ("</TR>\n")


 Response.Write ("<TR ALIGN=LEFT VALIGN=TOP>");
 Response.Write("<TD ALIGN=LEFT VALIGN=TOP>rsGuestbook("Name")</TD>");
 Response.Write ("<TD ALIGN=LEFT VALIGN=TOP>rsGuestbook("Comments")</TD>");
 Response.Write ("</TR>");

     'Move to the next record in the recordset
     rsGuestbook.MoveNext

Loop



the reason why you got that error is that u were using " then the script expects a ) and it fails.. u have to use """

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 November 2003 at 4:44am
or is that wrong??
Back to Top
Tegwin View Drop Down
Senior Member
Senior Member


Joined: 03 September 2003
Location: United Kingdom
Status: Offline
Points: 430
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tegwin Quote  Post ReplyReply Direct Link To This Post Posted: 05 November 2003 at 6:18am
Anthrax thanks for that, it has not helped however.. I am still getting the same error message

Error Type:
Microsoft VBScript compilation (0x800A03EE)
Expected ')'
/gb/guestbook1.asp, line 38, column 42
Response.Write ("<TABLE BORDER=1 WIDTH="""75%""" CELLSPACING=2 CELLPADDING=2 ALIGN=CENTER>")
-----------------------------------------^

Any other ideas ?


If you dont want my peaches, dont shake my tree
Back to Top
Tegwin View Drop Down
Senior Member
Senior Member


Joined: 03 September 2003
Location: United Kingdom
Status: Offline
Points: 430
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tegwin Quote  Post ReplyReply Direct Link To This Post Posted: 05 November 2003 at 6:54am
I have tried this again by removing the """" and changing it to WIDTH=75% and it has now stopped complaining about that line but is having an error on the line that calls the user info


 Response.Write ("<TR ALIGN=LEFT VALIGN=TOP>")
 Response.Write("<TD ALIGN=LEFT VALIGN=TOP>rsGuestbook("Name")</TD>")
Response.Write ("<TD ALIGN=LEFT VALIGN=TOP>rsGuestbook("Comments")</TD>")
 Response.Write ("</TR>")


The error coming up now is :-

Error Type:
Microsoft VBScript compilation (0x800A03EE)
Expected ')'
/gb/guestbook1.asp, line 46, column 55
Response.Write("<TD ALIGN=LEFT VALIGN=TOP>rsGuestbook("Name")</TD>")


Any ideas ?
If you dont want my peaches, dont shake my tree
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 05 November 2003 at 7:27am

Response.Write ("<TR ALIGN=LEFT VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP>" & rsGuestbook("Name") & "</TD>")
Response.Write ("<TD ALIGN=LEFT VALIGN=TOP> & rsGuestbook("Comments")& "</TD>")
 Response.Write ("</TR>")

Back to Top
Tegwin View Drop Down
Senior Member
Senior Member


Joined: 03 September 2003
Location: United Kingdom
Status: Offline
Points: 430
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tegwin Quote  Post ReplyReply Direct Link To This Post Posted: 05 November 2003 at 8:47am
Excellent, Thanks Micheal. that works well. I will learn the formatting of this eventually.. I was nearly right !!!


If you dont want my peaches, dont shake my tree
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 November 2003 at 9:32am
oh.. sh*t.. but are your table 75% of window now? it was wrong with """.. it should be "".. ""75%"" that should work.. sorry for the mistake..
Back to Top
 Post Reply Post Reply Page  12>

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.