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).
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...
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.


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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
java constructor error 8 86
mergeTwo  challenge 13 71
noX challenge 17 76
countPairs challenge 7 58
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now