all groups > inetserver asp db > may 2005 >
You're in the

inetserver asp db

group:

Return the column name?


Return the column name? Bob The ASP Builder
5/30/2005 12:00:00 AM
inetserver asp db:
I use Access database with an ASP frontend.

db contains a tabel called 'mytable' containing an unknown number of
columns.

I want to call the db and find out the names of column 2 och 3 ( out
of for example 0, 1 , 2, 3, 4)

Or a list or string containing all the names of all the columns (apart
from the ID column)

How can I do that? -

Either retrieve the names

Re: Return the column name? Jon
5/30/2005 8:16:02 AM
an alternative to that would be:

for each column in RS.fields
if column.name <> "IdField" then Response.Write column.name & "<BR>"
next

Just a suggestion to keep your code a bit shorter and also if you have any
fields that use Autonumber than your Id Field (unlikely but possible) it
won't write these either.

--
Jon
warpedpixel@gmail.com
Look at that dead pixel on your screen! *SLAP* Gotcha!
[quoted text, click to view]

Re: Return the column name? Jon
5/30/2005 8:30:58 AM
May also not work coz of the nature of your problem. Never mind. It's 8:30
in the morning ... I don't quite function yet! :op

--
Jon
warpedpixel@gmail.com
Look at that dead pixel on your screen! *SLAP* Gotcha!
[quoted text, click to view]

Re: Return the column name? Bob The ASP Builder
5/30/2005 8:45:16 AM
On Mon, 30 May 2005 07:13:49 +0200, Bob The ASP Builder
[quoted text, click to view]

I actually found this little piece of code doing the right thing for
me

for each column in RS.fields
if column.Properties("IsAutoIncrement") then
Else
Response.Write column.name

Response.Write "<br>"
End If
next

Thanks to myself
AddThis Social Bookmark Button