Re: Referencing data column by it's name
- From: "Erol Fornoles" <erol.fornoles@xxxxxxxxx>
- Date: 25 Nov 2006 10:02:04 -0800
Hmmm from what I recall rs("FirstName") should work, but if it doesn't
try rs.Fields("FirstName").
- Erol
On Nov 26, 1:40 am, nos...@xxxxxxxxx wrote:
here's my code:
<%
set conn = server.createobject("ADODB.Connection")
conn.open "databasename"
set rs = conn.execute("select * from myTable")
var_firstname = rs(1)
// THE NAME OF COLUMN 1 IS FirstName
%>
here's my question:
I'd like to know how to pull data from the database using the name of the
column instead of using it's column number rs(1)
Can't you reference it somehow by saying var_firstname = rs("FirstName") or
something like that?
Thanks for any input!
Michael
.
- References:
- Referencing data column by it's name
- From: nospam
- Referencing data column by it's name
- Prev by Date: Referencing data column by it's name
- Next by Date: Re: Referencing data column by it's name
- Previous by thread: Referencing data column by it's name
- Next by thread: Re: Referencing data column by it's name
- Index(es):