|
| |
|
|
ACEDISH
Posts: 177 Joined: 9/30/2002 From: Manassas, Virginia Status: offline
|
define values of a database - 8/25/2009 13:56:05
I am trying to figure out an easier way to define the values from database query. I normally do this.
Set RS = objConn.Execute("SELECT * FROM node WHERE ID= '"&Request("UID")&"'")
do until rs.EOF
ID= RS("ID")
name=RS("name")
address=RS("address")
city=RS("city")
etc....
rs.MoveNext
loop
RS.Close
The below code works to display the names and values...
Set RS = objConn.Execute("SELECT * FROM node WHERE ID= '"&Request("UID")&"'")
do until rs.EOF
for each x in rs.Fields
Response.Write(x.name & "<br />")
Response.Write(" = ")
Response.Write(x.value & "<br />")
next
Response.Write("<br />")
rs.MoveNext
loop
RS.Close
and i tried x.name=x.value but get an error, seems there should be a way to do this without having to list each record name and its value...
_____________________________
" Anyone who can only think of one way to spell a word obviously lacks imagination"
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|