hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : dsnless connection on an Apache Server
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

dsnless connection on an Apache Server

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 04-06-2005, 07:47 AM
shovels shovels is offline
New Member
 
Join Date: Apr 2005
Posts: 3

dsnless connection on an Apache Server


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.

Reply With Quote


Sponsored Links
  #2  
Old 04-07-2005, 02:42 AM
Burhan Burhan is offline
Community Guide
 
Join Date: Jul 2003
Location: Kuwait
Posts: 5,100
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
mdbtools (and the mdbtools ODBC driver)

Configure unixodbc by adding mdbtools to it. To do this, create a blank file :

Code:
[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) :

Code:
odbcinst -i -d -f configuration.file
Setup the DSN in /etc/odbc.ini :

Code:
[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 :
PHP Code:
$conn odbc_connect("DNS-NAME","",""); 
Hope this helps, and welcome to WHT

__________________
In order to understand recursion, one must first understand recursion.
If you feel like it, you can read my blog
Signal > Noise

Reply With Quote
  #3  
Old 04-07-2005, 04:01 AM
shovels shovels is offline
New Member
 
Join Date: Apr 2005
Posts: 3
Quote:
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?

Reply With Quote
Sponsored Links
  #4  
Old 04-07-2005, 04:32 AM
Burhan Burhan is offline
Community Guide
 
Join Date: Jul 2003
Location: Kuwait
Posts: 5,100
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 (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.

__________________
In order to understand recursion, one must first understand recursion.
If you feel like it, you can read my blog
Signal > Noise

Reply With Quote
  #5  
Old 04-07-2005, 04:42 AM
shovels shovels is offline
New Member
 
Join Date: Apr 2005
Posts: 3
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.

Reply With Quote
  #6  
Old 04-07-2005, 07:38 PM
insanelymacintosh insanelymacintosh is offline
WHT Addict
 
Join Date: Mar 2005
Location: Hattiesburg, MS
Posts: 159
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.

__________________
InsanelyMacintosh - Macintosh Software Repository Listings

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Researchers Urge System Admins to Check for New Apache Web Server Backdoor Malware Web Hosting News 2013-05-01 11:35:53
nginx Sees Largest Market Share Growth in Netcraft March Server Survey Web Hosting News 2012-03-05 14:05:29
Apache Web Server Adds Cloud Capabilities with First Major Update in 5 Years Web Hosting News 2012-02-21 16:05:02
Oracle is the Latest Vendor to Apply Patch for Apache Killer Flaw Web Hosting News 2011-09-19 14:43:58
Patch Released for Apache Software DDoS Vulnerability Web Hosting News 2011-08-26 15:03:10


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?