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!

server display:

Status
Not open for further replies.

boux123

Technical User
Mar 20, 2007
16
CA

Hi, I created a connection to a database where i retrieve a list of servers names and display them on a web page form with a checkbox beside each form. I also created another table where the form info will be stored. If a user selects a server and submits the form, the server name that I see on the form is always the first one on the list, regardless of what the user chose. Also if a user chooses more than one server, I see the first server on the list enter into the table twice.

for example: if a person selects server2(second on the list), server1 automatically gets selected and is placed in the table.

If server2 and 3 are slected, server 1 is automatically selected twice and inputted into the table.

Here is the code:

'Creating a connection to the SQL database in the ebssdev1 server.
Dim oConn, i



oConn.Open(ConnectionString)

'Need to access tblInventoryServers table to retrieve server information.
sqlQuery = "SELECT serverName, serverLocation FROM tblInventoryServers WHERE (serverStateType = 'Locked' OR serverStateType = 'Controlled') AND (serverStatus = 'Online' OR serverStatus = 'Offline')"
set oRs = oConn.Execute(sqlQuery)

tempID = Trim(oRs("serverName"))
'Created a loop that will loop through the open and locked servers in Creekside and London.
'Included a checkbox for each server.
While Not oRs.EOF

Response.write "<br /><font size='2'>Server:&nbsp;&nbsp;<b>" & oRs("serverName") & "</b>&nbsp;&nbsp;&nbsp;Server Location:&nbsp;&nbsp;<b>" & oRs("serverLocation") & "</b>"
Response.write "<br /><i>Select This Server:</i>&nbsp;&nbsp;<input type='checkbox' name='server' id='serverSelect' value=" & tempID & "/></font><br />"
oRs.MoveNext
Wend



Thx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top