troubleshooting Question

Overload resolution failed because no accessible 'Fields' accepts this number of arguments.

Avatar of ljhodgett
ljhodgett asked on
Visual Basic.NET
2 Comments1 Solution642 ViewsLast Modified:
Hi Experts,

I have the following code: -

Dim rs As ADODB.Recordset

        Connect()
        rs = conn.Execute("SELECT * FROM config")

        Me.Text = rs!RigTitle
        MyString = rs!SSDNo
        If MyString.Length = 4 And IsNumeric(rs!SSDNo) Then
            TxtSSDNo.Text = rs!SSDNo
        Else
            ErrorNo = 2
        End If

        MyString = rs!RoutingStage
        If MyString.Length = 3 And IsNumeric(rs!RoutingStage) Then
            StageRef = rs!RoutingStage
        Else
            ErrorNo = 3
        End If

        WorkingDatabase = "testdata"
        If WorkingDatabase = "" Then
            ErrorNo = 4
        Else
            AxLogResults1.set_SET_DataBaseName(WorkingDatabase)
        End If

        If Not IsNumeric(rs!comsport890) Then
            ErrorNo = 5
        Else
            CommsPort = CDec(rs!comsport890)
        End If

        If Not IsNumeric(rs!CtrlPort890) Then
            ErrorNo = 6
        Else
            ControlPort = CDec(rs!CtrlPort890)
        End If

        If Not IsNumeric(rs!MeterPort) Then
            ErrorNo = 7
        Else
            MeterPort = CDec(rs!MeterPort)
        End If

        rs.Close()
        conn.Close()


This has been taken from a vb6 program. When I place it into vb.net 2005 I get the error message and an underline on all parts of code that start “rs!” ie, “rs!MeterPort”: -

Overload resolution failed because no accessible 'Fields' accepts this number of arguments.      

What is this please and how do I overcome this. Sorry I’m new to vb.net and currently migrating from vb6.

Many Thanks

Lee


Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros