?
Solved

Listing column (field) names for ACCESS

Posted on 2003-03-19
2
Medium Priority
?
134 Views
Last Modified: 2010-05-18
I found how to list all the table names from an Access db, but now I need to list all the fields\column names in the table.  
Need this for vb6; pleez help
thx
Bear
0
Comment
Question by:LosBear
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
Cimperiali earned 400 total points
ID: 8168586
'kipped: declare connection and recordset
dim theQuery as string
theQuery="select * from yourtable"
set rs= cnn.execute(thequery)
'the following you can do even if recorset is eof
dim fld as adodb.field
for each fld in rs.fields
    'now i write in immediate window, but you can use this value as you like
    debug.print fld.name
next

rs.close
set rs= nothing
cnn.close
set cnn= nothing
0
 
LVL 1

Author Comment

by:LosBear
ID: 8168975
that was it!
thx cimperiali
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month8 days, 20 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question