Question: IHow can I use translated resources (non-english)? Answer: |
Question: In own application I not use a BDE and don't want to deploy it. Can I disbale a BDE using for SMImport? If yes, then how? Answer: The SMImport allow to work with any database engine (BDE, ADO, DAO, IBX etc) and use a BDE for importing from Paradox/dBase only. So if you'll not use the TSMImportFromBDE component in own application or disable the Paradox and dBase formats from Formats property of TSMIWizardDlg component, your application will not require a BDE at all. |
Question: Where can I find a list of databases which are compartible with SMImport suite? Answer:
If you have some extended type of third-party database engine in which want to import a data, contact us. |
Question: By default after every loaded row the counter in animated status dialog is changed. How can I update it for every 100 rows? Answer: yourImportComp.Statistc.UpdateStep := 100 |
Question: Any recommendations for fast data loading... Answer: 1. don't use a CachedUpdates = True 2. don't use animated status dialog (or at least to
set Statistic->UpdateStep = 100 or 200) 3. the text file in "fixed width" format is faster than CSV because the positions for each field in each row are defined. But for CSV files for each row of text file the parser will "detect" these positions for each field 4. don't run an application within Delphi/C++Builder IDE (especially if you have a few breakpoints for debug) 5. disable animated status dialog (see AnimatedStatus property) or at least increase a number of rows in batch for repainting (see Statistic.UpdateStep property, by default 1 - to update after every loaded row) 6. to disable all events of updated TDataset (OnAfterPost/OnBeforePost/OnNewRecord etc). Also if you have a master/detail relations, disable this link before import starting... If you have some events on TFields of your TDataset, disable these events (OnValidate/OnSetText/OnGetText) too 7. the settings of BDE alias are very important too 8. better to use a direct database engine instead any universal engine (BDE, ADO, ODBC etc) 9. if you use a server database then you can:
I sure that these suggestions will increase a speed of data loading. You may download the demo project where I shown how to load large text file with weblog into Paradox table. On my computer 42 000+ rows from UNIX text file (CSV) are loaded in 28 seconds. The full time for text parsing and row processing included in this result time. This mean that 80-85 000 rows will be loaded per minute. Note that text file with fixed widths will be loaded even faster. |
Question: During data importing from MS Access database I have some warning dialogs inside Delphi/C++Builder IDE. What can I do? Answer: If you ran a project from Delphi IDE, you received a warning. But if you'll run a same project from Explorer (not from Delphi IDE), application will work without any warnings. PS: as alternative you can uncheck the "Stop on exception" option (or "Debug on exception" - it depends from Delphi version) in the Debugger Options item of Tools menu. You'll find this option on Language Exceptions page. |
Question: Can I load settings from specification file which is created by SMExport suite? Answer: Also don't forget that you can give a same functionality for your end-users by default - in wizard components (both in SMExport and in SMImport) your user can save/load the own specifications |
Question: Can I load some desired records only (using own criteria)? Answer: To solve this task you can use the OnBeforeRecord event where you can accept or not any parsed row from external file. For example, don't accept rows which contain empty CustomerID column in text file: begin for i := VarArrayLowBound(Values, 1) to VarArrayHighBound(Values, 1) do if (Values[i][1] = 'CustomerID') then begin Accept := not VarIsNull(Values[i][2]) and not VarIsEmpty(Values[i][2]) end else ... end; |
Question: Can I abort an import process using custom criteria? Answer: Sample below shown how to cancel an importing when more than 10 errors are coccured during data loading: procedure TForm1.SMImportFromText1AfterRecordEvent( Sender: TObject; var Abort: Boolean); begin Abort := (SMImportFromText1.Statistic.TotalErrors > 10) end; |
Question: Can I create own progressbar for import process? Answer: For this task you may in OnAfterRecordEvent to check a Statistic property. This property contain any information which you need - number of loaded records, number of errors, number of added/updated/deleted records etc Also there you'll find the LastAction sub-property (is a last record is added or updated or deleted) and Result which you can to check for errors or cancel process (by user). |
Question: How can I apply the updated version? Answer: 1. uninstall a previous version
2. install a new version from sources
IMPORTANT:
There you must have a folder with new version but not with previous. |
Question: How can I exclude a Paradox type for wizard component? Answer:
|
Question: User want to define the import settings but execute a long data loading tonight only. How can I do it? Answer: When your application must execute a loading, you can load a saved specification (see a LoadSpecification method) and call Execute method: yourImportComp.LoadSpecification('c:\data\specs\ohio_packet.smi'); Also in wizard component user can save and load specifications for future resuse. It's very useful because allow to save some predefined "templates" with more used settings which user can load and include some minor changes for succesful data loading. |
Question: How can I modify a some value of external file before field changing? Answer: Small sample: procedure TForm1.SMImportFromText( Sender: TObject; Field: TField; var Value: Variant); begin if Assigned(Field) and (Field.FieldName = 'CustomerID') then begin Value := 'OHIO_' + VarToStr(Value); end end; |
Question: How can I define values for AutoInc field? Answer:
|
Question: How can I use TSMImportFromAccess component? Answer:
It's all - just call Execute method of import component and data will be loaded. |
Question: How can I request the update for new version? Answer: When we'll recieve your message, we'll send you the confirmation that your request added in queue and will be processed soon. Most requests are processed during one-two business days and archive with registration version will be sent to you by email. Only delay is possible after new release when we recieve a lot of requests for update. IMPORTANT: Note that minor updates are free-of-charge. But all major releases are not free but available for discount. If you want to upgrade your licence for new major version, please contact sales@scalabium.com and we'll provide your a direct link for online order with discount. |
Question: How can I modify parsed values before apply? Answer:
For example, you want to remove all formatted chars for PRICE and PHONE fields and save pure digits: procedure TForm1.SMImportFromText1BeforeRecordEvent( Sender: TObject; const Fields: String; var Values: Variant; var Accept: Boolean); var i: Integer; s: string; v: Variant; begin for i := VarArrayLowBound(Values, 1) to VarArrayHighBound(Values, 1) do begin s := UpperCase(Values[i][0]); if (s = 'PRICE') then begin v := Values[i]; s := VarToStr(v[2]); s := StringReplace(s, ',', '', [rfReplaceAll]); v[2] := StrToInt(s); Values[i] := v; end else if (s = 'PHONE') then begin v := Values[i]; s := VarToStr(v[2]); s := StringReplace(s, '-', '', [rfReplaceAll]); v[2] := StrToInt(s); Values[i] := v; end end; end; The similar task could be solved in OnGetCellParams event. For example, to parse a string to datetime value: procedure TfrmMain.SMIWizardDlgGetCellParams( Sender: TObject; Field: TField; var Value: Variant); begin if Assigned(Field) and (Field.DataType in [ftDate, ftDateTime]) then begin {parse a date string DDMMYYYY} Value := Copy(Value, 1, 2) + DateSeparator + Copy(Value, 3, 2) + DateSeparator + Copy(Value, 5, 4); end; end; Note that most tasks could be solved without any programming - you may use extended expressions in Mappings and there transform data (for example, to convert a string to date for custom format). But, of course, exists some custom tasks that require additional programming for full control via events as described above. |
Question: How can I control the position for wizard dialog? Answer: For example: procedure TForm1.SMIWizardDlg1Show(Sender: TObject); begin with (Sender as TForm) do begin Position := poDesigned; Left := 5; Top := 5 end; end; Note that in this event you may also change another properties too - for example, to change the BorderStyle property. |
Question: How can I use field names with spaces? Answer: yourSMImport.Mappings.Add('ProcessDate="Date of Process"') As alternative, you may use brackets instead quotes yourSMImport.Mappings.Add('ProcessDate=[Date of Process]') Also note that same rule is correct if your field name have a same name as any pre-defined function in parser. For example: {load current date in field} yourSMImport.Mappings.Add('ProcessDate="Date"') |
Copyright© 1998-2024, Scalabium
Software. All rights reserved. |