Execute not work in 5.7 - With MyDac 3 it work - why?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
EPMS
Posts: 15
Joined: Fri 10 Dec 2004 07:05

Execute not work in 5.7 - With MyDac 3 it work - why?

Post by EPMS » Wed 04 Mar 2009 12:58

Hello,
sorry my english is nocht very well. :) I have a problem and hope, you can help me. I used for a long time MySQL 3.1. Yesterdam my server crashed and i install MySQL 5.
I use C++ Builder 6 and MyDac in Version 3. But with the MyDac Version 3 it seems, that i cannot connect to MySQL 5. I looked for a new MyDac Version and find the Version 5.7.

I remove the old MyDac 3 Version and installed the MyDac 5.7. I open my project and start the programm. Know i have the problem, that it seems that my SQL-Query not work.

With MyDac 3 i do so

Code: Select all

sql_insert = "insert into kundendaten";
sql_insert += " (anrede, firma, vn, nn, stra, plz, ort, land, bemerkung, gesamtkosten, versandkosten, zahlart, blz, ktonummer, bank, inhaber, artikel_komplett, bestellart, bestelldatum, versanddatum, erfasser)";
sql_insert += "  values ('"+neue_bestellung->anrede->Text+"', '"+neue_bestellung->firma->Text+"', '"+neue_bestellung->vn->Text+"', '"+neue_bestellung->nn->Text+"', '"+neue_bestellung->stra->Text+"', '"+neue_bestellung->plz->Text+"', '"+neue_bestellung->ort->Text+"', '"+neue_bestellung->land->Text+"', '"+neue_bestellung->bemerkung->Lines->Text+"',";
sql_insert += "  '"+artikeldaten_back[0]+"', '"+artikeldaten_back[2]+"', '"+zahlart+"', '"+neue_bestellung->Eblz->Text+"', '"+neue_bestellung->Ektonummer->Text+"', '"+neue_bestellung->Ebank->Text+"', '"+neue_bestellung->Einhaber->Text+"', '"+artikeldaten_back[1]+"', '"+bestellart+"', '"+bestelldatum+"', '', '"+computername+"')";

DataModule1->sql_kundendaten->SQL->Clear();
DataModule1->sql_kundendaten->SQL->Add(sql_insert);
DataModule1->sql_kundendaten->Execute();
I get no errormessage. Execute is done but i have no data in my Table. With MyDac 3 it work. Why not with 5.7?

Is in MyDac 5.7 something other to do my Query?

Thanks vor help.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 04 Mar 2009 14:36

I can not reproduce the problem.
Plase make sure that you insert data and read it in/from one database.

EPMS
Posts: 15
Joined: Fri 10 Dec 2004 07:05

Post by EPMS » Wed 04 Mar 2009 15:27

Hello,
i know make a new project. I have a Form with one Button. Then i have a DataModul. On the DataModul i have one TMyConnection and one TMyQuery.

When i click on the button this code were executed

Code: Select all

AnsiString sql_insert = "insert into test (vn, nn) values ('michael', 'linke')";

DataModule1->sql->SQL->Clear();
DataModule1->sql->SQL->Add(sql_insert);
DataModule1->sql->Execute();
The Query in sql_insert i want to write in my DB. To reach that i must do DataModule1->sql->Execute() or is that wrong? When i use code above then nothing happen. I have no new data in my DB.

Where is my mistake?

EPMS
Posts: 15
Joined: Fri 10 Dec 2004 07:05

Post by EPMS » Wed 04 Mar 2009 15:54

Is their maybe a restriction in the Trail Version to write into a DB?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 05 Mar 2009 08:16

The MyDAC trial edition does not have such limitation.
Please try to write data to DB using ADO or BDE and check the result.

Post Reply