ODBC Problems (Connecting Vensim to MS Access)
Posted: Wed Mar 07, 2012 10:52 pm
I am using a vdi file to read data from an Access database. I can get variables but constants. My ":CONSTANTS" keyword includes the followings:
:CONSTANTS
:VARNAME ConstantName
:VALUE ConsVal
:SELECT Constant_Val
! "Constant_Val" is a table in my database where I define value for each constant. The table includes: ConsName and ConsVal.
In the Vensim model, I create a new Constant to get one of the constant values from database (Let's name it as "C1" for which the type is set to be Constant). Then the problem is that I have to put a constant value to run the simulation (I entered 1). If I do so, it doesn't tell Vensim that the constant value should be read from the database. I assumed vdi is going to change the constant value after simulation runs, which was not a correct assumption. Then, I changed the type to be Data, the type that I use to read my variables from database, but when I run the simulation I get this WARNING: "No data found for C1 in the exogenous data file." which makes sense because C1 is not a variable and so it is not associated with time.
So, any idea how to use :CONSTANTS?
Note: Vensim model, Access database, and vdi file are attached!
Thanks,
M.J.
:CONSTANTS
:VARNAME ConstantName
:VALUE ConsVal
:SELECT Constant_Val
! "Constant_Val" is a table in my database where I define value for each constant. The table includes: ConsName and ConsVal.
In the Vensim model, I create a new Constant to get one of the constant values from database (Let's name it as "C1" for which the type is set to be Constant). Then the problem is that I have to put a constant value to run the simulation (I entered 1). If I do so, it doesn't tell Vensim that the constant value should be read from the database. I assumed vdi is going to change the constant value after simulation runs, which was not a correct assumption. Then, I changed the type to be Data, the type that I use to read my variables from database, but when I run the simulation I get this WARNING: "No data found for C1 in the exogenous data file." which makes sense because C1 is not a variable and so it is not associated with time.
So, any idea how to use :CONSTANTS?
Note: Vensim model, Access database, and vdi file are attached!
Thanks,
M.J.