LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-17-2006, 10:22 AM   #16
gourav
LQ Newbie
 
Registered: Feb 2005
Location: USA
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15

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
 
Old 07-17-2006, 10:28 AM   #17
gourav
LQ Newbie
 
Registered: Feb 2005
Location: USA
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15
hi nidhi,

use OTL_ODBC_UNIX as you are using unixODBC and then compile your code.

Gourav
 
Old 07-17-2006, 10:36 AM   #18
gourav
LQ Newbie
 
Registered: Feb 2005
Location: USA
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15
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
 
Old 07-18-2006, 02:53 AM   #19
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
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
 
Old 07-18-2006, 12:16 PM   #20
gourav
LQ Newbie
 
Registered: Feb 2005
Location: USA
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15
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
 
Old 07-18-2006, 02:49 PM   #21
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
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
 
Old 07-18-2006, 09:48 PM   #22
gourav
LQ Newbie
 
Registered: Feb 2005
Location: USA
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15
hi nidhi,

i am doing good.
How are you?

my yahoo id is "gdtilve"


Gourav
 
Old 07-19-2006, 06:26 AM   #23
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
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
 
Old 07-19-2006, 12:07 PM   #24
gourav
LQ Newbie
 
Registered: Feb 2005
Location: USA
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15
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
 
Old 07-19-2006, 02:18 PM   #25
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
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
 
Old 07-20-2006, 05:57 PM   #26
gourav
LQ Newbie
 
Registered: Feb 2005
Location: USA
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15
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
 
Old 07-21-2006, 02:43 AM   #27
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
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
 
Old 07-21-2006, 01:46 PM   #28
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
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
 
Old 07-21-2006, 02:40 PM   #29
gourav
LQ Newbie
 
Registered: Feb 2005
Location: USA
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15
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
 
Old 07-22-2006, 12:18 AM   #30
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a database manager for linux that is compatable with M$ Access and SQL? enigma Z Linux - Software 2 08-27-2004 08:50 PM
SQL Server 2000 assatron Linux - Software 4 08-19-2004 03:02 PM
Mergeant 0.12.1 & SQL 2000 Modify Linux - Software 0 12-29-2003 04:27 AM
Connecting to Microsoft SQL Server 2000 sput Linux - Distributions 7 08-25-2003 09:06 PM
PHP and MS SQL Server 2000 balfred Programming 0 03-24-2003 03:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration