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

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!!!
VenneAsked:
Who is Participating?
 
kretzschmarConnect With a Mentor Commented:
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
 
kretzschmarCommented:
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
 
kretzschmarCommented:
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

 
simonetCommented:
Following...

Alex
0
 
DValeryCommented:
The information not suffices. Could you give a complete text of the project?
0
 
VenneAuthor Commented:
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
 
VenneAuthor Commented:
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
 
VenneAuthor Commented:
Tanks for your help! :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.