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@4 = SQLAllocEnv
_SQLAllocConnect@8 = SQLAllocConnect
_SQLAllocHandle@12 = SQLAllocHandle
_SQLColAttribute@28 = SQLColAttribute
_SQLConnect@28 = SQLConnect
_SQLDisconnect@4 = SQLDisconnect
_SQLDescribeCol@36 = SQLDescribeCol
_SQLDriverConnect@32 = SQLDriverConnect
_SQLDrivers@32 = SQLDrivers
_SQLDataSources@32 = SQLDataSources
_SQLExecDirect@12 = SQLExecDirect
_SQLFetch@4 = SQLFetch
_SQLFreeConnect@4 = SQLFreeConnect
_SQLFreeHandle@8 = SQLFreeHandle
_SQLFreeEnv@4 = SQLFreeEnv
_SQLEndTran@12 = SQLEndTran
_SQLFreeStmt@8 = SQLFreeStmt
_SQLGetData@24 = SQLGetData
_SQLGetDiagField@28 = SQLGetDiagField
_SQLGetDiagRec@32 = SQLGetDiagRec
_SQLGetInfo@20 = SQLGetInfo
_SQLNumResultCols@8 = SQLNumResultCols
_SQLSetConnectOption@12 = SQLSetConnectOption
_SQLSetEnvAttr@16 = SQLSetEnvAttr
_SQLSetStmtOption@12 = SQLSetStmtOption
I've only tested it on a couple select statements and the
fieldNames, but so far its working.