On 2009-07-17, Vijay Sankar <[email protected]> wrote:
> Abel Camarillo wrote:
>> On Fri, Jul 17, 2009 at 02:55:53PM -0500, Vijay Sankar wrote:
>>   
>>> I am trying to compile freetds-stable with iodbc and used the following
>>>
>>> env CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"  
>>> ./configure --with-iodbc --disable-threadsafe
>>>
>>> Even though isql.h is in /usr/local/include I get the error saying  
>>> isql.h not found.
>>>
>>> How can I resolve this? (I am trying to compile the source to see if I  
>>> can get libtdsodbc, so using the standard package will not work)
>>>
>>> Appreciate any clues.
>>>
>>> Thanks very much,
>>>
>>> Vijay
>>>
>>> -- 
>>> Vijay Sankar, M.Eng., P.Eng.
>>> ForeTell Technologies Limited
>>> 59 Flamingo Avenue, Winnipeg, MB, Canada R3J 0X6
>>> Phone: (204) 885-9535, E-Mail: [email protected]
>>>
>>>     
>>
>> I think that it will be a lot easier to change the port to reflect you
>> changes.
>>
>> try looking a the port and see what it does.
>>
>>   
> By changing the port I was able to get libtdsodbc (this was a few days 
> ago and I had sent the modified Makefile to misc@) but I had problems 
> setting up a DSN through iodbcadm (as well as through text files). Also, 
> when I tried to compile pyodbc, I got errors saying that -liodbc not 
> recognized. My sense is that I am missing some fundamental knowledge and 
> so this was just an attempt to learn as well as see if compiling from 
> source gives me any clues on setting up pyodbc or if there are any 
> changes with the newer freetds. I know this can work on other platforms 
> but if at all possible I want to stick with OpenBSD.
>
> Thanks,
>
> Vijay
>

since you have produced a libtdsodbc.so, try something like this.
it won't work with the in-tree port as things stand at the moment.

$ cat /etc/iodbc/odbc.ini                                  
[ODBC Data Sources]
MSSQL-asterisk = FreeTDS

[MSSQL-asterisk]
description         = Asterisk ODBC for MSSQL
driver              = FreeTDS
server              = blahblahblah
port                = 1433
database            = virtualreceptionist
tds_version         = 7.0
language            = us_english

$ cat /etc/iodbc/odbcinst.ini                              
[ODBC Drivers]
FreeTDS = Installed

[FreeTDS]
Driver = /usr/local/lib/libtdsodbc.so
Setup = /usr/local/lib/libtdsodbc.so

$ iodbctest 'DSN=MSSQL-asterisk;UID=sa;PWD=blahblahblah'
iODBC Demonstration program
This program shows an interactive SQL processor
Driver Manager: 03.52.0406.0126
Driver: 0.82 (libtdsodbc.so)

SQL>select @@VERSION;

                                                                                
                                                                                
                                                                                
                                                            
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Microsoft SQL Server  2000 - 8.00.2039 (Intel X86) 
        May  3 2005 23:18:38 
        Copyright (c) 1988-2003 Microsoft Corporation
        Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
                                                                                
                                 

 result set 1 returned 1 rows.


SQL>^D
Have a nice day.

DBI::Sybase is much easier to use, but this proves that you can get
ODBC/FreeTDS working on OpenBSD...

Reply via email to