You are here: Re: PHP and Access « PHP Programming Language « IT news, forums, messages
Re: PHP and Access

Posted by Kasper Johansen on 08/08/06 17:22

Miguel Cruz skrev:
> You can do it with ODBC. Are you confident that Access can handle the
> load, though?

Access can be pretty tough... But any I agree with Miguel. You should
try some of the alternatives like SQLite or something. SQLite will work
on many other platforms than just Windows (even though you can get
Access working on Linux, it isnt something that it is fun, and most
users wont even bother going through the trouble for something like Access).

You wont find many guides on how to work with Access and PHP, though it
is totally possible.


If you decide to work with Access anyway, here is what you will have to
do in Windows.

1. Go to the control panel @ Windows.
2. Go to administration.
3. Go to Data Sources (ODBC) (I think that is what it is called).
4. Click on "System-DSN".
5. Click "Add".
6. Choose "Microsoft Access Driver (*.mdb)"
7. Choose a name-id for the connection (something simple like "myaccess").
8. Click "Choose" and choose the access database, that the connection
should work with.


Now you make a testing PHP-document to test the actual connection.

Write something like:
<?
$conn = odbc_connect("myacces");

$f_test = odbc_exec($conn, "SELECT * FROM testtable") or
die(odbc_errormsg($conn));
while($d_test = odbc_fetch_array($f_test){
print_r($d_test);
}
?>


Be aware, that you should create "testtable" and fill it with somedata,
so that PHP will print something :)

I havent testet any of the code.

--
Best regards and good luck
Kasper Johansen aka knj

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация