Does anyone out there know how to select the fieldnames from an access table? I need to fill a list box in my VB front end with the fieldnames from an access table.
Sorry I should have been a little more specific...I need to do this using a sql_statement that retireves an adodb.recordset so the .FieldName function will not work.
Ok I actually ended up solving this one....igk pointed me in the right direction but with an adodb.recordset there is no .FieldName property. what I had to do is:
do until x =recordset.fields.count-1
list1.additem recordset.Fields(x).name
x=x+1
loop
after running my select statement...."select * from tablename"
I'm not sure how this will work when there is no data returned from the query but it's a start nonetheless.
Thanks Jebry,
Unfortunately I am using a VB frontend....my original thoughts for posting to this forum was that I could right a SQL statement that Access could understand that would return the names of the fields. Instead I played with VB methods to achieve the same.
Thanks anyways
-Crow
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.