[unixODBC-support] How to make unixODBC recognize my ODBC driver?
Villa Forlan
villaforlan at yahoo.com
Sat Jul 18 15:57:51 BST 2009
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?
Best regards,
Villa.
________________________________
From: Nick Gorham <nick at lurcher.org>
To: Support for the unixODBC project <unixodbc-support at mailman.unixodbc.org>
Sent: Saturday, July 18, 2009 6:21:35 PM
Subject: Re: [unixODBC-support] How to make unixODBC recognize my ODBC driver?
Villa Forlan wrote:
> Hi everyone,
>
> I developed a simple ODBC driver. I named it libmyodbcdriver.so. It is a light driver because it only supports a few ODBC functions which I really need, not all of those whose names listed at MSDN ODBC Programmer's Reference. I tested the driver by writing a C program which calls ODBC functions from the driver, and then when building the program I directly linked it to my driver libmyodbcdriver.so, and everything worked fine.
>
> And now I want to integrate my driver with an ODBC Driver Manager, such as unixODBC. I tried to register my driver with unixODBC via the ODBCConfig GUI but I failed. It seems that I have to add something to the library's code so that unixODBC can recognize it. Is there any document or tutorial for this?
>
> Thanks in advance!
If you just want it to show in ODBCConfig just look at the setup libs in the distributions, for example libtdsS.so But to work with unixODBC all it need to do is export the ODBC functions. I would guess SQLAllocHandle, SQLSetEnv, SQLConnect SQLGetFunctions would be the first to check.
-- 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/20090718/ab5f9c55/attachment.html>
More information about the unixODBC-support
mailing list