|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
using recordsset fields
I have used conn.execute to open a recordset .If i say response.write
set rec=server.createobject("adodb.recordset") set rec=conn.execute("select id ,name,user from table") response.write rec(0) response.write rec(2) response.write rec(1) this statements displays blank even if it contains info It works file on development server on live server this error occurs. Is it because conn.execute creates forward only cursor? |
|
#2
|
|||
|
|||
|
Do you get an error message or is it just blank? It works on your development server but not on your production box? Is it connecting to the same database?
|
|
#3
|
|||
|
|||
|
You don't need to create an ADODB.Recordset if you're going to use the Conn.Execute statement. Use ADO or SQL.Execute not both!
When you say it displays blank. Do you mean all the fields or just the name field? Have you tried running a loop? Are you using Access or SQL server? Here's the code for a loop: Code:
If rec.eof then Response.Write "There is a problem with the recordset." Else Do while not rec.eof Response.Write "ID - " & rec(0) Response.Write "Name - " & rec(1) Response.Write "User - " & rec(2) Loop rec.movenext End if |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > using recordsset fields |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|