zoilomora / laravel-msaccess

Laravel ORM for Microsoft Access DB
https://github.com/zoilomora/doctrine-dbal-msaccess
MIT License
33 stars 22 forks source link

Unable to install through composer #1

Closed IP-Developer closed 6 years ago

IP-Developer commented 6 years ago

Laravel 5.4

zoilomora commented 6 years ago

Hello, could you detail what is happening to you?

Can you attach any log or screenshot?

IP-Developer commented 6 years ago

Console screenshot

IP-Developer commented 6 years ago

Also, an example of a DSN would be very welcome :)

rizaldywirawan commented 6 years ago

Hola @WrongWay,

According to the picture above, please add this code to your composer.json after "config" section:

"minimum-stability": "dev",
"prefer-stable": true

About DSN, what is your operating system?

If Windows is your operating system, please follow this instruction:

  1. Open Control Panel -> Administrative Tools -> ODBC Data Sources (32-bit) or (64-bit) (according to your php bit version, if you are using XAMPP usually it's 32-bit, but if you use Laragon, it depends on your laragon installation, mine is 64-bit).

  2. For example we will use 64-bit version, double click on ODBC Data Sources (64-bit).

  3. Choose Add.

  4. Choose Microsoft Access Driver (.mdb, .accdb), press Next.

  5. Fill the Data Resource Name column, for example mine is "CyberBilling", and fill the Description column (optional).

  6. In Database section, choose Select..., and locate your access file location. For example, mine is D:\Database\database.mdb.

  7. If your Access file has password, please press Advanced..., and in Login name column, please type your username, and in Password column, please type your password. Then press OK.

Then add conenction to your config/database.php in connections section:

'access' => [
    'driver' => 'pdo_access',
    'connection_string' => 'dsn={namedsn}',
    'username' => '',
    'password' => '',
    'table_prefix' => '',
]

Change the {namedsn} to your Data Resource Name, according to the example above, i will change it to CyberBilling

'access' => [
    'driver' => 'pdo_access',
    'connection_string' => 'dsn=CyberBilling',
    'username' => '',
    'password' => '',
    'table_prefix' => '',
]

That's it, if you found something, please tell us.

IP-Developer commented 6 years ago

Still doesn't work conemu64_2017-12-09_09-09-36 Also tried to change "prefer-stable" to false or "minimum-stability" to dev-master with no success.

rizaldywirawan commented 6 years ago

Hola @WrongWay,

Hmm, that's weird.

This is my composer.json, take a look at minimum-stability section. Can you post your composer.json screenshot?

composer

How about the DSN, does it work?

IP-Developer commented 6 years ago

@rizaldywirawan it works fine now, thanks for the help :) But I also encountered another problem with the encoding. Instead of Cédric I get C?dric. Any way to fix this ?

rizaldywirawan commented 6 years ago

Hola @WrongWay,

Can you post a picture about it? Haven't heard about that before.

Have you read about this article ? I hope that's what you looking for.

IP-Developer commented 6 years ago

@rizaldywirawan this is a problem with the ODBC connection itself, not the display (I have utf8 set everywhere). I don't know how to set the encoding of the database and/or the connection. I don't even know which encoding is used in the Access database.

rizaldywirawan commented 6 years ago

Hola @WrongWay,

Aw, sorry about that.

Did you succeed to show data from database? Sorry for stupid question here, have you uncomment extension=php_pdo_odbc.dll at php.ini file?

I guess, the only one who can answer this question is @zoilomora.

IP-Developer commented 6 years ago

@rizaldywirawan yes, I uncommented the extension and the connection works well (except the encoding, of course). Looks like I will need to export everything as CSV to get proper encoding :(

rizaldywirawan commented 6 years ago

Hola @WrongWay,

Aw, sorry to hear that, i hope you will get the solution soon, of course without export to CSV.

IP-Developer commented 6 years ago

@rizaldywirawan for a one-time export/import csv is not a problem for a small database. Although it would be a lot better to use this package for that :)

rizaldywirawan commented 6 years ago

Hola @WrongWay,

I agree with you, straight to the db is the best option, at least for me :p.

I guess your main problem (install this package) already solved, how about close this issues?

IP-Developer commented 6 years ago

@rizaldywirawan yeah, sure. Thanks for help :)

rizaldywirawan commented 6 years ago

Hola @WrongWay,

You're welcome, success for your project ;), and i hope @zoilomora will find and way to fix the encoding problem.

zoilomora commented 6 years ago

Hello, I have been indisposed this weekend, sorry for the absence.

Thank you very much @rizaldywirawan for your great help.

@WrongWay I'm sorry that this package did not work for you. Could you send me an example database where it happens to you to analyze the problem?

IP-Developer commented 6 years ago

@zoilomora Hi, the package works fine, I can select anything from the database, but there is a problem with the diacritics being converted to question marks (like plain question marks, not the squared ones). The text in the database is french. Laravel is all set up to use UTF-8. I'll try to upload an example db today.

zoilomora commented 6 years ago

@WrongWay I will write it down in the TODO file to take it into account for the next version. ;)

IP-Developer commented 6 years ago

@zoilomora

test.zip

Here are some string examples.