shovels
04-06-2005, 07:47 AM
As per the title,
I am trying to find out if it possible to have an access database on an Apache server and connect to it using a DSN-less connection?
A few of our larger sites used to use a DSN connection on a Windows Server, but now it's on Apache, it's not an option.
I don't really fancy having to re-write all the databases into MySQL.
Burhan
04-07-2005, 02:42 AM
It is possible, but you will need to install a few tools onto your server. I'm assuming here that you are using PHP as the programming language.
I'll highlight the steps needed to setup the DSN connection, so you can port the scripts with minimal changes. Note that the driver support is not the same as in Windows, so some advanced functionality might be unavilable. Check the webpages of the drivers for more information.
After you have setup PHP (with unixodbc support) and Apache, download and install for your distribution :
unixodbc (http://www.unixodbc.org/)
mdbtools (http://mdbtools.sourceforge.net/) (and the mdbtools ODBC driver)
Configure unixodbc by adding mdbtools to it. To do this, create a blank file :
[MDBToolsODBC]
Description = MDB Tools ODBC drivers
Driver = /path/to/libmdbodbc.so.0
Setup =
FileUsage = 1
CPTimeout =
CPReuse =
Install the driver into unixodbc (using the file above) :
odbcinst -i -d -f configuration.file
Setup the DSN in /etc/odbc.ini :
[DNS-NAME]
Description = Microsoft Access Database
Driver = MDBToolsODBC
Database = /path/to/file.mdb
Servername = localhost
UserName =
Password =
port = 5432
That's it. Now you can test the connection :
$conn = odbc_connect("DNS-NAME","","");
Hope this helps, and welcome to WHT :)
shovels
04-07-2005, 04:01 AM
Originally posted by fyrestrtr
It is possible, but you will need to install a few tools onto your server. I'm assuming here that you are using PHP as the programming language.
Thanks fyrestrtr for your advice. The sites are currently written in ASP. Sorry, should have mentioned that at the start.
Does this complicate things more - Make it impossible?
Burhan
04-07-2005, 04:32 AM
You are moving ASP sites to an Apache server? Ouch. If you intend to keep the sites as ASP, you will need to install some sort of ASP engine in Apache. The only one I know of is ChilliSoft ASP (http://wwws.sun.com/software/chilisoft/) (now acquired by Sun), but its not free, and it doesn't compare to the functionality of ASP on Windows.
My suggestion -- migrate your sites to PHP, PERL, Python or some other non-Windows language if you want the best perfomance.
You didn't mention if you moved from Windows to Linux/Unix or did you just change from IIS to Apache.
shovels
04-07-2005, 04:42 AM
We're moving servers. Our current servers are Windows and the new servers are all Linux running Apache. It's a real head-ache of a job!
Thanks for all your help.
insanelymacintosh
04-07-2005, 07:38 PM
Microsoft didn't make a version of ASP to run on Linux so you have two choices. Either run ChilliSoft ASP (which I would not recommend) or re-code ALL of your ASP code in PHP (which will be a lot of work).
Sounds like you might be better off staying with a Microsoft server IMO.