YII, MS Access how can i use it together?

2019-08-29 02:32发布

问题:

I want use Yii and MS Access together, but I don't know how..
I can use ODBC without Yii like this

$link = odbc_connect($name, $user, $pass)

but now i need it in Yii, like MySQL:

'db'=>array(
        'connectionString' => 'mysql:host=localhost;dbname=ex1c',
        'emulatePrepare' => true,
        'username' => 'root',
        'password' => '',
        'charset' => 'utf8',
        'tablePrefix' => 'ex1c_',
    )

what should i write in connection string
may be need something software setup in computer
how to set it?

回答1:

If I'm understanding your question right, you have one set of data that you want to be able to reference from a YII application and from MS Access. The best approach I can think of here is to:

  1. Put the data into a MySQL database
  2. Have YII access it directly as you illustrate above
  3. Set up the MySQL ODBC driver on the Windows machine where you are running access, and point Access at MySQL via that driver

Here is a pointer to MyODBC, which will provide the critical linkage between Access and MySQL:

http://dev.mysql.com/downloads/connector/odbc/



标签: php mysql yii