Solved

TQuery's Error!! urgent!!! Experts ! please

Posted on 2000-04-22
8
415 Views
Last Modified: 2010-04-04
Hi, Experts:

I meet a strange problem. When I put a TQuery Component into a form, it can work. I know the Sql is right, then  I want creat this form dynamic, like this:



procedure TfrmContent.CalcQuery(id: String);
begin
  if CaptionQuery.Active then
      CaptionQuery.Active :=false;
  CaptionQuery.sql.Clear ;
  CaptionQuery.sql.Add( 'Select * from "Category.DB" ');
  CaptionQuery.sql.Add( 'Where ID like "'+ID+'___'+'" order by seq');
  CaptionQuery.open;
end;

procedure TfrmMain.TheClick(Sender: Tobject);
var
  BtnId:integer;
begin
  With Sender as TVTImageButton do
    BtnId:=tag;
  if TestButtonCall[BtnID].CallExist then begin
    if TestButtonCall[btnId].IfExternalCall=0 then begin
      with TestButtonCall[btnID] do  begin
       ShellExecute(0,'open',pchar(path+callprogram),pchar(path),pchar(callparam),SW_MAXIMIZE);
      end;
    end else begin
      //CalcQuery (TestButtonCall[btnId].InternalID);
      //application.CreateForm (TFrmContent,frmContent);
      //frmContent:=TFrmContent.Create(Application);
      //frmContent.CurrentID :=TestButtonCall[btnId].InternalID ;
      frmContent.HasPainted :=false;
      frmContent.ShowModal ;
      //frmContent.free;
      //frmContent:=nil;
    end;
  end;

end;

Syntax is correct, but it  will raise a EDBEngineError when I try call this public procedure. it tell me there is error when  BDE init. error no:$2501

but this code can be used in other place. :(

How can I avoid it? it's urgent!!!
0
Comment
Question by:Venne
8 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2739909
hi venne,

9473 : $2501 : Insufficient memory for this operation.

seems you must adjust the bde memsettings to a higher value
look at bde-admin|configuration-tab|System|Init
and adjust the entries memsize and/or sharedmemsize to a higher value

just a guess

meikl
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2739915
hi again,

from borland

--- begin paste

FAQ372B.txt  'Insufficient memory to complete operation' error
   Category    :Database (Miscellaneous)
   Platform    :All
   Product     :BDE  

   Question:
   "Insufficient memory to complete operation" error when
   attempting various BDE / Database operations: What is wrong?

   Answer:
   More than likely, you have hit one of the BDE fixed, but
   configurable, memory limitations. Use the BDE Administrator
   (BDEADMIN.EXE) to increase MEMSIZE and SHAREDMEMSIZE settings.
   You might also want to re-evaluate the application hitting this
   limitation because it is likely that the application is a
   serious resource hit on the machine.  Not using auto-create
   forms and only opening tables and queries when needed can free
   up resources.

   7/15/98 3:23:06 PM

--- end paste

meikl
0
 
LVL 15

Expert Comment

by:simonet
ID: 2740652
Following...

Alex
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Expert Comment

by:DValery
ID: 2743049
The information not suffices. Could you give a complete text of the project?
0
 

Author Comment

by:Venne
ID: 2745842
I have found it. I think this question will change also.

The reason is: A MCI device in my other form is playing midi! How strange. It will work perfect when I close the midi before query.

the MCI device is a component written by myself, I used MCI command to play midifile, I try to use the TMediaPlayer instead of my componet but I found it's too bad than mine, exception will be raided whatever playing midi or not.

kretzschmar, I think your comments is possible, but I use local database only, and I couldn't set it's memsize etc.

Now, the question is over, but I want to know why? MCI VS BDE? Who can explain it?

0
 

Author Comment

by:Venne
ID: 2745862
I have found it. I think this question will change also.

The reason is: A MCI device in my other form is playing midi! How strange. It will work perfect when I close the midi before query.

the MCI device is a component written by myself, I used MCI command to play midifile, I try to use the TMediaPlayer instead of my componet but I found it's too bad than mine, exception will be raided whatever playing midi or not.

kretzschmar, I think your comments is possible, but I use local database only, and I couldn't set it's memsize etc.

Now, the question is over, but I want to know why? MCI VS BDE? Who can explain it?

0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 500 total points
ID: 2746353
hi venne,

it doesn't matter if the database is local or not, because this are general bde-settings and not bound to any alias or driver

look at bde-admin|configuration-tab|System|Init
and adjust the entries memsize and/or sharedmemsize to a higher value

well, your mediaplayer seems to eat up your systemresources, maybe you should init the bde before playing anything.

meikl
0
 

Author Comment

by:Venne
ID: 2758135
Tanks for your help! :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question