Page 1 of 1

bug in dbexpmda40.dll when using stored proc

Posted: Tue 06 Nov 2007 17:30
by johnkuiper
I'm evaluating the dbexpress drivers for mysql (crlab release 4.20.004). This one works for me, beause it can work with only one databaseconnection.
But when using stored proc on MySQL 5.1 it creates an error:

Access violation at address 010B185C in module 'dpexpmda40.dll'. Read of address 00000008

This occurs everytime I want to give a parameter a value

Code: Select all

procedure TForm4.DBEdit1Exit(Sender: TObject);
begin
  SQLstoredproc1.ParamByName('charveld').Value := 'hello';
  SQLstoredproc1.ParamByName('chardomeininput').Value := 'hello2';
  SQLstoredproc1.ExecProc;
  if SQLstoredproc1.ParamByName('gevonden').AsInteger = 0 then
     showmessage('nothing found');
end;
Please help. The dbxmys30.dll has an serious bug and I really want to use your drivers

Posted: Fri 09 Nov 2007 16:34
by Antaeus
Thank you for information. The investigation of the problem is in progress. As soon as we have results or we need more information, we will let you know.

Posted: Thu 15 Nov 2007 15:46
by johnkuiper
I have some more information for you. I replaced the .value into .AsString and got the same error (see previous post).

Do you know something more. I really need a good working DBExpress driver and the default driver of D2007 doesn't work well.

Posted: Wed 21 Nov 2007 10:50
by Antaeus
We reproduced the problem. It should disappear if you remove output parameters from SQLStoredProc1. Please check whether my supposition is correct in your case.

Posted: Fri 23 Nov 2007 10:56
by johnkuiper
I really want to try, but the evaluation is expired. Is there another way to test it. Reinstall didn't work. If your workaround is working, I can buy it.

Posted: Fri 23 Nov 2007 16:08
by Antaeus
Please contact us by e-mail (dbxmda*crlab*com). As soon as we fix the problem, we will send you the driver for test.

dbexpmda.dll crash with out parameter in stored procedure

Posted: Thu 13 Dec 2007 10:56
by sklim82
Hi,

I had tested the dbexpmda.dll 4.20.0.5 with C++ builder 6.0 and the problem that you mentioned still occur where dbexpmda.dll crash when there is out parameter in stored procedure. We would like to confirm this before purchasing the library.

Any help?

Posted: Fri 14 Dec 2007 16:15
by Antaeus
Try to download DbxMda once again and install it.

Posted: Mon 17 Dec 2007 03:54
by sklim82
Hi,

I had re-download the dbxmda.exe and tested dbexpmda.dll with the stored procedure. Yes, it is working now even the stored procedure consist of the output type of parameter.

However, new issue is the input type of parameter fail to carry the value. I set the value to 1 and it show 0 in database. I tested the same stored procedure with mydac and it is working.

Maybe you can have a look on it :)

Thanks.

Posted: Mon 17 Dec 2007 13:16
by Dimon
We can not reproduce the problem.
Please send me a complete small sample to dmitryg*crlab*com to demonstrate it, including script to create your stored procedure.

Posted: Tue 18 Dec 2007 02:26
by sklim82
Hi,

I create a dummy project to simulate the problem. The following are the dummy stored procedure and table:

Code: Select all

CREATE PROCEDURE `sp_GenerateTransactionID`(IN CommandID DECIMAL(4), OUT TransactionID INTEGER(11))

BEGIN
            INSERT INTO CREWMAIL_TRANSACTION(CT_ID, CT_CC_ID) VALUES(1, CommandID);
            SELECT LAST_INSERT_ID() INTO TransactionID;
END;

Code: Select all

CREATE TABLE `crewmail_transaction` (
  `CT_ID` int(10) unsigned NOT NULL,
  `CT_CC_ID` decimal(4,0) NOT NULL
) ;

And these are the c++ code:

Code: Select all

 TSQLConnection *sqlCon = new TSQLConnection(NULL);
        sqlCon->DriverName = AnsiString("dbxmysql");
        sqlCon->GetDriverFunc = AnsiString("getSQLDriverMySQL");

        sqlCon->VendorLib = AnsiString("libmysql.dll");
        sqlCon->LibraryName = AnsiString("dbexpmda.dll");
        sqlCon->KeepConnection = true;
        sqlCon->LoadParamsOnConnect = false;
        sqlCon->LoginPrompt = false;
        sqlCon->ConnectionName = "MySQLConnection";

        sqlCon->Params->Clear();
        sqlCon->Params->Add(AnsiString("HostName=10.97.6.218"));
        sqlCon->Params->Add(AnsiString("USER_NAME=root"));
        sqlCon->Params->Add(AnsiString("PASSWORD=marlinksecret"));
        sqlCon->Params->Add(AnsiString("Database=new_db"));

        sqlCon->Open();

        int iTransactionID = 0;
        int iCommandType = 1;
        TParam *prmTransactionID;
        TParam *prmCommandType;
        TSQLStoredProc *sp = new TSQLStoredProc(NULL);
        sp->StoredProcName = "sp_GenerateTransactionID";
        sp->ParamCheck = true;
        sp->Params->Clear();
        prmCommandType = sp->Params->CreateParam(ftInteger, "CommandID", ptInput);
        prmTransactionID = sp->Params->CreateParam(ftInteger, "TransactionID", ptOutput);
        prmCommandType->AsInteger = iCommandType;
        sp->SQLConnection = sqlCon;
        sp->Prepared = true;
        sp->ExecProc();
Hope this is help. Thanks for the reply.

Posted: Thu 20 Dec 2007 09:44
by Dimon
The LAST_INSERT_ID function works only for AUTO_INCREMENT columns.
The following code creates the correct procedure and table, so that the LAST_INSERT_ID function returns the correct value.

Code: Select all

CREATE TABLE `crewmail_transaction` ( 
  `CT_ID` int(11) AUTO_INCREMENT PRIMARY KEY, 
  `CT_CC_ID` decimal(4,0) NOT NULL 
);

Code: Select all

CREATE PROCEDURE `sp_GenerateTransactionID`(IN CommandID DECIMAL(4), OUT TransactionID INTEGER(11)) 
BEGIN 
    INSERT INTO CREWMAIL_TRANSACTION(CT_CC_ID) VALUES(CommandID); 
    SELECT LAST_INSERT_ID() INTO TransactionID; 
END;