Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Chapter 4 Try it Out #4


Message #1 by CorsairDev@a... on Thu, 31 May 2001 20:42:51
I'm having problems with the Try It Out #4 example in Chapter 4 of 

Beginning ASP Databases.  I typed it out exactly as the book showed except 

for two difference.  First, I DIMed the sqltext variable.  Second, instead 

of using sqltext = sqltext & "insert text here"  I used the & _ 

technique.  The error I get, I can't copy it word for word since I'm at 

work now but, said that an operator or value on the otherside of the 

operator was missing in the oRStc.Open line in this 

segment: 'PeopleClubCode IN ('scow, 'dsyc') ORDER BY PeopleClubCode, 

PeopleNameLast;'



Here is the code:

<%

Dim oRStc, sqltext

Set oRStc = Server.CreateObject("ADODB.Recordset")

sqltext = "SELECT PeopleNameFirst, PeopleNameLast, PeopleClubCode " & _

			" FROM People " & _

			" WHERE PeopleClubCode IN ('scow, 'dsyc') " & _

			" ORDER BY PeopleClubCode, PeopleNameLast;"

Response.Write "<FONT COLOR=""Brown"">" & sqltext & "</FONT>"

oRStc.Open sqltext, "DSN=Sailors"

Response.Write "<TABLE BORDER=""1"">"

Do While NOT oRStc.EOF

	Response.Write "<TR><TD>" & oRStc("PeopleClubCode") & " </TD>"

	Response.Write "<TD>" & oRStc("PeopleNameFirst") & " </TD>"

	Response.Write "<TD>" & oRStc("PeopleNameLast") 

& " </TD></TR>"

	oRStc.MoveNext

Loop

Response.Write "</TABLE>"

oRStc.Close

Set oRStc = nothing

%>



Any help would be appreciated.



Steven

  Return to Index