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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reference fields by index

Status
Not open for further replies.

ken2834

Technical User
Jun 26, 2006
27
0
0
US
Is there a way I can retrieve a list of fields in a table, without having to hard code each field name?
 
Can you be a *little* bit more specific?? (Please.)

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a MS MVP? PODA
- Leonardo da Vinci
 
What I mean is, if I have a table called TABLE_TEST, and I have three fields, say first_name, last_name,and phone.

Can I do something like select field(3) from table_test where last_name = "Smith", and expect to retrieve the phone number? I believe I have seen this in Oracle or somewhere.

Alternatively, is there a way to retrieve the table definition from somewhere?
 
I know this sounds pretty basic but do you mean something as simple as:

Select * from Table_test where field3 = 'Smith'

This would return you all fields without having to hardcode them where your field(3) = Smith.

 
A TABLE using VBA can be many things.

From what you have said so far it seems you are trying to access a table on a DATABASE, using SQL statements.

If so search these (all VB related) for "ADO", "tables" and "fields", together with "select".

There have been many threads about that subject.
This is one of them. thread709-474678

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top