On 2013-10-20 10:13, John Joyus wrote:
I am learning D and itching to create some small tools (basically
Windows executables) for our internal use, but any tool I think of
creating also needs some support for SQL Server! So my question is:
1). Does D has any support for MSSQL?
I need the ability to connect to a SQL Server and run a SQL script (the
script I construct based on user inputs) and capture its return value,
just a number. (No need to insert or update any records).
I would say your best bet is to create bindings to FreeTDS. It's an open
source library that can connect to SQL Server.
I actually tried to do that once, but I never managed to connect to the
server/database, for some reason. I C version worked fine but not when I
ported it do D.
This is the D version:
http://pastebin.com/7tGyytDh
This is the tds file:
http://pastebin.com/JCA8XQH0
This is the C version:
http://pastebin.com/FWJM4B6X
You just need to fill in the constants at the top. Please let me know if
you get the D version working.
--
/Jacob Carlborg