Re: commands out of sync problem



Thanks for the hints, but it isn't really helping. I'm not using any
TSQLquery components and the number of fields is ok.

I've created now the simplest possible example for this and still I have the
same problem. All you need is a mysql DB with one table and then create a
server and client application like this:

Server:
1. Create a new Soap server application (new->other->web services->Soap
server application)
2. Add Soap Server data module (new->other->web services->Soap server data
application)
3. Add a SQLconnection for the MySQL database
4. Add a SQLdataSet and change the parameters SQLconnection to the just
created connection, commandType to ctTable and commandText to the table on
the database
5. Add a datasetprovider and put the dataset to the created SQLdataSet
6. Add a datasource and put the dataset to the created SQLdataSet
7. build the project and put it in the cgi-bin directory of the webserver

Client:
1. Create new CLX application
2. add a soap connection compontent and put the URL to
http://localhost/cgi-bin/Project1.exe/soap/IAppServer
3. Add ClientDataSet, put remote server to the soap connection and the
providername to the datasetprovider of the server
4. Add datasource component and set the dataset to the just created
clientdataset
5.Add a DBgrid and put the datasource to the just created datasource
6. add a button and put as code in the OnClick event:

if(MyClientDataSet->State == dsEdit || MyClientDataSet->State == dsInsert)
MyClientDataSet->Post();
MyClientDataSet->ApplyUpdates(-1);

Run the application, change some data in the table, hit the button
and...tada 'commands out of sync: you can't run this command now'.

It seems I've tried everything, but the problem just won't go away. Anybody
care to spent en few minutes, try the above steps and tell me if they have
the same problem, or even better see what I'm doing wrong?

kind regards,
Largowww.

"migmam" <migmam2@xxxxxxxxxx> wrote in message
news:d7ad3l$jvu$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hello,
>
> I had that problem with Delphi 7 and MySQL. And the error message doesn't
> help a lot.
>
> If I remember right It happened when I tried to open a SQLQuery that was
> already open.
> So check that all your SQLQuery are closed before performing a new open
> method.
> Also it happens when the number of fields declared in ClientDataSet are
not
> the same than the corresponding mysql table.
>
> Best Regards,
>
> Miguel Angel
>
>
>
>
>
>
> "largowww" <largowww@xxxxxxxxx> escribió en el mensaje
> news:42983975$0$1820$6c56d894@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > It's in fact a borland C++ builder problem, but I don't find a good
> > newsgroup for borland C++ builder and I know this problem exists in
Delphi
> > also:
> >
> >
> >
> > I'm stuck on a problem and I just can't find a solution. I'm writing a
> > simple multitiered DB (mysql) application in a windows environment using
> > DBexpress and soap. The client application is just performing a ping to
a
> > remote server and when the reply arrives I want to store the ping
> > information in a DB Seems simple, but I always get the error 'commands
out
> > of sync: you can't run this command now'.
> >
> >
> >
> > Here's the code when I receive the ping reply:
> >
> >
> >
> >
> >
> > void __fastcall TForm1::IdIcmpClient1Reply(TComponent *ASender,
> >
> > const TReplyStatus &AReplyStatus)
> >
> > {
> >
> > static int ID = 0;
> >
> > int pingtime;
> >
> >
> >
> > if (AReplyStatus.ReplyStatusType == rsTimeOut)
> >
> > pingtime = 5000;
> >
> > else pingtime = AReplyStatus.MsRoundTripTime;
> >
> >
> >
> > // now call the server to store the data
> >
> > pingDataSet->AppendRecord(ARRAYOFCONST((ID,
> > configDataSetIPaddress->Value, pingtime)));
> >
> > if(pingDataSet->ChangeCount > 0)
> >
> > pingDataSet->ApplyUpdates(0); <----- Here I get the error
> >
> >
> >
> > ID++;
> >
> > }
> >
> >
> >
> > Now I've been looking for this problem in google, I didn't find any
> > solution, but what I saw is that several people had this problem and it
> > could have something to do with the used version of mysql and the used
> dll'
> > s. I'm using MySQL 4.1.11, dbexpmysql.dll of 91kb and libmysql.dll of
> 228kb.
> > I've tried several other versions of libmysql.dll, but then I always get
> the
> > 'unable to load libmysql.dll' error. The strange thing is that I can't
use
> > the libmysql.dll which is included in the MYSQL I'm using, because with
> that
> > one I also get the 'unable to load' - problem.
> >
> >
> >
> > Anyone any ideas how to solve this?
> >
> >
>
>


.


Quantcast