• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help!!!! configuration for database.php using ms access dabase

#1
[eluser]remmar[/eluser]
Hi

I'm a newbie.

I need to use MS access as databse and need to setup up on database.php can anyone help me. it's should be dsn-less if possible.

#2
[eluser]InsiteFX[/eluser]
You would need to use odbc driver for access

InsiteFX

#3
[eluser]remmar[/eluser]
do you any sample configuration for database.php

#4
[eluser]InsiteFX[/eluser]
You can try the below, but warning you need to setup your Windows odbc data sources.
Code:
$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = '';
$db['default']['password'] = '';
$db['default']['database'] = '';
$db['default']['dbdriver'] = 'mysql';
$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;

// Access Database settings. change $active_group = 'access';
$db['access']['hostname'] = "{Microsoft Access Driver (*.mdb)}";
$db['access']['username'] = "ADODB.Connection";
$db['access']['password'] = "";
$db['access']['database'] = "\\path\\to\\db.mdb";
$db['access']['dbdriver'] = "odbc";
$db['access']['dbprefix'] = "";
$db['access']['pconnect'] = TRUE;
$db['access']['db_debug'] = TRUE;
$db['access']['cache_on'] = FALSE;
$db['access']['cachedir'] = "";
$db['access']['char_set'] = "utf8";
$db['access']['dbcollat'] = "utf8_general_ci";
$db['access']['swap_pre'] = '';
$db['access']['autoinit'] = TRUE;
$db['access']['stricton'] = FALSE;

InsiteFX

#5
[eluser]remmar[/eluser]
I've have odbc already name "access". btw, the mdb required a password.


and set the database.php

$db['access']['hostname'] = "{Microsoft Access Driver (*.mdb)}";
$db['access']['username'] = "ADODB.Connection";
$db['access']['password'] = "";
$db['access']['database'] = "D:\\Cash Management\\Workbench\\dbMIS.mdb";
$db['access']['dbdriver'] = "odbc";
$db['access']['dbprefix'] = "test";
$db['access']['pconnect'] = TRUE;
$db['access']['db_debug'] = TRUE;
$db['access']['cache_on'] = FALSE;
$db['access']['cachedir'] = "";
$db['access']['char_set'] = "utf8";
$db['access']['dbcollat'] = "utf8_general_ci";
$db['access']['swap_pre'] = '';
$db['access']['autoinit'] = TRUE;
$db['access']['stricton'] = FALSE;


but i have this error.


A Database Error Occurred
Unable to connect to your database server using the provided settings.

Filename: C:\wamp\www\system\database\DB_driver.php

Line Number: 124

#6
[eluser]InsiteFX[/eluser]
As I stated above you need to setup a Microsoft Access Driver!

Read this!

InsiteFX

#7
[eluser]remmar[/eluser]
Yes i've created one already via odbc. I nammed the system DSN to "access"

#8
[eluser]remmar[/eluser]
anybody I need help

#9
[eluser]Anak Indonesia[/eluser]
$db[‘access’][‘dbprefix’] = “test”; ??

#10
[eluser]Jaketoolson[/eluser]
Yah. Why do you need double backslashes with Ms ACCESS paths? Is this a PHP thing? ODBC Driver thing?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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