Visual Fox Pro Db4Yiiframework

Database extension to access vfp database. Easy to setup. I hope that some vfp users found this extension useful to build there own web-server tools based on Yii framework and vfp database.

Compatible with gii model and crud Generators

[size="6"]Usage[/size]

  1. Install "advantage ODBC driver". You can search it, on Google with "Advantage ODBC download"

  2. Copy the odbcvfp extension into "application.extensions" directory.

  3. Attach odbcvfp components into an application and connect to your database directory. edit main.php on "application.config" directory and merge the following options


...

'import' => array(

    ...

    'application.extensions.odbcvfp.*',

    ...

),

...

'components' => array(

    ...

    'db'=>array(    'class'=>'COdbcVfpConnection',   

                              //   'schemaCachingDuration'=>90,   /* Useful to speedup schema readings */

                       		//  'queryCachingDuration'=>90, 	/* Speedup static tables queries */

                       		//  'schemaCachingExclude'=>array('listas','stock'), /* when queryCachingDuration enable you define a array with all db object (tables,views) that will be changed frequently to be excluded from cache */

                                'charTrim'=>true,		/* this option will trim all vfp fields with char type */

                                'lowerFieldNames'=>true,   /* this option apply strtolower to all field names. This option will be useful if you want to change database in the future. Note that most databases uses lowercase letters and advantage database uses uppercase.*/

                                'driverMap'=>array('odbc'  =>'COdbcVfpSchema'), 

                                'connectionString' =>

		"odbc:DRIVER={Advantage StreamlineSQL ODBC};DataDirectory=<match case full path>;SERVER=NotTheServer;Compression= ;DefaultType=Visual FoxPro;Rows=False;Language=ANSI;AdvantageLocking=OFF;Locking=Record;MemoBlockSize=64;MaxTableCloseCache=5;ServerTypes=1",                                         						

                        ),

    ...

),

...

Hi, I’m using VFP database (.dbf), I try to install this driver following your instructions, but this doesn’t works, can you help me please?

My main.php file in application.config is:




'db'=>array(

			'class'=>'COdbcVfpConnection',   

			'charTrim'=>true,          

			'lowerFieldNames'=>true,   

			'driverMap'=>array('odbc'=>'COdbcVfpSchema'), 

			'connectionString' =>

			"odbc:DRIVER={Advantage StreamlineSQL ODBC};DataDirectory=\\192.168.0.16\dell-server;SERVER=NotTheServer;Compression= ;DefaultType=Visual FoxPro;Rows=False;Language=ANSI;AdvantageLocking=OFF;Locking=Record;MemoBlockSize=64;MaxTableCloseCache=5;ServerTypes=1",                                                                                         

		),



Thanks!

J.

Hi Vitor

Were you able to connect to your vfp dbf fie ?

HI,

I need to repair some DBF files created by Visual Fox Pro. I wonder if there is a free or pay tool to do it? or If this could be possible using VFP 9?

Thanks in advance.