Migrating VB6 to VB.net

I just converted a vb6 to vb.net.....but on the converted version the program crashes when it reaches... recordSet.let_ActiveConnection(Nothing)...i also got a

'UPGRADE_NOTE: Object rs.ActiveConnection may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm keyword="vbup1029"'

on the converted one. I was just wondering how i would be able to fix it. The error i am getting is "Arguments are of the wrong type, are out of acceptable range, or are in conglit with on another."

Thanks

 




Answer this question

Migrating VB6 to VB.net

  • Mahmoud Gourar

    yap...i fixed that...i am getting a new error now.

    Run-time exception thrown : System.Security.SecurityException - Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED).

    at

    test = test2.OpenAsTextStream(Scripting.IOMode.ForWriting)

    where test is a Scripting.TextStream   and test2 the Scripting.File. This error does now seem to come in vb6 it works perfactly on vb6 but throws that error in vb.net.

    Thanks for all your help



  • Daniel Schloesser

    also i am getting the following message for

    Trim(rs.Fields("Title").Value = ""

    ERROR: '"Run-time exception thrown : System.InvalidCastException - Cast from type 'DBNull' to type 'String' is not valid."

    how can this be fixrd...

    Thanks Guys



  • Khamul

    rs.Fields("title").value is having dbnull value, so you cannot use Trim on it.

    try to check for IsDBNULL(rs.Fields("title").Value) and trim.

  • wslee

    change it to this:
    recordSet.ActiveConnection=(Nothing)...

  • Prakashnet

    do test.close() after any writes you may have...


    you could rewrite with system.io classes

    Dim o1 As New System.IO.StreamWriter("test.txt")

    o1.WriteLine("hello")

    o1.Close()


  • Migrating VB6 to VB.net