Forum Moderators: coopster

Message Too Old, No Replies

Accessing and modifying to an Access database

Need to modify an Access database via PHP

         

Numberman

2:28 am on Apr 25, 2004 (gmt 0)

10+ Year Member



I started a project some time ago which required a database to organize the information. At the time I decided to use Microsoft Access as the database format because of the easy-to-use interface.
Now I've created a website centred around the project which a large number of people use. I'm currently using a simple HTML to display the information, but I still use the access database for all the important information (as do several of my colleagues).
I need a way to either connect to the database from my website because it makes updating the project much easier, and I have to do it with PHP. Either that or I need a way to convert the access database to MySQL.

I'd appreciate any help you can give. I've tried PHP.net, but I can't find anything about Access database connections.

hakre

1:56 pm on Apr 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi Numberman,

it's not a miracle you found nothing at php.net. access is not directly supported (for example like mysql), but you don't need to worry. you can simply use the ODBC functions to connect to access. ODBC is supported by PHP [php.net] so that might be the place to start. on that page you'll find some info in the usercomments how to connect to a access db:


To connect to a MDB Access file without adding a system dsn to Windows :
$cfg_dsn = "DRIVER=Microsoft Access Driver (*.mdb);
DBQ=C:/Access.mdb;
UserCommitSync=Yes;
Threads=3;
SafeTransactions=0;
PageTimeout=5;
MaxScanRows=8;
MaxBufferSize=2048;
DriverId=281;
DefaultDir=C:/ProgramFiles/CommonFiles/ODBC/DataSources";

$cfg_dsn_login = "";
$cfg_dsn_mdp = "";

odbc_connect($cfg_dsn,$cfg_dsn_login,$cfg_dsn_mdp);

i guess that's the point to start you were looking for. anyways, access is not a multi user database, so beware: do not make many connections at the same time to your access file. this will slow down a lot and you might loose data. this is especially important when you build a website based on access.

--hakre

coopster

1:07 pm on Apr 26, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



This similar thread may also provide some valuable information/direction in your decision-making process.

MySQL/PHP or MS Access [webmasterworld.com]

ergophobe

3:02 pm on Apr 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Wow, this has been coming up a lot lately. Some other threads that may help

[webmasterworld.com...]

[webmasterworld.com...]

[webmasterworld.com...]

[webmasterworld.com...]