×
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

Database macros

Database macros

Database macros

(OP)
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

RE: Database macros

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.

"When everyone is thinking alike, no one is thinking very much." --Eckhard Schwarz (1930--2004)
http://www.EsoxRepublic.com

RE: Database macros

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

RE: Database macros

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.

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