YII, MS Access how can i use it together?

2019-08-29 02:42发布

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?

标签: php mysql yii
1条回答
欢心
2楼-- · 2019-08-29 03:02

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/

查看更多
登录 后发表回答