Solved

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

Posted on 2000-04-22
8
412 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
Comment Utility
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
Comment Utility
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
Comment Utility
Following...

Alex
0
 
LVL 1

Expert Comment

by:DValery
Comment Utility
The information not suffices. Could you give a complete text of the project?
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:Venne
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Tanks for your help! :)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
APK file name 7 63
delphi prevent click fast 2 165
FMX enumerated colours 2 72
Show Listview image from database (String field) 5 104
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now