Results 1 to 2 of 2

Thread: vb- vb.net ado.net code conversion

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2007
    Posts
    1

    vb- vb.net ado.net code conversion

    can someone help me converting the following code in to vb.net lz plz plz its very urgent
    Code:
    Sub assess()
    
    Dim db As Database
    Dim healthTbl As Recordset
    Dim assessmentTbl As Recordset
    Dim prepCSITbl As Recordset
    Dim prepStltSmtTbl As Recordset
    
    '***********************************
    Set db = CurrentDb()
    Set assessmentTbl = db.OpenRecordset("APM_Assessment", dbOpenDynaset)
    Set healthTbl = db.OpenRecordset("AppID", dbOpenDynaset)
    Set prepCSITbl = db.OpenRecordset("Prep_CSI", dbOpenDynaset)
    Set prepStltSmtTbl = db.OpenRecordset("Prep_STLT_SMT", dbOpenDynaset)
    
    '-----------------------
    ' Start to loop through all records
    
    If healthTbl.EOF = True Then Exit Sub
    If Not healthTbl.EOF Then healthTbl.MoveFirst ' healthTbl.MoveFirst
    If Not assessmentTbl.EOF Then assessmentTbl.MoveFirst ' assessmentTbl.MoveFirst
    
    Do While Not healthTbl.EOF ' Keep on looping until we go beyond the last record
        If assessmentTbl.EOF = True Then
            assessmentTbl.AddNew
        Else
            assessmentTbl.Edit
        End If
            
        assessmentTbl!AppID = healthTbl!AppID
        
    '''' FIND STLT
     
        prepCSITbl.FindFirst ("AppID = " & healthTbl!AppID)
        If Not prepCSITbl.NoMatch Then
            prepStltSmtTbl.FindFirst ("SMT = '" & prepCSITbl!SMTLname & "'")
            If Not prepStltSmtTbl.NoMatch Then
                assessmentTbl!stlt = prepStltSmtTbl!stlt
            Else
                assessmentTbl!Debug = "NO MAPPING OF STLT"
            End If
        Else
            assessmentTbl!Debug = "NO SMT FOUND IN MAPPING"
        End If
    assessmentTbl.Update ' Save the contents of the copy buffer to disk
     healthTbl.MoveNext ' Make the next record the current record
    Loop
    End Sub
    THANK YOU IN ADVANCE
    Last edited by Hack; Nov 12th, 2007 at 12:47 PM. Reason: Added Code Tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width