Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database macros

Status
Not open for further replies.

krywarick6

Automotive
Jun 9, 2003
138
I'm looking for an example of how to get a field value from an Access database and insert it into a model parameter.

I have written this for an Excel sheet before and know how call that information,
i.e. Part.Parameter("ThreadStart@ThreadPlane@Shaft.SLDPRT").SystemValue = [O15].Value / 1000

Now I would like to try do it from Access because I am finding that I have a larger amount of info that I would like to organize in a database and use that database to control my models.

Any suggestions?

Regards,

Christopher Zona
Litens Automotive Partnership
Concord, Ontario, Canada
 
Replies continue below

Recommended for you

What you probably need to begin with is a "data object" to read the Acces database (.mdb) file. Such an object is available if you add reference to the Microsoft DAO Object Library. The data object has the ability to manipulate the Access database

It may not be possible from a macro, due to licensing issues. However, other VB objects with such capabilities may be available. You may be able to use the Microsoft Access API library.

Another option may be to write your macro from within Access, and have the Access macro manipulate SolidWorks.

[bat]"When everyone is thinking alike, no one is thinking very much." --Eckhard Schwarz (1930--2004)[bat]
 
Maybe another way, if you can´t write macros in Access, is to link cells of your spreadsheet with the fields from your database vis ODBC (this way Excel will get the values deiectly from database).

Now you can use a "regular" Excel macro to link the intended field (cell) to SW.


Regards
 
Save yourself some clock cycles and use

Part.Parameter("").VALUE

instead of

Part.Parameter("").SystemValue

"Value" will return units in your current doc props, except for angular units.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor