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
|
|||
|
|||
PostgreSQL ODBC connection
Hi Folks,
I am using PostgreSQL( for the first time ) as an database ,i have set up an DSN connection . I am trying to connect to the db by the following code treenode current = ownerobject(c); dbusername("postgres","password"); dbopen("kartik","output",0); --------------------------- ODBC Error --------------------------- Data source name not found and no default driver specified. Driver: [Microsoft][ODBC SQL Server Driver] ODBC Code:IM002 Flexsim Code: 2 - SQL - Connect --------------------------- OK --------------------------- Any ideas on how to avoid this error/popup to occur? Thanks in advance! |
#3
|
|||
|
|||
Hi Michael,
yes i have installed the correct driver for postgreSQL , No i am not using the SQL server driver. I reckon that while using postgreSQL : (a) dbusername() - we use this to connect to the database ( by giving the username ans password) . (b) dbopen() - opens the database and accesses the tables I have created an DSN , Do we require an additional query to access the PostgreSQL server ? ( which in turn uses dbusername and dbopen to access the databases present in the server) For example : While Using Microsoft Access database string ODBCname = "AccessFlexsimDB"; Cheers and Regards, |
#4
|
|||
|
|||
In the code above 'kartik' is your DSN. Is that what you have set up?
You put 0 for tablemode, yet entered "output" for the SQL statement, which isn't valid SQL. Is that a tablename? |
Thread | Thread Starter | Forum | Replies | Last Post |
ODBC error | Johannes Cottyn | Q&A | 4 | 04-08-2010 09:35 AM |
PLC connection, positioning issues | Stephan Seidel | Q&A | 13 | 04-08-2010 01:02 AM |
Batch connection changes | KelvinHo | Q&A | 2 | 02-05-2010 03:01 PM |
Port Connection Problem | Joe Allen | Q&A | 2 | 05-11-2009 10:56 AM |
how to send msg to another which do not have connection with the sender object | KelvinHo | Q&A | 3 | 03-05-2008 04:28 AM |