digitalmars.D - Database connection...
- Nahon (6/6) Oct 30 2006 Hi.
- Kyle Furlong (4/12) Oct 30 2006 Assuming you are comfortable with the windows api for odbc, the api
- Nahon (16/28) Oct 30 2006 The dbi module collection would be great (although I wanted to avoid ODB...
- JC (4/23) Oct 30 2006 This usually happend when you've not added the source files to the comma...
- Nahon (2/16) Oct 30 2006 Ok, I've ran into this problem before. But there's a *lot* of modules fo...
- JC (6/25) Oct 30 2006 I wouldn't call it a "problem" as such: you have to tell the compiler wh...
- Nahon (38/42) Oct 30 2006 Ok, it's a feature. :-) (I don't like it by the way... I think the compi...
- JC (13/59) Oct 30 2006 I know what you're saying, but how is it supposed to know where your fil...
- James Pelcis (5/24) Oct 30 2006 That's a known problem that is caused by DMC not being shipped with
- Brad Anderson (8/16) Oct 30 2006 I have wrappers for FreeTDS (http://www.freetds.org) that wrap its ctlib
- Nahon (4/15) Oct 30 2006 There are specified paths and a current directory... I think it should f...
- JC (5/12) Oct 30 2006 Perhaps the compiler could read the PATH environment variable, and then ...
- Nahon (5/15) Oct 30 2006 There are explicit information about what to import in the source files....
Hi. (Sadly) I have to connect to a *MSSQL* database in my program. I browsed the net quite a lot to find a D library (or sg.) that could do it. (I've found a connector form MySQL and a few others but not MSSQL.) Could someone help me about sending an URL for one or a module of own? Thank you.
Oct 30 2006
Nahon wrote:Hi. (Sadly) I have to connect to a *MSSQL* database in my program. I browsed the net quite a lot to find a D library (or sg.) that could do it. (I've found a connector form MySQL and a few others but not MSSQL.) Could someone help me about sending an URL for one or a module of own? Thank you.Assuming you are comfortable with the windows api for odbc, the api headers are here: http://www.prowiki.org/wiki4d/wiki.cgi?WindowsAPI. Which will link you to the dsource repository.
Oct 30 2006
Nahon wrote:The dbi module collection would be great (although I wanted to avoid ODBC), but I've downloaded it and unpacked to dmd/src/phobos/dbi. Then in my program I added the line import dbi.odbc.odbcdatabase; //and tried dbi.odbc.all as well then wanted to create a new database object: OdbcDatabase x = new OdbcDatabase(); When linking I get these error messages: #myprg.obj(myprg) #myprg.obj(myprg) _D3dbi4odbc12OdbcDatabase12OdbcDatabase5_ctorFZC3dbi If I don't want to create a new instance (OdbcDatabase x;) it's fine but cannot be used. What have I done wrong?Hi. (Sadly) I have to connect to a *MSSQL* database in my program. I browsed the net quite a lot to find a D library (or sg.) that could do it. (I've found a connector form MySQL and a few others but not MSSQL.) Could someone help me about sending an URL for one or a module of own? Thank you.Assuming you are comfortable with the windows api for odbc, the api headers are here: http://www.prowiki.org/wiki4d/wiki.cgi?WindowsAPI. Which will link you to the dsource repository.
Oct 30 2006
"Nahon" <lburger hu.tesco-europe.com> wrote in message news:ei4giu$i7c$1 digitaldaemon.com...The dbi module collection would be great (although I wanted to avoid ODBC), but I've downloaded it and unpacked to dmd/src/phobos/dbi. Then in my program I added the line import dbi.odbc.odbcdatabase; //and tried dbi.odbc.all as well then wanted to create a new database object: OdbcDatabase x = new OdbcDatabase(); When linking I get these error messages: #myprg.obj(myprg) #myprg.obj(myprg) _D3dbi4odbc12OdbcDatabase12OdbcDatabase5_ctorFZC3dbi If I don't want to create a new instance (OdbcDatabase x;) it's fine but cannot be used. What have I done wrong?This usually happend when you've not added the source files to the command line.
Oct 30 2006
Ok, I've ran into this problem before. But there's a *lot* of modules for this single one. How can I avoid the command line thing?When linking I get these error messages: #myprg.obj(myprg) #myprg.obj(myprg) _D3dbi4odbc12OdbcDatabase12OdbcDatabase5_ctorFZC3dbi If I don't want to create a new instance (OdbcDatabase x;) it's fine but cannot be used. What have I done wrong?This usually happend when you've not added the source files to the command line.
Oct 30 2006
"Nahon" <lburger hu.tesco-europe.com> wrote in message news:ei4qn3$s4q$1 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/wikiOk, I've ran into this problem before. But there's a *lot* of modules for this single one. How can I avoid the command line thing?When linking I get these error messages: #myprg.obj(myprg) __Class_3dbi4odbc12OdbcDatabase12OdbcDatabase #myprg.obj(myprg) _D3dbi4odbc12OdbcDatabase12OdbcDatabase5_ctorFZC3dbi If I don't want to create a new instance (OdbcDatabase x;) it's fine but cannot be used. What have I done wrong?This usually happend when you've not added the source files to the command line.
Oct 30 2006
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/wikiOk, 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.) 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\' #OPTLINK (R) for Win32 Release 7.50B1 #Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcResult.obj(OdbcResult) It seems everything is imported but it does not compile/link.
Oct 30 2006
"Nahon" <lburger hu.tesco-europe.com> wrote in message news:ei50g3$12ec$1 digitaldaemon.com...I know what you're saying, but how is it supposed to know where your files are located?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/wikiOk, 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.)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\' #OPTLINK (R) for Win32 Release 7.50B1 #Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcResult.obj(OdbcResult) 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.
Oct 30 2006
Nahon wrote:#OPTLINK (R) for Win32 Release 7.50B1 #Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcDatabase.obj(OdbcDatabase) #dbi\odbc\OdbcResult.obj(OdbcResult) It seems everything is imported but it does not compile/link.That's a known problem that is caused by DMC not being shipped with up-to-date Windows libraries. To fix it, follow the instructions at http://www.dsource.org/projects/ddbi/wiki/ODBCSubproject. Hope you enjoy.
Oct 30 2006
Nahon wrote:Hi. (Sadly) I have to connect to a *MSSQL* database in my program. I browsed the net quite a lot to find a D library (or sg.) that could do it. (I've found a connector form MySQL and a few others but not MSSQL.) Could someone help me about sending an URL for one or a module of own? Thank you.I have wrappers for FreeTDS (http://www.freetds.org) that wrap its ctlib portion of code. They were generated with bdc.gen, and I was able to get a D program talking to MSSQL. However, it's a bit low-level, and I have plans on integrating it with the DDBI lib on dsource - http://www.dsource.org/projects/ddbi. Let me know if you want it in it's rough form. BA
Oct 30 2006
I know what you're saying, but how is it supposed to know where your files are located?There are specified paths and a current directory... I think it should find them some of these places or send an error message. But for the last, not without searching. :)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.Thanks, I'll try it. :)
Oct 30 2006
"Nahon" <lburger hu.tesco-europe.com> wrote in message news:ei5509$17rk$1 digitaldaemon.com...Perhaps the compiler could read the PATH environment variable, and then have an option to do a recursive search for .d files on that path. But that would compile everything it found, which often is not what you want.I know what you're saying, but how is it supposed to know where your files are located?There are specified paths and a current directory... I think it should find them some of these places or send an error message. But for the last, not without searching. :)
Oct 30 2006
JC wrote:Perhaps the compiler could read the PATH environment variable, and then have an option to do a recursive search for .d files on that path. But that would compile everything it found, which often is not what you want.There are explicit information about what to import in the source files. I'm not a compiler programmer but I think that would be enough. Brad Anderson wrote:I have wrappers for FreeTDS (http://www.freetds.org) that wrap its ctlib portion of code. They were generated with bdc.gen, and I was able to get a D program talking to MSSQL. However, it's a bit low-level, and I have plans on integrating it with the DDBI lib on dsource - http://www.dsource.org/projects/ddbi. Let me know if you want it in it's rough form.Thank you, I'll try them as well. :)
Oct 30 2006