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: <b>" & oRs("serverName") & "</b> Server Location: <b>" & oRs("serverLocation") & "</b>"
Response.write "<br /><i>Select This Server:</i> <input type='checkbox' name='server' id='serverSelect' value=" & tempID & "/></font><br />"
oRs.MoveNext
Wend
Thx