Took me forever to figure this out because the docs out there for 4D are minimal.
Easy configuration of multiple data sources is crucial if you want to use CodeIgniter or any other framework that allows configuration files to control the deployment and connection to various databases.
// get the connection resource $connect = odbc_connect('DRIVER={4D v11 ODBC Driver};SSL=false;SERVER=192.168.1.100;PORT=19812;UID=user;PWD=password',"","");
I played with various different ways of doing this connection string, and found the above the most straight forward. You can leave password blank if there isn’t one.
Now if only they would make a linux odbc driver…
Thanks a lot, very helpful! saved me a day of searching :)
Good Information. Saved lot of search time.
$dsn = ‘DRIVER={4D v11 ODBC Driver};SSL=false;SERVER=10.0.0.19;PORT=81;UID=user;PWD=password’;
//or
$dsn = ‘4DODBC’;//Created a DSN to 4D odbc driver
$connect = odbc_connect($dsn,$user,$pass);
Yes, you can also connect via a named DSN created in the data sources (odbc) management window.
Good stuff! I copied the exact driver name from the ODBC control panel’s “Drivers” tab, so I used DRIVER={4D v13 ODBC Driver 64 bits} and it works like a charm.
Hi…
Will this work with the Javascript? and can you send the full connection string and to retrieve records,
Thanks
If you would like I’m available for contract work. This post is just about making an ODBC connection to the database.
Records are stored in your table structure and would require work to retrieve. Let me know.