Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 12/06/22 in all areas

  1. Attila Kovacs

    How to open a file in the already running IDE?

    Yeah, but now, I want my bdsLaucher2, where one can define, from which folder which IDE should spawn or open the file!
  2. Attila Kovacs

    How to open a file in the already running IDE?

    Here. This queries all the running bde's and opens a file in every one. This is a good start, you have to find out which is which version somehow, I have no more time for that. DDE-test.7z
  3. dummzeuch

    How to open a file in the already running IDE?

    That was actually one of the points for this tool: To open a project in a new instance of the IDE rather than in an existing one. For me that latter has always been an annoying anti feature. I was under the impression that Delphi's BdsLauncher simply was a wrapper that can be called with the file to open as a parameter which then would check whether bds.exe was already running and either start it or pass the file name to it to open it. But that doesn't seem to be the case. As @Fr0sT.Brutal already wrote: According to the registry entries it is DDE.
  4. programmerdelphi2k

    How do I handle the 'closed dataset' error ?

    First, any derived StringGrid ("Grids/StringGrid/etc...") in Firemonkey is not data aware like the DBGrid in VCL is! So, forget about this relationship here at Firemonkey! FMX uses the LiveBinding framework to make the bridge between the StringGrid/Grid and the data source (table/query/etc...), and the component/class used is the "BindSourceDB" (same function as the Datasource in VCL) ; you don't need to keep opening and closing the database connection! Unless you need it for some reasonable reason, eg low bandwidth connection etc... you can: before or when o form is open: FDConn.Open; after or when o form is closed: FDConn.Close; // this close all datasets using this connection component! you close the "query" only when: dont needs anymore use it needs changes the SQL text needs changes some params (if dont using PARAMetrization correctly) when using: "Select" you should use "qry.OPEN" // return a data-set when using: "Insert, Delete, Update" you should use "qry.EXECUTE" // execute dont return any data-set! said this, then you can try: procedure TForm1.Button1Click(Sender: TObject); begin FDQuery.Close; // to execute a new statement, or end session! for example // // you can use this way to new statment, be OPEN or EXECUTE! //FDQuery.SQL.Text := '.... new statement ....'; // FDQuery.ExecSQL('your Insert,Delete, Update expression'); // to execute your command // // to open your query with data refreshed FDQuery.Open('your Select... expression'); // to show your data-set result // FDQuery.Close; // to close your query."OPENED" end; I think that your "error" should be because your "statement" is wrong!!!! try see what is the SQL text after "qry.SQL.Assign(m1.Lines);" ShowMessage( qry.SQL.Text );
  5. Progress update.. Success! and Resolved! Thanks to the help here, I now have a working delete method that will do what I need. Below is what I decided to implement, crude but works. var Form1: TForm1; LSQLText: string; // SQL string for [deleting last row] LastRowValue: string; // from StringGrid . . procedure TForm1.btnDelLastRowClick(Sender: TObject); // this routine works! 12/4/sun late pm // delete last row, but is actually [current row selected in stringgrid] begin LastRowValue := sg1.Cells[sg1.Col,sg1.Row]; beep; LSQLText := Format('delete from tblBarcodes where IDNo=%s', [LastRowValue]); // do the row deletion here.. qry.SQL.Clear; //('delete from tblBarcodes where IDNO=2'); // <-- i.e., qry.SQL.Add(LSQLText+';'); qry.SQL.Add('select * from tblBarcodes;'); qry.ExecSQL; // show me the updated list conn.Connected:=true; qry.Active:=true; end; However, I now have another problem, but I will post a new topic for that. Thank you all for your responses.
  6. Fr0sT.Brutal

    Create multiple instances of tApplication with multiple MainThreads?

    https://supportcenter.devexpress.com/ticket/details/q267890/cxgrid-and-async-fetch Maybe this will help? Googled it in 1 minute
  7. programmerdelphi2k

    Keep getting Expected and identifier but received VAR same for IN and Contains

    my fault: change " for var in AFilenames do" by "for var F in AFilenames do" xxx.AddFilenames( [ 'name1', 'name2', etc... ] );
  8. Something simple like this will at least check (2) and (3). It won't check (1) but that should be done at entry (only allow unique student/answer combinations). select student, if((count(*)>1) and (max(answer)>7), 'INVALID', 'Valid') as Result from data1 group by student https://dbfiddle.uk/d-QSR_4l student Result 100 Valid 101 INVALID If you really want to check (1) you can do it with a sub-select with count on total number of answers and total number of unique answers. Something like: select student, if((sum(cnt)<>count(*)) or ((count(*)>1) and (max(answer)>7)), 'INVALID', 'Valid') as Result from ( select student, answer, count(*) as cnt from data1 group by student, answer ) as sub group by student https://dbfiddle.uk/B3JmU1_S student Result 100 Valid 101 INVALID 102 INVALID 103 Valid 104 INVALID
  9. Stefan Glienke

    Patch a private virtual method

    Yes, and I never stated otherwise - I just pointed out that you can patch virtual methods selectively by replacing them in the VMT. inherited calls would also still call into the old method with that approach. FWIW the approach you wrote for private virtual method works as well for a non virtual method. In fact the technique of hooking methods by placing a jmp has nothing to do with how the methods are being called. Especially for patching known code (i.e. RTL and alike) I rather write byte scanning code for finding the place I want to patch - yes such code has to be changed when you migrate to another version. But with that you can patch any code even if it's hidden deep within the private section of some classes or in the implementation part of a unit.
×