How to connect to a database via ODBC on Windows |
[eluser]Jonathon Hill[/eluser]
Hello everyone, There seems to be a lack of clear examples on how to get ODBC working in CI, at least clear for those unfamiliar with ODBC! Here's how I did it: database.php config file: Code: $db['mydb']['hostname'] = "dsn=mysystemdsn;"; // notice the lower case and semicolon mysystemdsn is the name of the system dsn you set up in the Windows XP control panel (Administrative Tools -> Data Sources (ODBC)). Here's a tutorial for that. odbc_driver.php: There's a bug in the ODBC driver file (I'm using CI 1.5.3), so replace the function CI_DB_odbc_driver(): Code: function CI_DB_odbc_driver($params) |
Welcome Guest, Not a member yet? Register Sign In |