Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: My Logic (Loop)


Message #1 by Leo Clayton <claytonl@z...> on Mon, 18 Sep 2000 10:11:34 -0400
I am trying to:

1) Read a table from a database

2) Create a 3-column form from this reading, in which a user checks some 

checkboxes

3) Submit this form to another page that will create records, in another 

table in the same database, based upon checks in the form



My problem for now is that after printing my headings, I am going into a 

loop and timing out.



Here is the pertinent code:





<%

strSQL = "SELECT * FROM SkillsTable;"

Set DbObj = Server.CreateObject(ADODB.CONNECTION")

DbObj.Open "DSN=EmployeeMaster"

Set oRs = DbObj.Execute(strSQL)

%>



<FORM ACTION="CreateSkillsRecord.asp" METHOD="POST" id=form1 

name=SelectingSkills>

<TABLE BORDER=0>



<%

Do WHILE NOT oRs.EOF

Response.Write("<tr>")

	For i= 1 to 3

		If not oRs.EOF Then

			Response.Write(_

				"<td><input type=Checkbox name=Skill>" &_

				"<td>  " & oRs.Fields("SkillName").Value & "</td>")

		Else

			Response.Write(_

				"<td< </td>" &_

				"<td< </td>" )

		End If

	Next



	Response.Write(_

		"</tr>")

Loop

%>

</TABLE>



Message #2 by Pritesh Mehta <Pritesh.Mehta@h...> on Mon, 18 Sep 2000 15:26:11 +0100
what you aren't doing is moving the record set on 



place a rs.movenext just before loop



PriteshSite Administrator 

Haymarket Interactive 

mailto:pritesh.mehta@h...







-----Original Message-----

From: Leo Clayton [mailto:claytonl@z...]

Sent: 18 September 2000 15:12

To: ASP Databases

Subject: [asp_databases] My Logic (Loop)





I am trying to:

1) Read a table from a database

2) Create a 3-column form from this reading, in which a user checks some 

checkboxes

3) Submit this form to another page that will create records, in another 

table in the same database, based upon checks in the form



My problem for now is that after printing my headings, I am going into a 

loop and timing out.



Here is the pertinent code:





<%

strSQL = "SELECT * FROM SkillsTable;"

Set DbObj = Server.CreateObject(ADODB.CONNECTION")

DbObj.Open "DSN=EmployeeMaster"

Set oRs = DbObj.Execute(strSQL)

%>



<FORM ACTION="CreateSkillsRecord.asp" METHOD="POST" id=form1 

name=SelectingSkills>

<TABLE BORDER=0>



<%

Do WHILE NOT oRs.EOF

Response.Write("<tr>")

	For i= 1 to 3

		If not oRs.EOF Then

			Response.Write(_

				"<td><input type=Checkbox name=Skill>" &_

				"<td>  " &

oRs.Fields("SkillName").Value & "</td>")

		Else

			Response.Write(_

				"<td< </td>" &_

				"<td< </td>" )

		End If

	Next



	Response.Write(_

		"</tr>")

Loop

%>

</TABLE>





Message #3 by Chris Neale <Chris.Neale@s...> on Mon, 18 Sep 2000 15:30:41 +0100
Somebody forgot their recordset.MoveNext ..



Chris



Chaos! Panic! Disaster! (My work here is done)

Chris Neale. Web/Wap Developer

Chris.neale@s... <mailto:Chris.neale@s...> 

www.sparkresponse.co.uk



	-----Original Message-----

	From:	Leo Clayton [SMTP:claytonl@z...]

	Sent:	Monday, September 18, 2000 3:12 PM

	To:	ASP Databases

	Subject:	[asp_databases] My Logic (Loop)



	I am trying to:

	1) Read a table from a database

	2) Create a 3-column form from this reading, in which a user checks

some 

	checkboxes

	3) Submit this form to another page that will create records, in

another 

	table in the same database, based upon checks in the form



	My problem for now is that after printing my headings, I am going

into a 

	loop and timing out.



	Here is the pertinent code:





	<%

	strSQL = "SELECT * FROM SkillsTable;"

	Set DbObj = Server.CreateObject(ADODB.CONNECTION")

	DbObj.Open "DSN=EmployeeMaster"

	Set oRs = DbObj.Execute(strSQL)

	%>



	<FORM ACTION="CreateSkillsRecord.asp" METHOD="POST" id=form1 

	name=SelectingSkills>

	<TABLE BORDER=0>



	<%

	Do WHILE NOT oRs.EOF

	Response.Write("<tr>")

		For i= 1 to 3

			If not oRs.EOF Then

				Response.Write(_

					"<td><input type=Checkbox

name=Skill>" &_

					"<td>  " &

oRs.Fields("SkillName").Value & "</td>")

			Else

				Response.Write(_

					"<td< </td>" &_

					"<td< </td>" )

			End If

		Next



		Response.Write(_

			"</tr>")

	Loop

	%>

	</TABLE>



Message #4 by Yoram Zehavi <YoramZ@i...> on Mon, 18 Sep 2000 17:35:36 +0200
you forgot the line: oRs.MoveNext...



and the line "If not oRs.EOF.." in the loop is not needed cause you ask for

that at the begining of the loop.



-----Original Message-----

From: Leo Clayton [mailto:claytonl@z...]

Sent: Monday, September 18, 2000 4:12 PM

To: ASP Databases

Subject: [asp_databases] My Logic (Loop)





I am trying to:

1) Read a table from a database

2) Create a 3-column form from this reading, in which a user checks some 

checkboxes

3) Submit this form to another page that will create records, in another 

table in the same database, based upon checks in the form



My problem for now is that after printing my headings, I am going into a 

loop and timing out.



Here is the pertinent code:





<%

strSQL = "SELECT * FROM SkillsTable;"

Set DbObj = Server.CreateObject(ADODB.CONNECTION")

DbObj.Open "DSN=EmployeeMaster"

Set oRs = DbObj.Execute(strSQL)

%>



<FORM ACTION="CreateSkillsRecord.asp" METHOD="POST" id=form1 

name=SelectingSkills>

<TABLE BORDER=0>



<%

Do WHILE NOT oRs.EOF

Response.Write("<tr>")

	For i= 1 to 3

		If not oRs.EOF Then

			Response.Write(_

				"<td><input type=Checkbox name=Skill>" &_

				"<td>  " &

oRs.Fields("SkillName").Value & "</td>")

		Else

			Response.Write(_

				"<td< </td>" &_

				"<td< </td>" )

		End If

	Next



	Response.Write(_

		"</tr>")

Loop

%>

</TABLE>





Message #5 by Mark Everest <Mark.Everest@t...> on Mon, 18 Sep 2000 15:37:27 +0100
Leo,



You have done what most programmers have done hundreds of times over

(including me) - I think you need to do a oRs.MoveNext at some stage in your

loop!!







-----Original Message-----

From: Leo Clayton [mailto:claytonl@z...]

Sent: 18 September 2000 15:12

To: ASP Databases

Subject: [asp_databases] My Logic (Loop)





I am trying to:

1) Read a table from a database

2) Create a 3-column form from this reading, in which a user checks some 

checkboxes

3) Submit this form to another page that will create records, in another 

table in the same database, based upon checks in the form



My problem for now is that after printing my headings, I am going into a 

loop and timing out.



Here is the pertinent code:





<%

strSQL = "SELECT * FROM SkillsTable;"

Set DbObj = Server.CreateObject(ADODB.CONNECTION")

DbObj.Open "DSN=EmployeeMaster"

Set oRs = DbObj.Execute(strSQL)

%>



<FORM ACTION="CreateSkillsRecord.asp" METHOD="POST" id=form1 

name=SelectingSkills>

<TABLE BORDER=0>



<%

Do WHILE NOT oRs.EOF

Response.Write("<tr>")

	For i= 1 to 3

		If not oRs.EOF Then

			Response.Write(_

				"<td><input type=Checkbox name=Skill>" &_

				"<td>  " &

oRs.Fields("SkillName").Value & "</td>")

		Else

			Response.Write(_

				"<td< </td>" &_

				"<td< </td>" )

		End If

	Next



	Response.Write(_

		"</tr>")

Loop

%>

</TABLE>




  Return to Index