LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 08-02-2006, 10:58 PM   #46
gourav
LQ Newbie
 
Registered: Feb 2005
Location: USA
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15

hi nidhi,

it was nice talking with you too.

I'l try to remain in touch.

take care
regards
Gourav
 
Old 08-03-2006, 08:29 AM   #47
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
Hi Gaurav,
How are you doing?

I am again stuckup with the things .

Now i want to access mysql database which is on linux server but in the same program.

I installed myodbc driver also and created a dsn.Checked the connectivity with isql and i am able to connect to mysql.But in C++ program after compliation it gives following error:

"[FreeTDS][SQL Server]Unable to connect to data source
"

do i need to recompile freetds so that it support mysql?

Thanks,
Nidhi
 
Old 08-03-2006, 09:49 AM   #48
gourav
LQ Newbie
 
Registered: Feb 2005
Location: USA
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15
hi nidhi,

why are you using freetds for mysql?
you can use the myodbc driver.
please show me odbc.ini and odbcinst.ini for mysql data source?

regards
Gourav
 
Old 08-03-2006, 01:05 PM   #49
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
Hi Gaurav,

Iinstalled myodbc-3.51.10 on linux.

odbc.ini file is

[FIAT]
Driver = TDS
Description = ODBC connection via FreeTDS
Trace = Yes
TraceFile = /tmp/sql.log
ServerName = MYFIAT
Database = anylinux
Port = 1433

[MySql65]
Driver = MYTDS
Description = ODBC connection via FreeTDS
Trace = Yes
TraceFile = /tmp/mysql.log
ServerName = 65.182.161.193
Database = agent
Port = 3306
o

odbcisnt.ini


[TDS]
Description = FreeTDS
Driver = /usr/local/lib/libtdsodbc.so
Setup = /usr/local/lib/libtdsS.so.1
UsageCount = 1
[MYTDS]
Description = ODBC Driver for MySQL
Driver = /usr/local/lib/libmyodbc3.so
Setup = /usr/local/lib/libodbcmyS.so
FileUsage = 1

~

I want to use both the database in one program.I think otlv4.h prvide support for both type of database.

Thanks,
Nidhi
 
Old 08-03-2006, 02:31 PM   #50
gourav
LQ Newbie
 
Registered: Feb 2005
Location: USA
Distribution: Debian
Posts: 22

Original Poster
Rep: Reputation: 15
hi nidhi,

In odbc.ini instead of Servername use Server as shown below.

odbc.ini..
.............
.....
[MySql65]
Driver = MYTDS
Description = ODBC connection via FreeTDS
Trace = Yes
TraceFile = /tmp/mysql.log
Server = 65.182.161.193
Database = agent
Port = 3306
User = add valid username here


Nidhi, FreeTDS is a set of libraries for Unix and Linux that allows your programs to natively talk to Microsoft SQL Server and Sybase databases. http://www.freetds.org


and also while compiling link odbc library not tdsodbc.
Ex: gcc -I<whatever_path> your_program.cpp -o your_program -L<lib_path> -lodbc


try this and let me know.

regards
Gourav
 
Old 08-03-2006, 02:57 PM   #51
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
Hi Gaurav,

Thanks its working now, i am able to connect both the database in one progrm.

Hurray!!!!!!!!!!!!!!!

Thanks a lot.
Take care,
Nidhi
 
Old 08-14-2006, 09:03 AM   #52
nidhi
Member
 
Registered: Mar 2005
Posts: 30

Rep: Reputation: 15
hi Gaurav,

how are you doing?

Have u ever tried executing the mssql stored procedure in C++.

i am able to access the stored procedure with passing the constan values inside parameters but when ever i tried to pass variables inside stored procedure it fails.

I am pasting one example here:

suppose j is the object of otlstream class then:

Case 1: (it works)
j<<"5412293"<<"2004-08-30 00:00:00"<<"2004-08-30 23:59:59";

Case 2: (not working)
j<<proc_account<<start_date<<end_date;

All the parameters are of string type.


Thanks,
Nidhi
 
  


Reply



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 02:38 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