🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.dbexpress
1 messages
1 total messages Started by Paul Betteridge Mon, 23 Aug 2004 12:34
ApplyUpdates giving mysql syntax error
#97
Author: Paul Betteridge
Date: Mon, 23 Aug 2004 12:34
70 lines
3208 bytes
Hi,

I have a form where I have a TSQLConnection, TSQLClientDataSet, TDataSource
and a TDBCtrlGrid (contain DBMemo controls).

The connection is made as follows and I can connect to the database and the
data can be viewed in the grid memo controls:

    SQLConnection->LoginPrompt = false;

    SQLConnection->ConnectionName = "MySQLConnection";
    SQLConnection->DriverName = "MySQL";
    SQLConnection->GetDriverFunc = "getSQLDriverMYSQL";

    SQLConnection->Params->Clear();
    SQLConnection->Params->Add("DriverName=MySQL");
    SQLConnection->Params->Add("HostName=" +
AnsiString(MYSQL_SERVER_HOSTNAME));
    SQLConnection->Params->Add("Database=" + AnsiString(GSERVER_DATABASE));
    SQLConnection->Params->Add("User_Name=" + AnsiString(USERNAME));
    SQLConnection->Params->Add("Password=" + AnsiString(PASSWORD));
    SQLConnection->Params->Add("BlobSize=-1");
    SQLConnection->Params->Add("ErrorResourceFile=./DbxMySqlErr.msg");
    SQLConnection->Params->Add("LocaleCode=0000");

    SQLConnection->LibraryName = "dbexpmysql.dll";
    SQLConnection->VendorLib = "libmysql.dll";

    // "user" is the name of my MySQL Table
    ClientDataSet->CommandText = "select * from user;";

    // we need to set the Connection and the Dataset
    ClientDataSet->DBConnection = SQLConnection;
    DataSource->DataSet = ClientDataSet;

    // Activate Everything
    SQLConnection->Connected = true;
    ClientDataSet->Active = true;
    DataSource->Enabled = true;

    // this will connect the Datasource to DBGrid, which in turn will
    // display the data, of the table
    DBGrid->DataSource = DataSource;


I make the change to the memo control during runtime and call the following:

    ClientDataSet->ApplyUpdates(0);    // I have also tried
ApplyUpdates(-1);

and I get the following error:

You have an error in your SQL syntax.  Check the manual that corresponds to
your MySQL server version for the right syntax to use near ';  set
 username = 'belliez'
where
 id = '36' and
 username

I can manually write SQL and send itto the mySql server with no problems.
If you know of any reason why I can't get ApplyUpdates to work then please
let me know asap.

I am using Borland C++ Builder 6 Professional
MySql server is 4.0.20a and I am using the latest dll for this version and
have been added into this project.

Many thanks

Paul
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads