Questions tagged [vb6-migration]

This tag is for questions about migrating existing applications, or legacy code, from Visual Basic 6 to a more modern platform. Unfortunately migration is usually a tricky task. The most common target platforms are VB.NET and C#.

Here are some typical motives for migration

  • To use a more modern programming language for enhancements.
    • This will give some increase in productivity.
    • This also keeps the developers happy, which is a valid business benefit in itself. There are bigger gains in productivity from attracting and retaining good developers than anything else.
  • To use a fully supported programming stack.
    • Although the VB6 runtime is still fully supported by Microsoft as part of Windows, many people worry that support will be dropped one day. The VB6 IDE is no longer supported.

Frequently asked questions

669 questions
4
votes
2 answers

Porting CDate(long) from VB6 to C#

I have been tasked with converting an old VB6 program to to C#. One function I have been having trouble porting over is the calculation of a birthdate from a filed that was read from a binary file: .BirthDate = CDate((CLng(recPatient.birthDateByte2)…
Scott Chamberlain
  • 124,994
  • 33
  • 282
  • 431
4
votes
1 answer

Upgrade VB6 Container Class to VB.NET

Okay, so I'm upgrading a VB6 app to VB.NET and I'm unsure of how to modernize the class_terminate component of a container class I'm building: Private Sub class_terminate() If Not (colUserMappings Is Nothing) Then Set colUserMappings =…
Adam Boyce
  • 98
  • 1
  • 6
4
votes
4 answers

VB6 Migration Advice

I know a lot of question regarding VB6 migration have been asked, but I don't believe my exact situation has been answered in them. Basically, our company is wanting to migrate our mission-critical VB6 Line-of-business app that is quite large, uses…
Dan McGrath
  • 41,220
  • 11
  • 99
  • 130
4
votes
2 answers

How to recompile ActiveX grid control (VB6) as 64-bit OCX?

We have been working on our ActiveX grid control since 2000 and have a lot of happy customers. The control is still supported, but the main problem we and our customers have recently faced is the 64-bit editions of MS Office VBA our grid control is…
TecMan
  • 2,743
  • 2
  • 30
  • 64
4
votes
1 answer

Read Random Access File in C#

Does anyone know if it is possible to read random access files in C#? I am trying to replicate the following function (from an old VB6 application) in C# - Open File For Random Shared As #100 Len = Len(Record) Get #100, DM, Record Close…
user1948635
  • 1,357
  • 4
  • 15
  • 22
4
votes
1 answer

Implementing property must have matching 'ReadOnly' or 'WriteOnly' specifiers

I have an interface defined in an idl file and trying to convert a vb6 project to vb.net. The conversion created the interop from the tlb of this idl and in vs2010 it complains about the property not being implemented (as shown below). Does anyone…
lee23
  • 409
  • 1
  • 3
  • 10
4
votes
2 answers

VB6 and C# regexes

I need to convert a VB6(which I'm not fammiliar with) project to C# 4.0 one. The project contains some regexes for string validation. I need to know if the regexes behave the same in both cases, so if i just copy the regex string from the VB6…
Ioana O
  • 197
  • 1
  • 10
4
votes
3 answers

VB6 to VB.NET Visual Studio Upgrade Wizard hates some of my variable names

I am upgrading a VB6 to VB.NET project using the upgrade wizard. I know this is going to give me a lot of grief, but I am trying to make the old application useable. I'd rewrite it if I had time but am currently finishing up a summer internship and…
user142350
  • 222
  • 4
  • 15
3
votes
2 answers

how to print (on printer) table from database using c#

I work on some project that is migrating from vb6 to web (asp.net). I need to print some kind of report - A table from database and number of simple headers with date and time. In vb it was implemented using vsPrinter object. Is there any Class in…
Boltosaurus
  • 2,138
  • 3
  • 21
  • 33
3
votes
2 answers

How to rewrite "LSet" from VB6 in VB.net (with structure types)?

I have an VB6 application which uses LSet() with two user defined data types (Type), to assign data from one type to another, e.g.: Lset type1 = Type2 Now I have to apply equivalent logic in VB.net. However, in VB.net, LSet cannot be used against…
Rajdeep
  • 485
  • 4
  • 15
  • 28
3
votes
2 answers

Convert VB6 app to WPF?

Is it possible to convert a VB6 app to WPF using automated tools? I'm aware of tools to convert to Winforms, but what about WPF? Is there a pathway from Winforms to WPF that could be utilised?
CJ7
  • 22,579
  • 65
  • 193
  • 321
3
votes
2 answers

How can I adapt a 32-bit VB6 application to work with 64-bit Office?

I have an application developed in VB 6.0 and VBA that uses latest Office 32 bit version. But since this application is 32 bit, it does not run on systems where 64 bit Office versions are installed. What is the best strategy I have to adopt to port…
Siva
  • 170
  • 1
  • 3
  • 11
3
votes
3 answers

Line Input # statement, three lines the same. Will it overwrite the variable each time?

In a program I am migrating from vb6 to VB.net, there are three Line Input# statements, all the same: Line Input #9, dummy Line Input #9, dummy Line Input #9, dummy Will this just overwrite the variable each time, or do something stupid like…
Nick
  • 147
  • 1
  • 5
  • 16
3
votes
1 answer

Format and indent Json string in vb6

I just have this string: dim stringa as…
user1579247
  • 107
  • 1
  • 6
3
votes
0 answers

"Unable to open company file" message returned (Sage 50 Canada)

We're developing a COM-aware .Net assembly that is used in a legacy VB6 app and keep getting the above message when opening a connection via SDKInstanceManager.Instance.OpenDatabase. When we call our method from inside another .Net assembly this…
MikeG001
  • 53
  • 4