ODBC Library?

Charles via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Nov 10 12:37:50 PST 2014


On Monday, 10 November 2014 at 18:13:58 UTC, Adam D. Ruppe wrote:
> On Monday, 10 November 2014 at 17:57:21 UTC, Charles wrote:
>> It didn't compile, says, "mssql.d(12): Error: module sql is in 
>> file 'win32\sql.d' which cannot be read"
>
> Oh, I forgot I used those. You can download the win32 folder 
> from here 
> https://github.com/AndrejMitrovic/DWinProgramming/tree/master/WindowsAPI
>
> The Windows bindings that come with phobos are pathetically 
> incomplete so a separate download or a bunch of copy/pasted 
> declarations is needed for any serious windows api work.

Thanks for that.

For anyone in the future: I needed odbc32.lib, so I created the 
following odbc32.def and used implib.

LIBRARY odbc32
EXETYPE NT
SUBSYSTEM WINDOWS
EXPORTS
_SQLAllocEnv at 4 = SQLAllocEnv
_SQLAllocConnect at 8 = SQLAllocConnect
_SQLAllocHandle at 12 = SQLAllocHandle
_SQLColAttribute at 28 = SQLColAttribute
_SQLConnect at 28 = SQLConnect
_SQLDisconnect at 4 = SQLDisconnect
_SQLDescribeCol at 36 = SQLDescribeCol
_SQLDriverConnect at 32 = SQLDriverConnect
_SQLDrivers at 32 = SQLDrivers
_SQLDataSources at 32 = SQLDataSources
_SQLExecDirect at 12 = SQLExecDirect
_SQLFetch at 4 = SQLFetch
_SQLFreeConnect at 4 = SQLFreeConnect
_SQLFreeHandle at 8 = SQLFreeHandle
_SQLFreeEnv at 4 = SQLFreeEnv
_SQLEndTran at 12 = SQLEndTran
_SQLFreeStmt at 8 = SQLFreeStmt
_SQLGetData at 24 = SQLGetData
_SQLGetDiagField at 28 = SQLGetDiagField
_SQLGetDiagRec at 32 = SQLGetDiagRec
_SQLGetInfo at 20 = SQLGetInfo
_SQLNumResultCols at 8 = SQLNumResultCols
_SQLSetConnectOption at 12 = SQLSetConnectOption
_SQLSetEnvAttr at 16 = SQLSetEnvAttr
_SQLSetStmtOption at 12 = SQLSetStmtOption

I've only tested it on a couple select statements and the 
fieldNames, but so far its working.


More information about the Digitalmars-d-learn mailing list