Database for dummies...

BlitzMax Forums/BlitzMax Beginners Area/Database for dummies...

andre72(Posted 2007) [#1]
Hi,

I DL some of the nice BAH modules but the most don't work.
For sure Brucey allready did some help but I have to many problems so I hope somebody else could do some support too...

I try to make the access ODBC working but I ever get errors when I try to built.
BM tells me: undefined reference to '_bah_database_TDBConnection_init' Built Error: Failed to Link

When I try to build dbodbc myself I get the error:
Failed to compile .../dbodbc.mod/odbchelper.cpp

The libodbc32.a is copied to the bm\lib dir.

When I built the bah.database example_XX there built without any errors.
The file maxtest.db is also created but I get no output by the examples.

I think the matter is that I installed something wrong because of much trouble with the mods.
Where can I fint a manual how to install the bah mods correctly?

Thanks,

Andre


Blueapples(Posted 2007) [#2]
When I installed them they worked as any other: drop files in, run Build Modules. Actually I might have used the command line to compile, but it wasn't anything special.


tonyg(Posted 2007) [#3]
Have you got MinGW installed?


Brucey(Posted 2007) [#4]
The file maxtest.db is also created but I get no output by the examples.

Turn on Debug mode... if you look at the example all the output is DebugLog("xxxx").

However, the maxtest.db file is for SQLite... so you appear to have the SQLite database module functioning, which is a start :-)

As for most of the modules not working... for many you will need to download a different version of bmk (which is the program that compiles blitzmax apps and modules) ( http://brucey.net/programming/blitz/index.php#tweakedbmk )
You will need to compile bmk.bmx in non-debug and non-gui mode, and then copy the resulting bmk.exe into your BlitzMax/bin folder (backup the bmk.exe that is already there!!!)

For the ODBC module, I suggest deleting the .bmx folder in bah.mod/dbodbc.mod and the .a files from the same folder, and try building the modules again.
If you have the SQLite database module working, the ODBC module should work too.


andre72(Posted 2007) [#5]
@tonyg:
Yes I've it installed - this was the first hint by Brucey

@Brucey
Debug mode is on but no output given.
I allready installed SQLite and the examples in this dir do the same - built fine but no output.
With your bmk2 is the same I allready replaced the original one.
I delete the .bmx and .a files but the result is the same - failt to compile odbchelper.cpp

I really have no idea what's wrong here...


Brucey(Posted 2007) [#6]
from the IDE, you use ctrl-D to build modules...

from the command-line, you can go to your BlitzMax/bin folder and enter :

bmk makemods -a bah.dbodbc

Can you paste the output from the failed build please? :-)

Thanks.


andre72(Posted 2007) [#7]
I decide to DL MinGW new and reinstalled anything new - now it works fine.
However I don't know why but maybe something goes wrong while I installed it last time from my USB Stick...

Thanks a lot for your support!


Brucey(Posted 2007) [#8]
Glad to hear you sorted it out :-)


andre72(Posted 2007) [#9]
Yes I agree :-)
But one more question - please can somebody point out to the client librarie archive I've to DL to use your dbmysql.

Thanks


andre72(Posted 2007) [#10]
I think I understand ... There's need for the libmysql.a and for PostgreSQL the same.
Do anybody know a way how to get for somebody who'd never used a C compiler before?


Brucey(Posted 2007) [#11]
Included with the dbmysql module is a libmysql.a file (in dbmysql.mod/lib/win32). This file you should put into your BlitzMax/lib folder.

You will also need the MySQL client DLLs, which you can download from the mysql website. (Look for the Windows MySQL downloads. I think the smallest is about 20 meg - which is the server too, but with it you get the DLLs).


DBPostgreSQL :
Again, there is a libpq.a file provided with the module (in the dbpostgresql.mod/lib folder). This you should copy into BlitzMax/lib.

You will need the postgres client DLLs, which you can download from the postgres website.


The .a files are required for compiling the modules. The DLLs are for actually running the apps.