Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: - dsn-less connections?: msg#00050

db.unixodbc.devel

Subject: Re: - dsn-less connections?

Liam Hoekenga wrote:
I'm trying to get PHP working with UnixODBC w/ DSN-less connection strings. Acc'd to the information I've found, it looks like that's at least partially dependent on the ODBC manager. I'm not overly familiar with ODBC, so it's completely possible that I'm doing things wrong..

The PHP website has an example of a DSN-less connection string, which I /think/ is probably meant for a windows box...

DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=/path/to/file.mdb

I'm guessing that "Microsoft Access Driver..." is maybe the section header from odbcinst.ini, but that doesn't appear to be the case. My odbcinst.ini looks like:

[MSAccess]
Description = Read only access to MS Access files
Driver = /usr/local/mdbtools/lib/libmdbodbc.so
FileUsage = 1

My odbc.ini looks like...

[Northwind]
Description = Northwind Sample Database
Driver = /usr/local/mdbtools/lib/libmdbodbc.so
Database = /home/liamr/Northwind.mdb

And I can connect find to the datasource I set up in odbc.ini using the DSN...

$db = odbc_connect( "Northwind", '', '' );

but I can't connect w/ the DSN-less connection string - in addition to the one I pasted above, I've tried..

DRIVER={MSAccess}; DBQ=/path/to/file.mdb
DRIVER= /usr/local/mdbtools/lib/libmdbodbc.so; DBQ=/path/to/file.mdb

Is it even possible to do what I'm trying to do? Suggestions on how it might be done?

Yes its possible, the DRIVER={MSAccess};DBQ= should work but its also down to the driver understanding whats going on.

I would hack the code in isql.c to change the SQLConnect to a SQLDriverConnect, hard code the above string, then look at the strace output to see if its loading the driver, if it is it may be because the driver doesn't understand DSN-less connection strings.

--
Nick Gorham

Easysoft Limited
Thorp Arch Grange
Thorp Arch
Wetherby
United Kingdom
LS23 7BA

Telephone : +44 1937 860000
Fax: +44 1937 860001
Website: www.easysoft.com




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
hardware.arm.at...    cms.citadel.dev...    video.gstreamer...    java.facelets.u...    misc.basics.qna...    web.wiki.instik...    network.uip.use...    xdg.devel/2003-...    tex.bibtex.bibd...    finance.quotesp...    ietf.zeroconf/2...    redhat.blinux.g...    suse.db2/2003-0...    php.phpesp/2004...    uml.devel/2003-...    gnome.labyrinth...    qnx.openqnx.dev...    boot-loaders.gr...    db.dataperfect....    audio.audacity....    linux.uclinux.m...    editors.j.devel...    os.openbsd.tech...    kde.users.multi...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation