• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HELP: db-connection settings for ODBC to MSSQL

#13
[eluser]sunil shrestha[/eluser]
I have also connect codeigniter and odbc using DSN Name. But there is some bugs with this driver while using ACTIVE RECORDS.... You should hard code the sql query. for example.. using active records for odbc, it add the bracket to the table name which is not executed for MS sql server. It shows errors like below:
A Database Error Occurred

Error Number: 37000

[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near ')'.

SELECT * FROM (ci_sessions) WHERE session_id = '3ad914bb5f5728e8ac69ad1db8fc9841' AND user_agent = 'Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2'

Filename: D:\wamp\www\IVR_Panel\system\database\DB_driver.php

Line Number: 330


The following are the config file for connecting odbc for MS SQL SERVER

Code:
$db['default']['hostname'] = 'IVR';   // DSN Name created in odbc of administrative tools of // controll panel
$db['default']['username'] = 'dbusername';   // user name of database
$db['default']['password'] = 'dbpassword';   //password of database
$db['default']['database'] = 'dbname';       // database name to connect
$db['default']['dbdriver'] = 'odbc';         // odbc driver name
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

above config is enough to connect to odbc but you have creaTE THE dsn in odbc of administrative tool of control panel


Messages In This Thread
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 02-01-2008, 02:05 AM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 02-01-2008, 04:02 AM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 02-01-2008, 04:19 AM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 02-10-2008, 05:39 PM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 02-10-2008, 10:47 PM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 02-10-2008, 11:58 PM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 02-11-2008, 12:15 AM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 05-12-2008, 07:11 AM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 05-29-2009, 01:17 AM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 03-24-2010, 12:30 PM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 03-25-2010, 06:45 PM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 09-26-2010, 11:30 PM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 03-08-2012, 03:52 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.