How to use the urbo pascal data file with extension DTA in VB to Add records

Posted on 2006-06-13
Last Modified: 2008-02-07

I need to use a data file with extension DTA, it looks like it is turbo pascal data file. I am wandering is there any way I could use this data file in VB to add records to this data file which will be use and display data by other famous accounting software SAGE. If anybody could help me in this matter, I will be very greatfull.

Question by:Shahbazomeara
  • 3
  • 2
  • 2
  • +2
LVL 15

Expert Comment

ID: 16892635
If it's a data file, you can of course add stuff to it. Do you have the file name, the size, where it came from , etc. From that someone may be able to take an educated guess as to its contents.

Expert Comment

ID: 16893167
It depends on the application that created the data file. If you have the source code, it should be easy enough to decode the format and recreate it in your program. Some appliactions also come with a specification describing the file format, and it's up to you to write code to handle it.

If you do not have access to source code or file definition, then things can be considerably more difficult, because you have to try and guess (or reverse engineer) the meanoing of the data in the file. Some files are fairly easy to decode as they have obvious field and record delimiters, or en easily decipherable fixed width. You can also run into difficulties where different sections within a file mean different things. For example, you could have a header record which would contain pointers to different segments of the file that contain different types of data, with different record lengths. Text fields are generally easy enough to figure out as you can usually see their contents, but numeric fields can often be stored in binary format, making them difficult to decode. Some applications actually encrypt their data, which can make them almost impossible to reverse engineer.

One approach that can be useful is to use a file compare utility to compare two versions of your file, before and after making a small change in the application.

Generally it's not too hard to write an application to read from another program's file, as you only need to enderstand enough to extract the data you need. However, writing to the file can be a nightmare, as you need to know every detail of how the file works. If you make the slightest mistake, you can render the file unreadable, so make sure you make backups!

Hope this gives you some ideas.
LVL 25

Expert Comment

ID: 16893482
As mentioned, it depends if the file is in a binary format (which would be really difficult without the source code), Or if the file is in a text based format (which should not be so difficult).
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

LVL 31

Expert Comment

ID: 16898322
You mention DTA extension... and Sage.  Sage uses DTA files to store Accounts Data.  There are four ways to access this Data within your own apps (1) Use Sage's export facilities: Reports actually, which can be to CSV format.  (2) Use ODBC, if Sage is installed correctly, you will find an ODBC driver listed - if using this you have Read access to everything in Sage - transaction data, customers, suppliers, the works.  You can't write to the data though.  (3) Sign up as a Sage developer and you will be given information on how to "drive" data into Sage - this is only worth it if the version of Sage being used by the target system isn't going to change much, and the budget is there to pay the quarterly Developer fees.  (4) A Hex editor is a useful tool, but I can't say more than that...

Author Comment

ID: 16901157
Thanks for your reply,

I will try to explain you what I need to do.
I have developed a software for Travel Agents which stores and print Invoices. Most of the travel agents who use my software they use Sage Instant Accounting software to manage their accounts, Its mean they will print invoice on my software and manaully enter the invoice information into sage to do posting to all relevant accounts.

That's why to reduce the manual work I am looking at the ways to import invoice information to sage, but the import facility in sage is not for importing invoices.
I can not use ODBC driver because it is read only, 3rd option was to Sage Data Object, To use data object I have to pay £1500 which I don't want to pay.

Can you think of any other way I could perform this action?
If you could help me in this matter, I will be very greatful.

LVL 15

Expert Comment

ID: 16901213
Maybe you can use ODBC to discover the file contents.

Expert Comment

ID: 16903264
You could possibly use screenscraping techniques to mimic the user entering into the Sage forms.

Good luck!

LVL 31

Expert Comment

ID: 16906138
Use the File Import, Audit Trail Transactions facility as outlined in your other question.

The thing to bear in mind is that, if the Customer has moved location, the image of the Invoice shows the address of the Customer as at the time the Invoice was raised.  Apart from that, the Invoicing facility in Sage is not very useful to you - the Invoice is simply an image of the Invoice as printed by Sage (useful for reprinting invoices - presumably your program can reprint invoices).  

Anything that is needed to meet statutory requirements is contained (1) on the Invoice document you produce (2) in the Sage Audit Trail.

Simply putting an Invoice into the Invoice list does not put it in the Audit Trail, which is where you really need it to go.  
LVL 31

Accepted Solution

moorhouselondon earned 250 total points
ID: 16906158
>as outlined in your other question.

Shunting a link across to here so that everyone can see

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Program to display an alert on Windows Toolbar 2 79
Not needed 13 113
Plain Text Editor for iPad 6 77
Getting the Error "User-defined type not defined" in MS Access 2013 16 63
I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
A short article about a problem I had getting the GPS LocationListener working.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

809 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