Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Using VBA to Pull Data from Access Database

Status
Not open for further replies.

kabluzy

Mechanical
Feb 10, 2003
16
0
0
TT
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
 
Replies continue below

Recommended for you

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.
 
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.
 
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.
 
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.
 
Status
Not open for further replies.
Back
Top