ADODB - Probleme mit alten Befehlen

  • VB.NET

    ADODB - Probleme mit alten Befehlen

    Ich bin dabei mithilfe eines alten vb6 Buches eine Datenbankanwendung zu programmieren. Im Buch kommt der Functions Typ "Field" vor. Durch was kann ich das in vb2008 ersetzen?

    Hier ein Ausschnitt:

    VB.NET-Quellcode

    1. ...
    2. ReadRecord()
    3. End SubPrivate Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
    4. cnnADO.Close()
    5. End SubPrivate Sub ReadRecord()
    6. txtID.Text = GetValue(rsADO!PubID)
    7. txtName.Text = GetValue(rsADO![Company_Name])
    8. txtStadt.Text = GetValue(rsADO!City)
    9. txtStaat.Text = GetValue(rsADO!State)lblNr.Text = "Datensatz " & rsADO.AbsolutePosition & " von " & rsADO.RecordCount
    10. End Sub
    11. Private Function GetValue(ByVal fld As Field) As String
    12. If IsDBNull(fld) Then
    13. GetValue = ""
    14. Else
    15. GetValue = fld
    16. End IfEnd Function


    mfg