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
-1
votes
3 answers

Adding a "-" with String.Format VB.Net

I am trying to get an item such as WO123000 to come out as WO-123000. Here is the code, but it isn't working for me. WorkOrder = String.Format("{0:##-######}", Trim(WorkOrderNum)) This is where WorkOrderNum is WO123000. This error stems from…
-1
votes
2 answers

VB6.Format needing to format a string

I am currently using VB6.Format to format a string such as 2 to 2.000 or from 100.000, but I have been looking on here at examples and haven't been able to figure out how to use the ToString or String.Format to get this working correctly. It needs…
-1
votes
1 answer

Call PopupMenu VB.NET Framework 2.0

I have a project that I have converted from VB6 to .NET, using Visual Studio 2008 with the framework 2.0. In VB6 you can call a PopupMenu like so: Call Me.PopupMenu(mnuEstimating) I tired to use the same code in .NET but I get the…
nate
  • 1,418
  • 5
  • 34
  • 73
-1
votes
1 answer

Runtime errors might occur when converting 'dao.Field' to 'String'. VB6 to VB.NET

I have converted a VB6 project to VB.NET using Visual Studio 2008. I have some code that throws an error for invalid cast type when for doa.Field to String Type. Here is the code that I am working with: If rstLogin.BOF = True And rstLogin.EOF = True…
nate
  • 1,418
  • 5
  • 34
  • 73
-1
votes
2 answers

Type Mismatching VB6 Error handling

I am running some legacy VB6 code on a 64bit Windows 7 machine and am running into some weird errors. my code blows up here: with the message: a whole section of code above this error handling is precededed by: On Error GoTo ErrorTrap ErrorTrap…
jth41
  • 3,808
  • 9
  • 59
  • 109
-1
votes
2 answers

Works in VB.NET but not in C# - byte conversion

So I am migrating some code from VB.NET to C# however it fails when it is doing a byte parse in C#. here is the VB.NET code would works: Dim sModifiedAccountNumber_AsciiHex Dim iByte As Byte = 0 Dim iIdx As Integer = 0 Dim strByte As String =…
Ahmed ilyas
  • 5,722
  • 8
  • 44
  • 72
-2
votes
2 answers

Break VB6 project into chunks to use free version of Artinsoft

I am trying to convert a large (200K lines) VB6 project into C#. I only want to convert the form design because I want to rewrite all the actual code in C#. I want to use the free Artinsoft converter but this only allows projects of 10K lines. I am…
CJ7
  • 22,579
  • 65
  • 193
  • 321
-2
votes
1 answer

Migrating VB6 code for printing on Dot Matrix Printer to VB.Net

I have VB6 code to print on dot matrix printer. It works very well but now I want to upgrade to VB.net. How can I adapt the same printing code to VB.net? Close #1 Open "output.txt" For Output As #1 prntitle Set salinvrs =…
-2
votes
2 answers

VB6 ADO data control equivalent to vb.net?

I am migrating vb6 projects to vb.net, Few components are not able to migrate properly with upgrade issues. So I want to manually program those things. But I can't recognize what is the equivalent component available in vb.net. eg., I used Data…
praveenkumar s
  • 325
  • 4
  • 16
-2
votes
2 answers

VB6 StrPtr Function to VB.NET

Trying to convert VB6 line of code to VB.net. Code will serve as identification if printer is OFF or ON Thanks "PRINTERFOUND = OpenPrinterW(StrPtr(PrinterName), hPrinter)" Particular StrPtr function... Can't get OpenPrinter to work - Tries to print…
Alek
  • 35
  • 1
  • 9
-2
votes
2 answers

Convert VB6 to VB.NET

The code in VB6 is: ------------------------------ Load(Inter_pol_surfex) ------------------------------ The message error is: ------------------------------ Name 'Load' is not declared. ------------------------------ Can I recieve the code to fix…
B.Pizhev
  • 7
  • 6
-2
votes
1 answer

Using LSet from VB6 to C#?

I'm currently converting VB6 to C#. Can you help me convert this code? Here's the VB6 code: 'This converts the bytes into test parameters Sub getParamValues(ByRef TransData() As Byte, ByRef testparam() As Single, startbyte As Integer) Dim tmpdata As…
-2
votes
1 answer

Upgrade vb6 to VB.Net: Name "load" is not declared

I have a problem in upgrading a program from VB6 to .NET which I hope someone can help me with. I am a new .NET programmer so I hope you can be quite specific in your assistance as my knowledge base is very low. I get 3 errors which are the same…
-2
votes
1 answer

recordset.close got wrong help plssss

Help my code got wrong it says: Either BOF or EOF is True, or the current record has been deleted,Requested operation requires a current record. i think this rs.close has a problem or where can i set the rs.close? because i set and used recordset…
illidan
  • 41
  • 1
  • 7
-3
votes
1 answer

Could not load referenced component: vsocx6.ocx

My company is looking to upgrade/convert an old VB6 application into the .NET framework. After some research, the best option seems to be to use Visual Studio '08 and run the "Upgrade Wizard" when opening the project. When I try to do so, I am given…
1 2 3
44
45