p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

activex_data_objects thread: Recordset does not return set of records


Message #1 by vikas_deodhar@y... on Mon, 6 Aug 2001 13:25:03
Hi all....



I use Oracle Database with ASP...



In the example below I can fetch & display count(*) 

but cannot get the data in the example i am trying to display "empid"....

The table has 6 rows.



Thanks for all yr help.

-Vikas



dim conn

dim rsDB



	SET 	conn = CreateObject ("ADODB.Connection")



	conn.Open "dsn=local-ventasys;uid=scott;pwd=tiger"



	set rsDB = conn.Execute ("Select count(*) as emp_count from emp")



	WHILE not rsDB.EOF

		Response.write "emp_count = " & rsDB( "emp_count" ) 

& "<BR>"

		rsDB.MoveNext

	WEND



	rsDB.Close



' -------------------------------------------------------------------------



	SET 	conn = CreateObject ("ADODB.Connection")



	conn.Open "dsn=local-ventasys;uid=scott;pwd=tiger"



	set rsDB = conn.Execute ("Select empid as empid from emp")



	WHILE not rsDB.EOF

		Response.write "empid = " & rsDB( "empid" ) & "<BR>"

		rsDB.MoveNext

	WEND



	rsDB.Close
Message #2 by vikas_deodhar@y... on Mon, 6 Aug 2001 15:31:15
Hi All ...



On further trials i have noticed that when I select a field of type STRING 

or DATE the recordset fetches all rows.  ONLY when i select a NUMBER type 

I get an EOF error.



Thanks in advance...

-Vikas



> Hi all....

> 

> I use Oracle Database with ASP...

> 

> In the example below I can fetch & display count(*) 

> but cannot get the data in the example i am trying to display "empid"....

> The table has 6 rows.

> 

> Thanks for all yr help.

> -Vikas

> 

> dim conn

> dim rsDB

> 

> 	SET 	conn = CreateObject ("ADODB.Connection")

> 

> 	conn.Open "dsn=local-ventasys;uid=scott;pwd=tiger"

> 

> 	set rsDB = conn.Execute ("Select count(*) as emp_count from emp")

> 

> 	WHILE not rsDB.EOF

> 		Response.write "emp_count = " & rsDB( "emp_count" ) 

> & "<BR>"

> 		rsDB.MoveNext

> 	WEND

> 

> 	rsDB.Close

> 

> ' -----------------------------------------------------------------------

--

> 

> 	SET 	conn = CreateObject ("ADODB.Connection")

> 

> 	conn.Open "dsn=local-ventasys;uid=scott;pwd=tiger"

> 

> 	set rsDB = conn.Execute ("Select empid as empid from emp")

> 

> 	WHILE not rsDB.EOF

> 		Response.write "empid = " & rsDB( "empid" ) & "<BR>"

> 		rsDB.MoveNext

> 	WEND

> 

> 	rsDB.Close

  Return to Index