Jump to content
Simio Forum

Welcome to the Simio Forum

Welcome to the Simio Forum! Experience the full experience of the forum by becoming a Simio Insider! You must be an Insider to post on any forum!

Click_Here_button.png

New Software Release

Our latest release, Simio 11, is here!

marquisd

MS Access Database Help

Recommended Posts

Hello


I'm trying to build a (very) simple simulation that accesses a data variable from MS Access (2007). I have a table called "CurrentValues", with a couple columns named Station1Pressure and Station1Temperature.


For my sim, in the first instance, I just want to read in (DBRead step) in the values; so, I have process that reads the value when I click a button.


Eventually, I want to update the database value with a form in Access and see the change when I click the event button in Simio.


Note: The database (Sample.accdb) and the sim are in the same directory.


First problem is, after I define the Element reference (DbConnect), I set the "Connection String" to the database file, (Sample.accdb) and the "Provider Name" to "Microsoft.ACE.OLEDB.12.0" as noted in another post. Unfortunately, I get the error attached.


(I'll start with that since if I can't get through the first step, the following ones are irrelevant.)


Thanks

DBError.png.3a214eff5e4244d9d1da3edb970b89e6.png

Share this post


Link to post
Share on other sites

NOTE: Inserting Data into MS Access is very slow...I suggest using MySQL or Microsoft Sql Server


Your connect string should be: Provider=Microsoft.ACE.OLEDB.12.0;data source=C:\\Users\\dbName.mdb


The provider should be: OleDb Data Provider


If you are getting an error stating"Microsoft.ACE.OLEDB.12.0 provider is not registered on the local machine", see the following URLs... Running connectivity to MS Access using 64 bit apps is a well known issue. If this is an issue on your side, either follow the steps in the following URL or run SImio in 32 bit mode.


http://social.msdn.microsoft.com/Forums/en-US/1d5c04c7-157f-4955-a14b-41d912d50a64/how-to-fix-error-the-microsoftaceoledb120-provider-is-not-registered-on-the-local-machine


http://www.microsoft.com/en-us/download/details.aspx?id=13255

Share this post


Link to post
Share on other sites

Follow-up:


Now, attached is a screenshot of my database table. I want to get the value of Station1Pressure with a DBRead step and put it into "ModelStation1Pressure" state.


I guess what I really need is a better definition of what "Columns" and "Where" properties in the Basic Logic of the step really means and how they are different from the "Where Column" and "Where State". It seems to be that they actually do nearly the same things.


Clearly this doesn't make sense.


Thanks

614600134_DbaseScreen.thumb.png.254d4cd896eb7343aad35a38bdffc29a.png

1439368617_StepDetails.PNG.fa3885e3b9a9899ff161c89c36ada31d.PNG

Share this post


Link to post
Share on other sites

Nevermind! Found it. :mrgreen:


Answers: No, you don't need to (probably shouldn't) fill in both items in the Dbread step.


Cheers

Share this post


Link to post
Share on other sites

Actually, one more question...what Simio statement can I use to get the value in the last row of a database table without doing a query inside Access? This would correspond to the latest data.


Thanks

Share this post


Link to post
Share on other sites

×
×
  • Create New...