Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loop through information from a database

Status
Not open for further replies.

uzzie123

Technical User
Mar 7, 2007
21
CA
Hi,

I am creating a loop that will display each server, its location and a checkbox from a table. However when creating this loop, I get an error stating "Expected End of Statement." on line 112:

Dim oConn, i

oConn.Open(ConnectionString)

sqlQuery = "SELECT serverName, serverLocation FROM tblInventoryServers WHERE serverStateType = 'Locked' OR serverStateType = 'Controlled'"
set oRs = oConn.Execute(sqlQuery)



for i = 0 To 14 Step 1

Response.write "<br />" & oRs ("serverName") & oRs ("serverLocation")
Response.write "Select This Server:"
Response.write "<input type="radio" name= "serverSelect" id = "serverName" value="serverSelect" />" //line 112
oRs.MoveNext


Next

thx
 
You need to escape your quotation marks. I believe in VBScript it's "" so, it's something like this:

Code:
        Response.write "<input type="[!]"[/!]radio[!]"[/!]" name= "[!]"[/!]serverSelect[!]"[/!]" id = "[!]"[/!]serverName[!]"[/!]" value="[!]"[/!]serverSelect[!]"[/!]" />"    //line 112

Also, not sure if it's an error or not cause I've never done this, you should not put a space between the field names in oRs (removed spaces):

Code:
Response.write "<br />" & [!]oRs("serverName")[/!]  & [!]oRs("serverLocation")[/!]


[monkey][snake] <.
 
You can try this:


While not oRs.EOF
Response.write "<br />" & oRs ("serverName") & oRs ("serverLocation")
Response.write "Select This Server:"
Response.write "<input type="radio" name= "serverSelect" id = "serverName" value="serverSelect" />"
oRs.MoveNext

Wend


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top