Hi nidhi,
Try using ODBC only configuration i.e changing "Servername" to "Server" and "mssql" to "192.168.1.54" in your [mssql] dsn( ODBC-freeTDS configuration )as shown below and try running your program. ---odbc.ini --- [mssql] Description = TDSDriver Driver = TDSDriver Server = 192.168.1.54 Database = DigitalkDB UID = sa PWD = nidhi Port = 1433 Gourav |
hi nidhi,
use OTL_ODBC_UNIX as you are using unixODBC and then compile your code. Gourav |
hi nidhi,
In my previous mesg I forgot to mention. Use both OTL_ODBC and OTL_ODBC_UNIX #include <stdio.h> #define OTL_ODBC // Compile OTL 4.0/ODBC #define OTL_ODBC_UNIX #include <otlv4.h> // include the OTL 4.0 header file ................. .............. Gourav |
thanks for the help Gaurav, i tried every seting which u have mentioned but still its giving me the same error.
should i reinstall unixODBC package. Nidhi |
hi nidhi,
did u try tsql? try if its connnecting using tsql. After that try re-installing freeTDS and configure it for unixODBC. Check the flags.. http://www.unixodbc.org/doc/FreeTDS.html # ./configure --with-tdsver=7.0 --with-unixodbc=/usr/local <- give necessary path # make # make install Cheers Gourav |
Hi Gaurav,
how are you doing? thanks, I tried tsql and it was connected to database. I installed freetds support with unixodbc, but will reinstall it tomorrow. Hey your yahoo id is not working everytime messenger gives error. Regards, Nidhi |
hi nidhi,
i am doing good. How are you? my yahoo id is "gdtilve" Gourav |
Hi gaurav,
I reconfigured freetds but no effect on program. even dsn has stoped working with isql :( Is there is another way i can connect mssql through C++ Nidhi |
hi nidhi,
dont worry. Just give the correct path for TDS driver in odbc config. Coz you have reinstalled (may be with a diff path) check the odbc.ini and odbcinst.ini and make sure if the path for tds driver is correct. Also, i think why ur C++ program is not running is, your are using libodbc.so. Use libtdsodbc.so during linking. g++ -I<necessary path> sample.cpp -o sample -L<tds_lib path> -ltdsodbc try the above and let me know. Cheers Gourav |
Hi Gaurav,
thanks, i solved the issue of isql today. today i installed unixODBC-2.2.11 on the server, after compiling the C++ program the poutput was like [unixODBC]: uid=sa;pwd=nidhi;dsn=mssql I dont understand why its giving the connection string in the output. i will execute the program according to your mentioned way.lets see. Regards, Nidhi |
hey,
i got your problem. Plz tell me,How you have installed freeTDS and unixODBC? Can you please let me know your installed paths i.e what path you have configured during the installation process of both? EX: /usr/local which is the default path Cheers Gourav |
Hi Gaurav,
I installed uniODBC through a package and when i fire odbcinst -j commnad unixODBC 2.2.11 DRIVERS............: /usr/local/etc/odbcinst.ini SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini USER DATA SOURCES..: /root/.odbc.ini Path for freetds i didnt specified any prefix at the time of installing it, its installed at its default path i.e /usr/local/freetds/ Thanks, Nidhi |
Good Morning Gaurav,
How are you doing? I added you on my messenger, if possible for you can we chat on messenger tomorrow anytime.i think through chat we will be able to solve the issue in faster. Thanks, Nidhi |
hi nidhi,
I am doing good. How about you? okay copy paste your previous(old config) odbc.ini and odbcinst.ini to /usr/local/etc/. hey I installed freeTDS without any prefix and the default installation path was /usr/local/. A freeTDS directory is not created in /usr/local/. Please tell me where are you untarring freeTDS. Are you untarring in /usr/local/freeTDS and then installing from within that directory? Coz default freeTDS conf file was in /usr/local/etc/freetds.conf in my case. Please check it and let me know. hey nidhi theres almost 12:00 hours difference in india's timing and the timing in the place where i am in. (USA). So i think , now when i am writing this mesg it will be around 1:00 am (Saturday) there in India, as its 1:00 pm here (Friday). We can chat maybe on Monday at 10:00 am indian time (10:30 pm Sunday here). In that way you will most probably be in office and be able try the different configurations. Let me know. regards Gourav |
Hi Gaurav,
how are you? I am doing good, thanks. Yes that is fine with me, we can chat on Monday morning (my time). Freetds is installed in /usr/local/freetds directory on my server. I have 3 freetds.conf files in different directories /etc/freetds.conf /usr/local/etc/freetds.conf /usr/local/freetds/etc/freetds.conf Regards, Nidhi |
All times are GMT -5. The time now is 08:38 AM. |