473,383 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

using LSET to load records into types in VB6 - how to do in .NET

Hi,
In VB6 I wrote an application that had to read lots of fixed length disk
records from another system. These records were divided up into many fixed
length fields.

In VB6 the easy solution to breaking up the record into the fields was to
define all the fields in a VB6 Type as fixed length strings and then use Lset
to load the record into the type - worked a treat.

However this won't work in .NET - and I haven't see any easy alternative.

Any ideas ?

Regards
Michael
Jul 21 '05 #1
2 2099

"Michael" <mi***********@solventgreen.com.nospam> schrieb im Newsbeitrag news:AA**********************************@microsof t.com...
Hi,
In VB6 I wrote an application that had to read lots of fixed length disk
records from another system. These records were divided up into many fixed
length fields.

In VB6 the easy solution to breaking up the record into the fields was to
define all the fields in a VB6 Type as fixed length strings and then use Lset
to load the record into the type - worked a treat.

However this won't work in .NET - and I haven't see any easy alternative.

Any ideas ?

Perhaps the following MSDN article about marshalling a structure with fixed length
arrays will help you:

http://msdn.microsoft.com/library/de...filesample.asp

Another solution would be to use the VB6 application and export some Read methods, via
COM and using COM interop in the .NET application

Hope that helps.
Andre

Regards
Michael

Jul 21 '05 #2
Andre,
Thanks for that - but specifying the fields as fixed length strings via
marshalling I had already figured out.

The question is - how to get a fixed length disk record loaded into that
type ?

Regards
Michael

"Andre Kaufmann" wrote:

"Michael" <mi***********@solventgreen.com.nospam> schrieb im Newsbeitrag news:AA**********************************@microsof t.com...
Hi,
In VB6 I wrote an application that had to read lots of fixed length disk
records from another system. These records were divided up into many fixed
length fields.

In VB6 the easy solution to breaking up the record into the fields was to
define all the fields in a VB6 Type as fixed length strings and then use Lset
to load the record into the type - worked a treat.

However this won't work in .NET - and I haven't see any easy alternative.

Any ideas ?


Perhaps the following MSDN article about marshalling a structure with fixed length
arrays will help you:

http://msdn.microsoft.com/library/de...filesample.asp

Another solution would be to use the VB6 application and export some Read methods, via
COM and using COM interop in the .NET application

Hope that helps.
Andre

Regards
Michael


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Lucky | last post by:
I have a vb.net windows app that connects to an access database. The database has 1 table. One of the columns is called "Address". A user enters any address into a textbox (txtValue) then clicks...
6
by: DH | last post by:
We have a VB6 windows application. It had LSet to assign a User_Defined Type, a string, into another User_Defined Type, an Array of String. It looked like Type tPTStrin PTString As String * 2...
7
by: johkar | last post by:
I am confused on childNodes or children. When you have nested lists, I would think it would all be one list in the Dom, this doesn't seem to be the case. So how do you traverse an unordered list?...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
3
by: TT (Tom Tempelaere) | last post by:
Hi there I am making a service project in C#, and I'm in the process of writing the installer. I made an installer class by using the "Add Installer" menu-item in the design window of the service,...
2
by: Michael | last post by:
Hi, In VB6 I wrote an application that had to read lots of fixed length disk records from another system. These records were divided up into many fixed length fields. In VB6 the easy solution...
7
by: John | last post by:
hi, i have created a search form, and i want to search for a specific item in a field. e.g. i have a field called colour, which has record1 = 'red, blue, green' and another record2 = 'red' ...
8
by: sexauthor | last post by:
I'm converting a VB6 application over that called a 3rd party DLL with specific data structures. The VB6 code defined custom types for those data structures (ie: one with the specific data types,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.