using database object as pointer in external file to build connection

2003-12-21 05:31:00 AM
i am working on an application which use three mysql database. i program
with bcb 5 enterprise. As I will very often connect to these databases I
like to write my own function, which can be used from anywhere and for any
I have following vision:
I have anywhere one of few TmySQLDatabase objects. Now, I call a function,
which I give the adress of that TmySQLDatabase object and second parameter
determine the database. Exmaple:
The function has the task to build a connection to that object and give it
back, so that my application may work with it.
I have created to files:
#include "database.h"
// connect with database
bool __fastcall DBConnect(TmySQLDatabase *database, String db)
return true;
#include <vcl.h>
// connect with databse
bool __fastcall DBConnect(TmySQLDatabase *database, String db);
Now I add the CPP fiel to my project and include the header file.
After compiling, i get these errors:
[C++ Fehler] DATABASE.H(7): E2147 Parameterdeklaration darf nicht mit
'TmySQLDatabase' beginnen.
[C++ Fehler] database.cpp(8): E2147 Parameterdeklaration darf nicht mit
'TmySQLDatabase' beginnen.
Translate to english, it should be like:
[C++ Error] DATABASE.H(7): E2147 parameter declaration may not start with
[C++ Error] database.cpp(8): E2147 parameter declaration may not start with
Now I tried to add this line in the Header file:
#include "mySQLDbTables.hpp"
This error appears:
[C++ Warnung] Math.hpp(76): W8058 Präcompilierter Header: Initialisierte
Daten im Header kann nicht erzeugt werden.
in english:
[C++ Error] Math.hpp(76): W8058 prae compiled header: Initialize data in
header cannot be generated.
My CPP file and H file stay in parallel folders to my project, if this is
important for you.
I hope you could unterstand and help me.