Solved

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

Posted on 2000-04-22
8
418 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month8 days, 19 hours left to enroll

615 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