OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

define values of a database

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> define values of a database
Page: [1]
 
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"
Spooky

 

Posts: 26681
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: define values of a database - 9/1/2009 3:28:01   
Looks seriously at using getrows, its a way more efficient way of pulling data from the database.
eg get the data > dump into array > close the database > use the array at leisure
With your example, youll still want to use rs(0) rs(1) etc to write the values

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to ACEDISH)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> define values of a database
Page: [1]
Jump to: 1





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