Search the Community
Showing results for tags 'copy'.
Found 3 results
-
I have two MS Access databases that I am reading through firedac in Delphi. I have an activity that I do every day: 1) I copy the source "data_Notes.mdb" and rename the copied version to "db.mdb". 2) Then I open the "db.mdb" in a delphi app for viewing certain info. 3) Then, when I'm finished, I delete the db file "db.mdb" and go through steps 1 through 3, thus rinse and repeat. However, I'd like to automate the process like this: (assuming I kept the "db.mdb" file in tact) 1) I delete the table "tblMyNotes" -- I already know how to do this in delphi code 2) copy the table "tblMyNotes" from the source db "data_MyNotes.mdb" -- I don't know how to do in delphi code 3) do whatever i want as usual with the table "tblMyNotes" 4) when I'm done, go through steps 1-3 again, re-copy it again, thus, rinse and repeat. The problem I am having is how to do the copying of the table from the source db to the "db.mdb" through delphi code. I am trying to find code that is as minimal and understandable as possible. So far, I have found this link, which seems to have what I am looking for, (a one-line SQL script to copy the table) but I can not understand fully what is going on, in order to get it to work, assuming this is one example of doing it. link: https://stackoverflow.com/questions/12242772/easiest-way-to-copy-a-table-from-one-database-to-another I have the following on my form: connection -> table -> ds-source I am testing various scenarios and have trying the following script, but it fails: Table.SQL.Add('CREATE TABLE tblTest SELECT * FROM "g:\data_notes.mdb".tblMyNotes'); Please advise your correction/suggestions, and TIA.
-
properties Is it possible to copy all properties from one TMemo to a dynamically created TMemo?
JohnLM posted a topic in VCL
Specs: XE7, VCL, Win7 I have a Panel with a TabControl in it and a Memo inside the first TabSheet on a Form that was all created and configured during design time. And, on the Form in another Panel, I have a [Add] button to dynamically create a new TabSheet and Memo. The main Memo is the default with all the settings that I would like the dynamically created Memos to have. But setting up all the necessary properties would be tedious and if I change something in the main Memo at design-time, I may not remember to update that to the dynamic ones. var Form1: TForm1; idx: integer=0; // index numb, for adding new tabs to the pagecontrol. procedure TForm1.btnAddClick(Sender: TObject); var TabSheet: TTabSheet; memo: TMemo; begin inc(idx); TabSheet := TTabSheet.Create(PageControl1); TabSheet.Caption := 'Untitled-'+idx.ToString; TabSheet.PageControl := PageControl1; memo := tmemo.Create(pagecontrol1); // settings section memo.Color := $0017110D; memo.Align := alClient; . . . // end of settings section memo.Parent := tabsheet; memo.Show; memo.SetFocus; end; note: I have a lot more properties than what is posted above. Is there a better way to copy all the properties of the main Memo to the dynamically created ones and how can I do this?- 15 replies
-
- delphi xe7
- copy
-
(and 1 more)
Tagged with:
-
I have a running app that has a bitmap object on it and i have a dll that creates a bitmap. without saving to disk or clipboard, i need to copy from dll bitmap to the app bitmap. i have the handle of the app in the dll and have the workings of trying to find the bitmap object in the app. but i need to figure out how would i go about copying the bitmap over.