The main problem is that you have built a .dylib which cannot be dynamically
loaded by unixODBC or iODBC with dlopen(). It should be a .so (you need the cc
bundle command to product .so files). Apparently there is a README for MySQL
and MAC OSX somewhere that will tell you how to do this.

In addition, you need to remember what you set --sysconfdir to when you
configured unixODBC (if you didn't set it then it defaults to /usr/local/etc).
unixODBC will look in --sysconfdir for the system DSNs.

Also, when running ODBC applications make sure you have set DYLD_LIBRARY_PATH
to point to where the unixODBC driver manager libs are (or that you have copied
them into a system library dir).

Martin
-- 
Martin J. Evans
Easysoft Ltd, UK
Development

On 06-Mar-2003 Chris Hinrichs wrote:
> Hi,
> 
> Maybe there's someone here who can help answer this...
> 
> If so Thanks in Advance
> -Chris
> 
> Begin forwarded message:
> 
>> From: Chris Hinrichs <[EMAIL PROTECTED]>
>> Date: Thu Mar 6, 2003  10:44:29 AM America/Chicago
>> To: [EMAIL PROTECTED]
>> Subject: MyODBC, DBD::ODBC
>>
>> Hi,
>>
>> I'm looking for causes as to why isql gives the following error:
>>
>> [izzy:/usr/lib] chris# isql -v myodbc3
>> [unixODBC][Driver Manager]Data source name not found, and no default 
>> driver specified
>> [ISQL]ERROR: Could not SQLConnect
>> ++++++++
>> Here's the background:
>> I'm running MacOS 10.2, and I need to connect to a TSM server via 
>> ODBC, and I want to do that with DBD::ODBC via perl. But before I can 
>> do that I need to get unixODBC/MyODBC working.
>>
>> Before, I tried installing iODBC, and I did get odbctest, (iODBC's 
>> version of isql) to work with that. However when I installed unixodbc, 
>> and subsequently recompiled MyODBC to use unixODBC, iODBC's odbctest 
>> stopped working, (As you would expect,) but interestingly it stopped 
>> working in such a way that it gave the exact same error message:
>>
>> [izzy:/usr/lib] chris# odbctest DSN=myodbc3
>> iODBC Demonstration program
>> This program shows an interactive SQL processor
>> [iODBC][Driver Manager]Data source name not found and no default 
>> driver specified. Driver could not be loaded, SQLSTATE=IM002
>> ++++++
>> I guess the similarity in error messages is because it's defined in 
>> the ODBC protocol itself...(?)
>>
>> Now the problem I am having is that the above error message coming 
>> from isql looks like it can't find the odbc.ini file, because it says 
>> it can't find a default, instead of complaining about it being 
>> malformed, or the lib file not being recognizable. I put the exact 
>> same copy of odbc.ini in /etc, ~root, (I'm running as root for the 
>> time being,) and in ~root/Library/ODBC. I tried setting the ODBCINI 
>> and ODBCSYSINI environment variables, but that had no effect.
>>
>> Here is my odbc.ini file:
>>
>> [myodbc3]
>> Driver       = /usr/lib/libmyodbc3.dylib
>> Description  = MySQL ODBC 3.51 Driver DSN
>> SERVER       = localhost
>> PORT         = 3306
>> USER         = root
>> Password     = raboof
>> Database     = test
>> OPTION       = 3
>> SOCKET       =
>>
>>
>> [Default]
>> Driver       = /usr/lib/libmyodbc3.dylib
>> Description  = MySQL ODBC 3.51 Driver DSN
>> SERVER       = localhost
>> PORT         = 3306
>> USER         = root
>> Password     = raboof
>> Database     = test
>> OPTION       = 3
>> SOCKET       =
>>
>> ++++++++
>>
>> I am also wondering if odbcinst.ini has anything to do with it at 
>> all...
>>
>>
>> Any advice at all is greatly appreciated. I've been banging my head 
>> against this for over 3 weeks now, and I'd like to find some answers.
>>
>> Chris Hinrichs
>>

Reply via email to