LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-22-2006, 01:44 PM   #31
gourav
LQ Newbie
 
Registered: Feb 2005
Location: USA
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15

Hi nidhi,

I am doing fine.
hey write ur previous freetds.conf into /usr/local/etc/freetds.conf
and try ur program.
Also u can bypass unixodbc by using tdsodbc driver directly during linking.
g++ -I<otl_include_path> ur_program.cpp -o ur_program -ltdsodbc
But first run using odbc with freetds.conf in /usr/local/etc/
and then try using tdsodbc.

Try this and let me know.

regards
Gourav
 
Old 07-22-2006, 01:53 PM   #32
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
Hi Gaurav,

thanks, today i tried running the program with ltdsodbc but i was throwing lots of error at the of compilation.

i will try the above method also, freetds.conf file is in /usr/local/etc.

Nidhi
 
Old 07-23-2006, 11:45 PM   #33
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
hi Gaurav,

Hope you had a nice weekend.

I am in the office now, if it is possible for you we can chat on messenger.

Thanks,
Nidhi
 
Old 07-24-2006, 01:50 AM   #34
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
Hi Gaurav,

Thanks for all your support.

I was online but some how problem was in messenger.

I am sending u all the files

Please check and let me know

freetds.conf

#
#
# $Id: freetds.conf,v 1.5 2002/08/24 16:31:17 freddy77 Exp $
#
# The freetds.conf file is a replacement for the original interfaces
# file developed by Sybase. You may use either this or the interfaces
# file, but not both.
#
# FreeTDS will search for a conf file in the following order:
#
# 1) check if a file was set programatically via dbsetifile() and
# is in .conf format, if so use that,
#
# 2) otherwise, if env variable FREETDSCONF specifies a properly
# formatted config file, use it,
#
# 3) otherwise, look in ~/.freetds.conf,
#
# 4) otherwise, look in @sysconfdir@/freetds.conf
#
# If FreeTDS has found no suitable conf file it will then search for
# an interfaces file in the following order:
#
# 1) check if a file was set programatically via dbsetifile() and
# is in interfaces format, if so use that,
#
# 2) look in ~/.interfaces
#
# 3) look in $SYBASE/interfaces (where $SYBASE is an environment
# variable)
#
# Only hostname, port number, and protocol version can be specified
# using the interfaces format.
#
# The conf file format follows a modified Samba style layout. There
# is a [global] section which will affect all database servers and
# basic program behaviour, and a section headed with the database
# server's name which will have settings which override the global
# ones.
#
# Note that environment variables TDSVER, TDSDUMP, TDSPORT, TDSQUERY,
# and TDSHOST will override values set by a .conf or .interfaces file.
#
# To review the processing of the above, set env variable TDSDUMPCONFIG
# to a file name to log configuration processing.
#
# Global settings, any value here may be overridden by a database
# server specific section
[global]
# TDS protocol version
tds version = 4.2

initial block size = 512

swap broken dates = no

swap broken money = no

# Database server login method, if both server and domain
# logins are enabled, domain login is tried first if a domain
# is specified, and if that fails the server login will be used.
try server login = yes
try domain login = no

# The default authentication domain, can be overridden by
# specifying a username with a domain prefix, e.g. DOMAIN\username
; nt domain = WORKGROUP

# If the server responds with different domain try that one?
cross domain login = no

# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
; dump file = /tmp/freetds.log
; debug level = 10

# Command and connection timeouts
; timeout = 10;
; connect timeout = 10;

# This is a Sybase hosted database server, if you are directly on the
# net you can use it to test.
[JDBC]
host = 192.138.151.39
port = 4444
tds version = 5.0

# A typical Microsoft SQL Server 7.0 configuration
[TDS]
host =192.168.1.54
port = 1433
tds version = 7.0

# If you get out of memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# (Microsoft servers sometimes pretend TEXT columns are
# 4 GB wide!) If you have this problem, try setting
# 'text size' to a more reasonable limit

# text size = 8096

# A typical Microsoft SQL Server 7.0 configuration using domain logins
;[MyServer70]
; host = ntmachine.domain.com
; port = 1433
; tds version = 7.0
; try domain login = yes
; try server login = no
; nt domain = MYDOMAIN

# A typical Microsoft SQL Server 6.x configuration
;[MyServer65]
; host = ntmachine.domain.com
; port = 1433
; tds version = 4.2
;[TDS]
; host = 192.168.1.51
; port = 1433
; tds version = 7.0
; try domain login = yes
; try server login = no


odbc.ini

[ODBC Data Sources]

[MSSQLServer]
Description = TDS MSSQL
Driver = TDS
Servername = 192.168.1.54
Database = DigitalkDB
UID = sa
PWD = nidhi
Port = 1433

odbcinst.ini
[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/libodbcpsql.so
Setup = /usr/lib/libodbcpsqlS.so
FileUsage = 1

[demo]
Driver = OOB
Description = Easysoft ODBC-ODBC Bridge demo data source
SERVERPORT = demo.easysoft.com:8888
TARGETDSN = pubs
LOGONUSER = demo
LOGONAUTH = easysoft
TargetUser = demo
TargetAuth = easysoft
FileUsage = 1

[OOB]
Description = Easysoft ODBC-ODBC Bridge
Driver = /usr/local/easysoft/oob/client/libesoobclient.so
Setup = /usr/local/easysoft/oob/client/libesoobsetup.so
FileUsage = 1

[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc.so
FileUsage = 1

[TDS]
Description = v0.60 with protocol v7.0
Driver = /usr/local/lib/libtdsodbc.so
Setup = /usr/lib/libtdsS.so
FileUsage = 1
CPTimeout =
CPReuse =


Thanks,
Nidhi
 
Old 07-25-2006, 12:16 AM   #35
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
hi Gaurav,

did you get a chance to look into the things.yesterday i installed unixodbc and freetds on new server, but facing same problem.
If you can send me the steps of the installation which you followed that will be a real help.

Thanks,
Nidhi
 
Old 07-29-2006, 09:31 PM   #36
gourav
LQ Newbie
 
Registered: Feb 2005
Location: USA
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15
hi nidhi,

how are you? i am fine.
install unixodbc and freetds in /usr/local
add /usr/local/lib to LD_LIBRARY_PATH.
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
You can add this to your startup script.

Also in your odbc.ini change Servername to TDS i.e Servername = TDS.

try this and let me know.

regards
gourav
 
Old 07-30-2006, 02:06 PM   #37
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
Hi Gaurav,

Thanks, i will try these settings tomorrow morning and let you know the result.

Thanks,
Nidhi
 
Old 07-31-2006, 12:59 AM   #38
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
Hi Gaurav,

How are you doing?

I am doing good.I tried setting the path and driver but still getting the same problem.

I am pasting the error below.Right now i am online if it is possible for you we can chat.

[root@developmentserver home]# g++ -I/usr/local/include test11.cpp -o test11 -L /usr/local/lib -ltdsodbc
/tmp/cc63DQFe.o(.gnu.linkonce.t._ZN7otl_cur4openER8otl_conn+0x76): In function `otl_cur:pen(otl_conn&)':
: undefined reference to `SQLSetStmtAttr'
/tmp/cc63DQFe.o(.gnu.linkonce.t._ZN7otl_cur4openER8otl_conn+0xb9): In function `otl_cur:pen(otl_conn&)':
: undefined reference to `SQLSetStmtAttr'
/tmp/cc63DQFe.o(.gnu.linkonce.t._ZN7otl_cur4execEii+0x44): In function `otl_cur::exec(int, int)':
: undefined reference to `SQLSetStmtAttr'
/tmp/cc63DQFe.o(.gnu.linkonce.t._ZN7otl_cur5errorER7otl_exc+0x39): In function `otl_cur::error(otl_exc&)':
: undefined reference to `SQLGetDiagRec'
/tmp/cc63DQFe.o(.gnu.linkonce.t._ZN8otl_conn6rlogonEPKci+0x5d1): In function `otl_conn::rlogon(char const*, int)':
: undefined reference to `SQLSetConnectAttr'
/tmp/cc63DQFe.o(.gnu.linkonce.t._ZN8otl_conn6rlogonEPKci+0x5ee): In function `otl_conn::rlogon(char const*, int)':
: undefined reference to `SQLSetConnectAttr'
/tmp/cc63DQFe.o(.gnu.linkonce.t._ZN8otl_conn6rlogonEPKci+0x637): In function `otl_conn::rlogon(char const*, int)':
: undefined reference to `SQLSetConnectAttr'
/tmp/cc63DQFe.o(.gnu.linkonce.t._ZN8otl_conn5errorER7otl_exc+0x39): In function `otl_conn::error(otl_exc&)':
: undefined reference to `SQLGetDiagRec'
/tmp/cc63DQFe.o(.gnu.linkonce.t._ZN8otl_conn6commitEv+0x18): In function `otl_conn::commit()':
: undefined reference to `SQLEndTran'
/tmp/cc63DQFe.o(.gnu.linkonce.t._ZN7otl_sel5firstER7otl_curRiS2_S2_S2_i+0x2a): In function `otl_sel::first(otl_cur&, int&, int&, int&, int&, int)':
: undefined reference to `SQLSetStmtAttr'
/tmp/cc63DQFe.o(.gnu.linkonce.t._ZN7otl_sel5firstER7otl_curRiS2_S2_S2_i+0x7d): In function `otl_sel::first(otl_cur&, int&, int&, int&, int&, int)':
: undefined reference to `SQLSetStmtAttr'
/tmp/cc63DQFe.o(.gnu.linkonce.t._ZN7otl_sel5firstER7otl_curRiS2_S2_S2_i+0x120): In function `otl_sel::first(otl_cur&, int&, int&, int&, int&, int)':
: undefined reference to `SQLFetchScroll'
/tmp/cc63DQFe.o(.gnu.linkonce.t._ZN7otl_sel4nextER7otl_curRiS2_S2_S2_i+0x95): In function `otl_sel::next(otl_cur&, int&, int&, int&, int&, int)':
: undefined reference to `SQLFetchScroll'


thanks for all your help.

Nidhi
 
Old 07-31-2006, 09:18 AM   #39
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
Hi Gaurav,

there is a library linkage problem.I dont know why its happening.I installed all the things on a fresh server so that there should not be any problem.

Does freetds-0.60 supports `SQLGetDiagRec'and other SQL functions.

Do i need to install other version of freetds or any other otlv4.h file should i use.

Thanks,
Nidhi
 
Old 07-31-2006, 02:04 PM   #40
gourav
LQ Newbie
 
Registered: Feb 2005
Location: USA
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15
Hi nidhi,

just check if libodbc.so and libtdsodbc.so are present in /usr/lib.
Also, run ldconfig once.

please do this and let me know the result.

regards
Gourav
 
Old 07-31-2006, 02:11 PM   #41
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
Hi Gaurav,

libtdsodbc.so this file is in /usr/local/lib directory.

I will run the command tomm morning as i dont have local server access at home and let you know.

Regards,
Nidhi
 
Old 08-01-2006, 06:37 AM   #42
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
Good morning Gaurav,

how are you doing?

I executed the ldconfig command.but no effect it still giving the error.

I commented everything in the program except the line where we are creating the object
"otl_connect db; // connect object"

but this also fails.error is
[root@developmentserver home]# g++ -I/usr/local/include test11.cpp -o test11 -L/usr/local/lib -ltdsodbc
/tmp/ccLIFv0J.o(.gnu.linkonce.t._ZN8otl_conn5errorER7otl_exc+0x39): In function `otl_conn::error(otl_exc&)':
: undefined reference to `SQLGetDiagRec'
/tmp/ccLIFv0J.o(.gnu.linkonce.t._ZN8otl_conn6commitEv+0x18): In function `otl_conn::commit()':
: undefined reference to `SQLEndTran'
collect2: ld returned 1 exit status
[root@developmentserver home]#

Please let me know of we can talk on messenger anytime.

Thanks,
 
Old 08-01-2006, 03:51 PM   #43
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
Hi Gaurav,

Thanks a lot for all your help.

Today i installed latest version of freetds and unixodbc on my live server.In the first attempt i am able to connect to database throuh C++.

Once again thanks a million.you help me a lot in solving the problem.

take care
cheers,

Nidhi
 
Old 08-01-2006, 07:29 PM   #44
gourav
LQ Newbie
 
Registered: Feb 2005
Location: USA
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15
hi nidhi,

i am happy that the problem got solved.
But i am still curious about the solution.
Was it coz of version conflict between freetds and unixodbc?
I think that was the problem.
Did you try latest version of both on the first computer?

hey, i helped you during the problem solving process. but
i dont think the problem got solved with my help.

Anyway its a good news.
and your welcome for the thanks.

best of luck for future..
take care
Gourav
 
Old 08-02-2006, 02:17 AM   #45
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
Hi Gaurav,

yes the problem was because of freetds version and unixodbc version.

I was using freetd-0.60 which was not supporting MSSql 2000.I installed latest version of freetds-0.64 on the fresh machine and it works in first attempt.

you really help me in solving it trust me.

keep in touch.it was nice talking to u on that day.


All the best.

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 04:40 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