ErGa 0 Newbie Poster

Hello,

I would like to create a small procedure that fetches the names of the columns of a table and uses them as a variable name.

Let me explain.

TableA
Ref, FullName, FirstName, Age, ...
1, Jones, Charles, 32
2, Bridge, Dom, 26
3, Goodtime, Jack, 46
...

And I would use in my asp procedure variables with the names of the columns without having to copy many of the names of the columns.

FullName =
FirstName =
Age =
...

Below the concept but of course it can not function as it is.

Set RS = Server.CreateObject ("ADODB.Recordset")
Rs.Open "SELECT * FROM TableA WHERE Ref = '" & Session ("Ref ")&"'", adoCon, 3, 3
For Each f in rs.Fields
f.Name = RS (f.Name)
next
Rs.Close: set RS = nothing
Response.write "The name is "&FullName

Result:
If Session ("Ref") = 1 we should have
The name is Jones

This would assign all the variables even if the evolutionary table.

I hope to be clear enough;-)

Thank you for your help

Eric