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

Nick Gorham nick at lurcher.org
Sat Jul 18 16:31:05 BST 2009


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


More information about the unixODBC-support mailing list