Database access

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JasonKerner
Forum Newbie
Posts: 4
Joined: Thu Jan 24, 2008 2:58 am

Database access

Post by JasonKerner »

Ok, I've got a Microsoft Access database on a Windows XP machine. What I want to do is somehow query that database using PHP via a website that people can access from wherever.

I've looked at the ODBC connectors, and from what I understand, those only work if they're on the same machine as the database, so no good for web-based remote queries.

I can't change the database type, or even move the file somewhere else, so I'm assuming I need some kind of server running on the XP machine to make the database accessible, and to make things even more complicated, its behind a router on a LAN, so I'm assuming some port forwarding is required somewhere along the line.

I've read about this solution,

- Installing Microsoft SQL server express (free)
- Installing SQL Server Management Studio Express (free)
- Create a linked server using the MS access database file as the data source


And then I assume use some PHP code to talk to the SQL Server over the web somehow. Any thoughts?

Jason
User avatar
jimthunderbird
Forum Contributor
Posts: 147
Joined: Tue Jul 04, 2006 3:59 am
Location: San Francisco, CA

Re: Database access

Post by jimthunderbird »

I would try to export the data into csv and use php to analyse that csv.

The other way might be to use java to talk to Access, then wrap your java functions in php.

The ultimate solution is of course don't use Access since it's not actually a database, it's just a flat-file.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Database access

Post by Christopher »

Install Apache and PHP on the XP machine with the database. Write a script that access the database via ODBC and return results in whatever format is handy. Open up port 80 to that machine in your router and you can query the database from anywhere.
(#10850)
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Re: Database access

Post by Rovas »

Use this program to import your Access database into SQL Server. Read the tutorial given on this blog. For more information use google, msdn.
Now you can use the extension provided in php for MS SQL Server. Read the documentation on how to get the extension to work here.
Post Reply