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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Database forms question

Status
Not open for further replies.

SmileeTiger

Programmer
Mar 13, 2000
200
US
Hi I have a ASP form created that accesses a database and displays an item from it based upon checkboxes below is the code I have used and the database:<br><br>Database:<br>Name &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Number<br>Mac &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2<br>Windows_95-98 3<br>Windows_NT 5<br><br>Form code:<br><br><br>&lt;form action=&quot;CompleteSurvey.asp&quot; method=&quot;POST&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&quot;CHECKBOX&quot; name=&quot;Platforms&quot; value=&quot;Mac&quot;&gt;MacOS&lt;br&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&quot;CHECKBOX&quot; name=&quot;Platforms&quot; value=&quot;Windows_95-98&quot;&gt;Windows 95/98&lt;br&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&quot;CHECKBOX&quot; name=&quot;Platforms&quot; value=&quot;Windows_NT&quot;&gt;Windows NT&lt;br&gt;<br>bla bla bla<br><br>ASP Code<br>&lt;%<br>Platforms=request.form(&quot;Platforms&quot;)<br>DIM splitIT<br>DIM k<br>DIM i<br>splitIT = SPLIT( Platforms, &quot;,&quot; )<br>FOR k = 0 TO UBOUND( splitIT )<br>set conn=server.createobject(&quot;ADODB.connection&quot;)<br>set objRS = server.createobject(&quot;ADODB.recordset&quot;)<br>conn.open &quot;DSN=SN_Reg_System&quot;<br>SQLstmt = &quot;select Number from Survey where (Name = '&quot; & splitIT(k) & &quot;')&quot;<br>Set objRS = conn.execute(SQLstmt)<br>if (objRS.BOF and objRS.EOF) then<br>response.write (splitIT(k))<br>response.write(&quot;: &quot;)<br>response.write (&quot;An error has occured. &quot;)<br>response.end<br>End if<br>response.write(splitIT(k))<br>response.write(&quot;: &quot;)<br>Response.Write(objRS.Fields(0))<br>response.write(&quot;&lt;br&gt;&quot;)<br>conn.close<br>NEXT<br>%&gt;<br><br>I have checked all 3 checkboxes but it only displays the number for Mac (or whatever the first box that is checked off is.) I think I need to reset where ojbRS is in the database but I am not sure.<br><br><br><br>Thanks<br>Cory<br><br>
 
Ahh I have it I should use:<br>splitIT = SPLIT(Platforms, &quot;, &quot;)<br><br>not:<br>splitIT = SPLIT(Platforms, &quot;,&quot;)<br><br>&nbsp;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top