🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
3 messages
3 total messages Started by Danny Wang Mon, 04 Jun 2001 20:10
How to fetch data from server?
#654
Author: Danny Wang
Date: Mon, 04 Jun 2001 20:10
12 lines
1576 bytes
Hi everybody,
   My app needs to filter table. So I do it on server side( in 
OnFilterRecord Event). But on client side, I have to use 
clientDataset.refresh() to get the changed data. This make my app very 
slowly. I tried to close ClientData and then open it, but it does'nt 
work. Furthermore, the first time when ClientData fetching the data, 
there are some errors: The server side filter the data from 100 records 
to 34 records, but the client side still get 90 records, displaying 
there are 34 records. But the second time, everything works fine. It 
display 34 records and telling you there are 34 records there.
Any one has any idea?
Thanks
Re: How to fetch data from server?
#655
Author: Danny Wang
Date: Mon, 04 Jun 2001 20:55
27 lines
1836 bytes
Furthermore, my source code is here:
//Client side:--------------
if(!ClientDatamodule->RspCD->Active )
       ClientDatamodule->RspCD->Active = true;
// do some works on server side, include filter the data
TempInterface.SelFilterRsp(CellWStr.c_bstr(),AudWStr.c_bstr(),WeekWStr.c_bstr(),STWStr.c_bstr(),&RspCnt);
ClientDatamodule->RspCD->Refresh();//get the newest data

//Server side:---------
m_DataModule->RspQry->Close();
     m_DataModule->RspQry->Filtered = false;
     m_DataModule->RspQry->SQL->Clear();
     m_DataModule->RspQry->SQL->Add(sql+wheresql);
     m_DataModule->RspQry->Open();
     if(...>0)
	{
         m_DataModule->RspQry->Filtered = true;
         }
     else
         m_DataModule->RspQry->Filtered = false;
     *RspCount = m_DataModule->RspQry->RecordCount;
     return S_OK ;
//Server side OnFilterRecord event:
if(...)
  Accept = true;
else
   Accept = false;
Re: How to fetch data from server?
#656
Author: Danny Wang
Date: Mon, 04 Jun 2001 21:19
38 lines
2158 bytes
And I found the second problem can be workaround by adding a line:

ClientDataModule->RspCD->Last();

on ClientSide before call RspCD->Refresh();
Anybody knows the reason?


Danny Wang wrote:

> Furthermore, my source code is here:
> //Client side:--------------
> if(!ClientDatamodule->RspCD->Active )
>       ClientDatamodule->RspCD->Active = true;
> // do some works on server side, include filter the data
> TempInterface.SelFilterRsp(CellWStr.c_bstr(),AudWStr.c_bstr(),WeekWStr.c_bstr(),STWStr.c_bstr(),&RspCnt); 
> 
> ClientDatamodule->RspCD->Refresh();//get the newest data
> 
> //Server side:---------
> m_DataModule->RspQry->Close();
>     m_DataModule->RspQry->Filtered = false;
>     m_DataModule->RspQry->SQL->Clear();
>     m_DataModule->RspQry->SQL->Add(sql+wheresql);
>     m_DataModule->RspQry->Open();
>     if(...>0)
>     {
>         m_DataModule->RspQry->Filtered = true;
>         }
>     else
>         m_DataModule->RspQry->Filtered = false;
>     *RspCount = m_DataModule->RspQry->RecordCount;
>     return S_OK ;
> //Server side OnFilterRecord event:
> if(...)
>  Accept = true;
> else
>   Accept = false;
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