create a TSQLConnection at run-time and error "DLL/Shared Li

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
e arlati

create a TSQLConnection at run-time and error "DLL/Shared Li

Post by e arlati » Wed 01 Dec 2004 16:50

I' m using BC++Builder 6 with mysql 4.1.7 and I'm evaluating your dbExpress trial 2.10

I try to create a TSQLConnection at run-time using the code show belowe
but when the program try to open the connection it get the error "DLL/Shared Library Name not Set"

what I was missing in this code ?

dbConn = new TSQLConnection(NULL);
dbConn->DriverName = "MySQL Direct (Core Lab)";
dbConn->GetDriverFunc = "getSQLDriverMySQLDirect";
dbConn->LibraryName = "dbexpmda.dll";
dbConn->KeepConnection = true;
dbConn->LoginPrompt = false;
dbConn->Params->Values["DriverName"] = "MySQL Direct (Core Lab)";
dbConn->Params->Values["HostName"] = "localhost";
dbConn->Params->Values["LibraryName"] = "dbexpmda.dll";
dbConn->Params->Values["DataBase"] = "SIV";
dbConn->Params->Values["User_Name"] = "root";
dbConn->Params->Values["Password"] = "";
dbConn->Params->Values["BlobSize"] = -1;

dbConn->Connected = true;

regards ,
Enzo Arlati enzo.arlati@aesys.it
AESYS Via Artigiani, 41 24060 Brusaporto (BG) - Italy
Tel. +39 (0)35.2924.182 Fax +39 (0)35 680030

e arlati

create a TSQLConnection at run-time and error "DLL/Shared Li

Post by e arlati » Thu 02 Dec 2004 09:35

I setted also per property VendorLib as follow belowe and now the procedure is working
dbConn->VendorLib = "not used";


TSQLConnection * __fastcall TDataModule_PMV::NewSQLConnection( void )
{
TSQLConnection * dbConn = 0;

try
{
dbConn = new TSQLConnection(NULL);

dbConn->DriverName = "MySQL Direct (Core Lab)";
dbConn->LibraryName = "dbexpmda.dll";
dbConn->VendorLib = "not used";
dbConn->GetDriverFunc = "getSQLDriverMySQLDirect";
dbConn->Params->Values["DriverName"] = "MySQL Direct (Core Lab)";
dbConn->Params->Values["HostName"] = "localhost";
dbConn->Params->Values["DataBase"] = "SIV";
dbConn->Params->Values["User_Name"] = "root";
dbConn->Params->Values["Password"] = "";
dbConn->Params->Values["BlobSize"] = -1;

dbConn->KeepConnection = true;
dbConn->LoginPrompt = false;

dbConn->Connected = true;

}
catch( Exception & ex )
{
if( dbConn )
{
delete dbConn;
dbConn = 0;
}
String serr = Format( "[NewSQLConnection]ERRORE %s ",
ARRAYOFCONST(( ex.Message )) );
Util::mylog( serr );
}


return dbConn;
}

Post Reply