×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Using VBA to Pull Data from Access Database

Using VBA to Pull Data from Access Database

Using VBA to Pull Data from Access Database

(OP)
Good Day,
         Does anyone know the best way to pull information from an Access Database file. The values from the database are used as the input in a Solidworks VBA macro. I can pull data from Excel, but how do you set up a query in the VBA code to search for the record that matches specific criteria in the Access file, and use it as a variable.

Best Wishes,
Suzy

RE: Using VBA to Pull Data from Access Database

by DAO or EDO.

RE: Using VBA to Pull Data from Access Database

by DAO or EDO ADO

RE: Using VBA to Pull Data from Access Database

(OP)
Ok. It is in DAO. However I already got through with it. I was able to do it with SQL search strings. My new problem is to try to figure out how to output the results from VBA to Excel.

RE: Using VBA to Pull Data from Access Database

With DAO you can accomplish it as by sample code in the This File . You need to create reference to DAO ( by Tools-->Preferences)before executing such code that refers to DAO Object model

RE: Using VBA to Pull Data from Access Database

(OP)
Thanks for the file, but I was looking for something a little different. I actually want the Solidworks VBA macro to push the data to the Excel file, rather than to have excel pull from a database. What I actually want to do is to use Excel just as an output file.

RE: Using VBA to Pull Data from Access Database

If still seeking the solution then I suggest to use Excel object model within your VBA code. If you can specifically mention the problem then I can suggest you more speific solution.

RE: Using VBA to Pull Data from Access Database

(OP)
Thanks for being so helpful. I will give you the specifics. I am using solidworks to produce a drawing based on information in an access database. That part of it I have already done, but what I want to do now is output some critical dimensions from the drawing into an excel file for easy comparisson. Therefore I need the solidworks vba to make a new excel file, and save the drawing dimensions to it.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources