Database connection...

JC johnch_atms at hotmail.com
Mon Oct 30 06:46:48 PST 2006


"Nahon" <lburger at hu.tesco-europe.com> wrote in message 
news:ei50g3$12ec$1 at digitaldaemon.com...
> >I wouldn't call it a "problem" as such: you have to tell the compiler 
> >which
>>files to compile. However, Derek Parnell's Bud (nee Build) tool can make 
>>the
>>task of compiling a lot less tedious.
>>http://www.dsource.org/projects/build/wiki
>
> Ok, it's a feature. :-) (I don't like it by the way... I think the 
> compiler
> should automatically find the modules it has to compile: there are 
> implicit
> commands for it.)

I know what you're saying, but how is it supposed to know where your files 
are located?

>
> But anything I do, I get this result:
>
> #c:\DMD\tarolas>bud_win_3.04 -full -names stock ws2_32.lib
> #Current Dir 'c:\DMD\stock\'
> # [ stock.d ]
> # [ sh.d ]
> # [ screen.d ]
> # [ element.d ]
> # [ telnet.d ]
> # [ dbi\odbc\OdbcDatabase.d ]
> # [ dbi\Database.d ]
> # [ dbi\DBIException.d ]
> # [ dbi\ErrorCode.d ]
> # [ dbi\Result.d ]
> # [ dbi\Row.d ]
> # [ dbi\Statement.d ]
> # [ dbi\odbc\OdbcResult.d ]
> # [ ws2_32.lib ]
> #OPTLINK (R) for Win32  Release 7.50B1
> #Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
> #
> #dbi\odbc\OdbcDatabase.obj(OdbcDatabase)
> # Error 42: Symbol Undefined _SQLFreeHandle at 8
> #dbi\odbc\OdbcDatabase.obj(OdbcDatabase)
> # Error 42: Symbol Undefined _SQLEndTran at 12
> #dbi\odbc\OdbcDatabase.obj(OdbcDatabase)
> # Error 42: Symbol Undefined _SQLGetDiagField at 28
> #dbi\odbc\OdbcDatabase.obj(OdbcDatabase)
> # Error 42: Symbol Undefined _SQLGetDiagRec at 32
> #dbi\odbc\OdbcDatabase.obj(OdbcDatabase)
> # Error 42: Symbol Undefined _SQLSetEnvAttr at 16
> #dbi\odbc\OdbcDatabase.obj(OdbcDatabase)
> # Error 42: Symbol Undefined _SQLAllocHandle at 12
> #dbi\odbc\OdbcResult.obj(OdbcResult)
> # Error 42: Symbol Undefined _SQLColAttribute at 28
>
> It seems everything is imported but it does not compile/link.

You haven't linked in the odbc import library. Specify "odbc32.lib" on the 
command line. Alternatively, in one of your modules, add the following:

    pragma(lib, "odbc32.lib");

An import library comes with the linker and utilities package from the 
website (http://ftp.digitalmars.com/dmc.zip). But I'm not sure if the one 
that version will work, because it's very old. If you have the latest 
Platform SDK, you can copy odbc32.lib from there into your dm\lib folder, 
and then run coffimplib (ftp://ftp.digitalmars.com/coffimplib.zip) on it to 
make it compatible with DMD. 





More information about the Digitalmars-d mailing list