[unixODBC-support] How to make unixODBC recognize my ODBC driver?

Villa Forlan villaforlan at yahoo.com
Mon Jul 20 14:38:15 BST 2009


Thank you for your answer, Nick!

Well, it's true that I need to read much more to write shared libraries. However, we all know that shared libraries in Linux do not have to export functions like the ones in Windows do. Instead, all of the functions inside a shared library in Linux can be called from the outside world, without its writer having to do any extra work. Thus I still don't get the point of 'export the ODBC functions' you said above. Could you please help me to clarify this? Any of your answers would be appreciated.

Another thing I want to report to you is that, after adding the function ODBCINSTGetProperties into my library's source code, I was able to create and configure DSNs in ODBCConfig using my library. However, I still could not connect to it via the isql command. It stills threw me a 'Segmentation fault' error. 




________________________________
From: Nick Gorham <nick at lurcher.org>
To: Support for the unixODBC project <unixodbc-support at mailman.unixodbc.org>
Sent: Saturday, July 18, 2009 10:31:05 PM
Subject: Re: [unixODBC-support] How to make unixODBC recognize my ODBC driver?

Villa Forlan wrote:
> Thank you for your answer. But I am just a newbie and therefore I have some more questions.
> 
> Well, since I am the person who writes the driver, what I want to know is how to make unixODBC 'see' my driver?
> 
> Let me explain my question more clearly. I want my driver to be seen by unixODBC so that when I use the isql command I can connect to a database file through my driver, just like other ODBC drivers. For example, when I used isql with the MySQL ODBC driver, I connected successfully. But when I tried it with my driver, it simply threw a "Segmentation fault" error message.
> 
> As you suggested, one of the first things needed to be done is export my functions such as SQLAllocHandle, SQLConnect, etc. But how can I do that? Does the identifier SQL_API have anything to do with exporting functions? 
> After reading some articles at MSDN and your previous answer, it seems that I have to write some setup functions, and these functions can be put right into the library, so I don't have to write another library for setup purpose (because I want to keep things as simple as possible). Could you please give me some information about these functions so that I can write my own ones?
> 
If you look in the unixODBC distrib there are a couple of sample drivers.That should show what needs doing. Its basically a shared lib the exposes the SQL ODBC API.

The SQL_API is windows only, its not related to exporting functions. You just need to read up on writing shared libraries.

-- Nick
_______________________________________________
unixODBC-support mailing list
unixODBC-support at mailman.unixodbc.org
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20090720/a6c0addd/attachment.html>


More information about the unixODBC-support mailing list