Excel VBA: Count # Columns When Downloading From Database

What VBA do I need to count number of columns of data importing from a database in network.

i.e., Usually to do this you only need the connection string and SQL. SQL = "Select * From..."
Who is Participating?
Rgonzo1971Connect With a Mentor Commented:

pls try
varCount = myRecordset.Fields.Count

Open in new window

ouestqueAuthor Commented:
Thanks Rgonzo!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.