Visit our Sponsor   Visit our Sponsor
delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
497 Users Online NOW
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback





Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi



Loremo - the 1.5 liter car coming in 2009




Startblatt.de






Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (0)


Converting ASCII to ParadoxFormat this article printer-friendly!Bookmark function is only available for registered users!
Exports delimited file to a Paradox table
Product:
Delphi all versions
Category:
DB-General
Skill Level:
Scoring:
Last Update:
06/15/2003
Search Keys:
delphi delphi3000 article borland vcl code-snippet ASCII PARADOX CONVERT
Times Scored:
3
Visits:
1769
Uploader: G N
Company:
Reference: N/A
 
Question/Problem/Abstract:
How to Convert an ASCII file to a Paradox Table
Answer:



First create your paradox table to match the structure of the ASCII file.

I - Creationg the scheme file :

Drop on the form 1 TBatchMove and 2 TTable and 1 TButton

click the Batchmove Component and set "Mode" to batCopy, "Source" to Table1
and "Destination" to Table2

click the Table1 component and set "TableName" to (the name of your Paradox table)

click the Table2 component and set "TableName" to ASCII.TXT, "TableType" to ttASCII

Double click on the Button, and Put this code : Batchmove.Execute

Press F9 and click the button the result is the creation of these files :
ASCII.TXT and ASCII.SCH.


II -
Open the ASCII.SCH file with notepad or edit.
you'll get a file like this :
[ASCII]
Filetype=Fixed
Field1=PARADOXField1,Type,length,00  (first field)
-------------
------------

Fieldn=PARADOXFieldn,Type,length,Position   (first char of the last field)
CharSet=ascii
;end of the file

Type : must be Char, Float,....
Lenght : length of each field of the paradox file
position: position of the first char or number in your ascii file position begin with '00'
if your ascii file contain separator (for example ';')
add this line after Filetype
Separator=;
Then  change [ASCII] to the name of your Ascii file
Change 'Filetype=' from Fixed to Varying
Save the Sheme file to the name of your ASCCI file (SaveAs)

in your form make these change
Table2 : Set 'TableName' to the name of your ascii file

Batchmove: Set 'Source' to Table2 and 'Destination' to Table1

Run your program and click in the Button.

Now open your Paradox table with Database Desktop.

N B : if you have float or numeric field make change of the lenght of these field in your Scheme File.





Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment













 
Sign up to consume product discounts for Bronze memberships !

read more


  Visit our Sponsor

 

  Community Ad of
L. Rosenstein
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)