Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Get Table Column Names 2

Status
Not open for further replies.

EricsonJ

Programmer
Mar 3, 2002
44
US
I want to get the column names of a table, and I think I should use SQLColumns, but, after I consult the ODBC API reference, I was confused by those parameters.
Any one can help?

Thanks a lot
 
The columns names are readily available by looping thru the Fields object collection in an ADO recordset.

RecSet.Fields.Item(n).Name

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
You could use also an ADO Connection object’s (OpenSchema) Method. It can return all sorts of information about the data source / database. Including field / table names
 
I have used both OpenSchema Method and RecSet.Fields.Item(n).Name, and it works. Thank you very much.
 
Great Job guys. The RecSet.Fields.Item(n).Name worked for me as well. Much apperciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top