承接 zoilomora/doctrine-dbal-msaccess 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zoilomora/doctrine-dbal-msaccess

Composer 安装命令:

composer require zoilomora/doctrine-dbal-msaccess

包简介

Doctrine DBAL implementation for Microsoft Access

README 文档

README

An implementation of the doctrine/dbal library to support Microsoft Access databases in Microsoft OS.

There are some functionalities that are not supported by Microsoft Access in a PDO-based connection. For these functionalities the implementation uses a direct connection through ODBC.

OS Requirements

  • Microsoft Access Database Engine Redistributable (2010 or 2016).
  • Register a DSN in ODBC Data Source Administrator odbcad32.exe.

Installation

  1. Install via composer

    composer require zoilomora/doctrine-dbal-msaccess

Register a DSN

We don't need to reinvent the wheel, on the internet there are hundreds of tutorials on how to set up a DSN for Microsoft Access. I leave you a video that I think explains it perfectly.

Once the DSN is configured we will have to configure the connection in the following way:

$connection = \Doctrine\DBAL\DriverManager::getConnection(
    [
        'driverClass' => \ZoiloMora\Doctrine\DBAL\Driver\MicrosoftAccess\Driver::class,
        'driverOptions' => [
            'dsn' => 'name of the created dsn',
        ],
    ]
);

Discovered problems

Character encoding problems

The default character encoding in Access databases is Windows-1252. If you want to convert the data to UTF-8, a simple solution would be:

$field = \mb_convert_encoding($field, 'UTF-8', 'Windows-1252');

If you want all the data to be encoded automatically to UTF-8 (with the performance reduction that it may imply) configure the driver as follows:

$connection = \Doctrine\DBAL\DriverManager::getConnection(
    [
        'driverClass' => \ZoiloMora\Doctrine\DBAL\Driver\MicrosoftAccess\Driver::class,
        'driverOptions' => [
            'dsn' => 'name of the created dsn',
            'charset' => 'UTF-8',
        ],
    ]
);

License

Licensed under the MIT license

Read LICENSE for more information

统计信息

  • 总下载量: 246
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 19
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 18
  • Watchers: 2
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-11-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固