Jump to content

Connecting to Access Database


bgallegos
 Share

Recommended Posts

Wow, you're an adventurous one! Either that, or you're really into pain and suffering. Or just inexperienced.There are some major problems with this that you might not be able to overcome. The root of the problems are that Access is a Microsoft technology, and PHP is basically a Linux/Unix open source technology, even though it does have a lot of support for Windows. But the support is only one way, Microsoft has no intention of offering to support PHP because they are pushing ASP instead.So. The main problem here is that the Access database is on another server. In order to even have a prayer of getting this to work, you will probably need administrator access on both of the servers, so that you can set up the necessary DSN (data source name) on the server containing the database, and installing the necessary ODBC (open database connectivity) libraries on the web server. If either server is a Unix/Linux server, your chances for success drop even further. I'm thinking the only possibility of getting this to work is if both servers are Windows servers, and you have administrative access to both of them (or at least to the database server).I love a good problem, so I was researching this online some. I didn't find anyone who had actually done it, but these two resources are probably your best bet for a start if you really want to figure this out. The first is a Microsoft KB article that discusses how to do it with ASP, which will at least show you how to set up the database server, and the second is a Zend article on using ODBC with PHP. The Zend article has a lot of threaded user comments at the bottom, and it would probably be good to look through those and see if anyone was able to get this to work.http://support.microsoft.com/kb/q253580/http://www.zend.com/zend/tut/odbc.php?arti...d=t&id=4013Or, you can continue where I left off here:http://www.google.com/search?hs=KT2&hl...amp;btnG=Search

Link to comment
Share on other sites

Alright, to give you a little more insight about the problem, the DNS is already setup on the database server. I do have admin rights to both servers. I wasn't sure if it could be done with PHP or not, so I'll switch to ASP.What connection string do I use to connect to the other database with ASP (If that is easier...lol)?

Link to comment
Share on other sites

You might also want to try looking on sourceforge.net, the chances of them having a project devoted to converting an access database to another form like a MySQL database is pretty good, I imagine. It's where I've found a lot of useful PHP apps.
yar i kinda found 1 program but the prob is that it is a trialware and can only convert only the first 5 records of every table to mysql, lucky i could use phpadmin to quickly fill in the rest, hope your database isn't too bigif u want the program i could send it 2 u
Yeah...I'm completely confused since I never use ASP. Can anyone come up with some helpful connection code. Also, what is the file extension for an asp page? When I save it as .asp, it just displays the content of the file instead of the output code.
u could check w3schools, they have the connection code for access---aspyes .asp files are aspif a proper asp script isn't displaying, check whether the language used is correct and that the <% tag is used, also check if you have installed IIS
Link to comment
Share on other sites

ASP will only work reliably on Windows IIS. Depending on the version of IIS, ASP should be enabled by default. If you are using IIS and are still seeing ASP code when you browse to a page, then IIS is not set up to execute ASP. I believe that ASP is installed as either a CGI or ISAPI application, but you should be able to find the settings for it in the IIS admin utility.

Link to comment
Share on other sites

My Solution:Get MdbToMySQL XP, its a free program to convert the access database to MySQL queries, then run them on the server and tada! you've got a MySQL database easily compatible with PHP....Now say you want an ACCESS .mdb definitively, Yes you will have to use ASP as everyone else said, And if you tried running a .ASP script and all you got was the code, you haven't got IIS installed properly on the server you are running it on... If it's a separate domain try contacting your webhost, but if you own the domain, set up IIS as the previous reply says.Greetings,Miffe

Link to comment
Share on other sites

what version of IIS are you using.In IIS6 open up Control Panel > Administrative Tools > Internet Information ServicesNow expand the tree until you see Web Service Extensions (or something like that). Click it and to the right you should see a list of possible extensions to enable or disable.ASP is there by default and in IIS6 is "prohibited" be default. Click on the ASP extension then click Allow.From a fresh install that is all it took for me to get .asp pages running.I am not sure but would assume the process would be similar in IIS5

Link to comment
Share on other sites

The main problem here is that the Access database is on another server.
Well only if he is running PHP on a Linux server already. Sorry if I missed that but what are you using to run PHP? Windows or Linux/UNIX?If you are using Windows then the database and code can be on the same server (php runs fine on windows - doesnt it?).
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...