ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
#1
|
|||
|
|||
ODBC error
I'm executing an insert query using ODBC as listed below:
dbusername("VSM","****"); dbopen("FlexSimVSM","SELECT * FROM [Segment Response]",0); dbsqlquery(concat("INSERT INTO [Segment Response] VALUES ('TEST','Aluminum Cutting','TEST','...', 0)")); dbclose(); The query gets executed correctly by MSSQL but after every query I get an ODBC error in Flexsim, resulting in this annoying popup interupting my simulation: --------------------------- ODBC Error --------------------------- Invalid Cursor State Driver: [Microsoft][ODBC SQL Server Driver] ODBC Code: 24000 Flexsim Code: 17 - SQLFetchScroll - first --------------------------- OK --------------------------- Any ideas on how to avoid this error/popup to occur? Thanks in advance! |
#2
|
||||
|
||||
Johannes,
Is the code that you show there exactly like the code the is causing trouble? Or are you calling any other database commands between the dbsqlquery() and dbclose() calls? If you are calling any other commands, then you need to perform a SELECT statement before reading anything. Also, what version of Flexsim are you using? There have been a few minor changes to the database system recently. I would like to make sure that you are using the latest version. Thanks. A.J. |
#3
|
|||
|
|||
No, I'm not calling any statements in between ...
I'm working with version 4.5.0 The code gets executed on the model trigger 'on reset'. I don't know if that makes a difference? Thanks |
#4
|
||||
|
||||
Johannes,
This was a bug that existed in version 4.5. It was fixed for version 4.52. I recommend that you upgrade your installation to avoid this error. A.J. |
The Following 2 Users Say Thank You to AJ Bobo For This Useful Post: | ||
Phil BoBo (04-06-2010) |