Asked by:
Save and retrieve tabular data from .dat file VB

Question
-
HI,
We are trying figure out a solution to move data from a .dat file which was created in Visual Basic 6 to msaccess file.
Below is how the file looks when opened in Notepad.
And here is the output in the program. The contents are displayed in a Single Box (Had to user VB Decompiler to identify this).
We tried with a single data and below is how the output is saved to the .dat file.
This is the screen print of the data in application.
Any help would be highly helpful. We just need to read the .dat file and convert it to a MS-Access DB.
Coderv9
- Moved by Alex-KSGZ Friday, May 31, 2019 1:17 AM
Sunday, May 26, 2019 4:06 PM
All replies
-
Hello,
There is no direct method to do a port from a VB6 dat file to .NET. What I would suggest is in the VB6 app export the data in the .dat file into a text file, from here you can read the text file using a TextFieldParser .NET class to read in data where each line is a string array delimited (the delimiter is up to you). When reading the text file use an OleDbConnection coupled with a OleDbCommand with it's CommandText setup for a INSERT statement into your MS-Access database table(s). This is the least complicated but length process to get where you want in regards to transferring data to MS-Access.
Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
NuGet BaseConnectionLibrary for database connections.
Sunday, May 26, 2019 11:17 PM -
Thank you for the insight Karen. Problem here is the program don't have N option to export the list as text. The developer who created this application is no longer available and we are stuck with figuring how this is done.
Coderv9
Monday, May 27, 2019 1:53 PM -
Hello,
I figured there is no export within the current VB application, you need to write that yourself. If you are not sure how to write this I would suggest asking just this part of your question in the following classic Visual Basic forum.
http://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier
Once you have that (and I'd confident they can help) I can assist with the .NET aspect of this question.
Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
NuGet BaseConnectionLibrary for database connections.
Monday, May 27, 2019 2:00 PM -
Thank you Karen. I have posted my query in the forum. Hope some one could help me out... ☺☺
Coderv9
Thursday, May 30, 2019 3:28 PM