Solved

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

Posted on 2000-04-22
8
413 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
 
LVL 1

Expert Comment

by:DValery
ID: 2743049
The information not suffices. Could you give a complete text of the project?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
System restore point 4 91
Copy file in dll not working but working on exe ! 18 87
Path  to current project in Delphi. 2 71
Help on project with Soap 10 47
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…
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 demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

929 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

14 Experts available now in Live!

Get 1:1 Help Now