Home All Groups Group Topic Archive Search About
Author
11 Sep 2006 11:25 AM
c19h28o2
Hi,

I'm trying to connect to a sql server 2000 box using c but cannot find
a library for it, any ideas the best way to connect to it?

Cheers

c19

Author
11 Sep 2006 12:02 PM
Hilary Cotter
You can use dblib. You should also be able to use oledb IIRC with c.

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



Show quoteHide quote
"c19h28o2" <michael.bea***@barclays.co.uk> wrote in message
news:1157973953.692119.208960@i3g2000cwc.googlegroups.com...
> Hi,
>
> I'm trying to connect to a sql server 2000 box using c but cannot find
> a library for it, any ideas the best way to connect to it?
>
> Cheers
>
> c19
>
Are all your drivers up to date? click for free checkup

Author
11 Sep 2006 10:57 PM
David Browne
DbLib is deprecated, and OleDB is a COM library.  ODBC might be simpler from
straight C.

In general you should be using SQL Native Client.  Here's a link

http://msdn.microsoft.com/data/ref/sqlnative/


David

<DIV>&quot;Hilary Cotter&quot; &lt;hilary.cot***@gmail.com&gt; wrote in
message news:%236CienZ1GHA.4300@TK2MSFTNGP03.phx.gbl...</DIV>> You can use
dblib. You should also be able to use oledb IIRC with c.
Show quoteHide quote
>
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
>
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
>
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
>
>
> "c19h28o2" <michael.bea***@barclays.co.uk> wrote in message
> news:1157973953.692119.208960@i3g2000cwc.googlegroups.com...
>> Hi,
>>
>> I'm trying to connect to a sql server 2000 box using c but cannot find
>> a library for it, any ideas the best way to connect to it?
>>
>> Cheers
>>
>> c19
>>
>
>
Author
12 Sep 2006 9:02 PM
c19h28o2
Hi,

Thanks but i'm actually on a unix svr4.0 (very old!) so I can only use
c....

Any ideas?
Author
12 Sep 2006 9:21 PM
David Browne
<DIV>&quot;c19h28o2&quot; &lt;michael.bea***@barclays.co.uk&gt; wrote in
message news:1158094937.441150.295930@p79g2000cwp.googlegroups.com...</DIV>>
Hi,
>
> Thanks but i'm actually on a unix svr4.0 (very old!) so I can only use
> c....
>

Well being on Unix is much more of a problem than using c.

As far as I know, here are the options for using SQL Server from unix.

1)
There are many libraries for accessing SQL Server from c on Windows.  There
are some third-party unix libraries for SQL Server (web search for these).

2)
Use Java (there is a JDBC driver for SQL Server), although from old unixes,
I doubt this will work.

3)
Otherwise you can migrate your code to windows (possibly running in the
Windows Subsystem For Unix).
http://www.microsoft.com/windowsserver2003/r2/unixinterop/default.mspx

4)
Use TCP/IP sockets to communicate with a windows program that directly
accesses SQL Server.  If you have XML and SOAP capabilities in your Unix
environment, this is easy as SQL Server 2005 natively supports SOAP.
Otherwise you need to code a socket server running on Windows (possibly
running in the Windows Subsystem For Unix), and communicate with that.


David
Author
12 Sep 2006 10:34 PM
c19h28o2
David,

Thanks for the suggestions, I might try the sockets route, although my
socket skills are currently zero!

maybe I could knock up a litte .net app to interface between my unix
code and sql server? possible?

Thanks

Michael
Author
13 Sep 2006 2:23 AM
David Browne
<DIV>&quot;c19h28o2&quot; &lt;michael.bea***@barclays.co.uk&gt; wrote in
message news:1158100498.994269.197750@d34g2000cwd.googlegroups.com...</DIV>>
David,
>
> Thanks for the suggestions, I might try the sockets route, although my
> socket skills are currently zero!
>
> maybe I could knock up a litte .net app to interface between my unix
> code and sql server? possible?
>


Yes.  At least on the Windows side, writing a socket server in .NET is very
easy.  And writing a socket server is easier than writing a socket client,
so you'd be knocking out the harder part.  But you'd still be on the hook
for implementing a protocol on top of TCP/IP.

Or you can use HTTP 1.0 from the unix client.  It's super-simple to
implement even without a library on the client side.  The server side is
harder, but there you can simply use ASP.NET or the .NET
System.Net.HttpListener.  The content-type can be strings, or binary
structures, or whatever is easy for the unix client.

David

Bookmark and Share