Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with a recordset
Message
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00654722
Message ID:
00654724
Views:
16
Ok, I have been able to get the query to work, and I have what I believe to be an updatable recordset. I get no errors as the code works, but the data on the server is not update. Any help appreciated.
    Dim rstX As ADODB.Recordset
    Set rstX = New ADODB.Recordset
    rstX.CursorLocation = adUseClient
    ctQuery = "Select * from Patients where mpinumber = '" & Trim(sLookUpID) & "'"
    rstX.Open ctQuery, "Provider=MSDASQL.1;UID=ctore;pwd=cqi$$;Data Source=ctore", adOpenKeyset, adLockOptimistic
    
    rstX.MoveLast
    
    iRecords = rstX.RecordCount
    
    
    If iRecords > 0 Then
        ' Update record with stuff from message
        rstX.MoveFirst
        rstX!LastName = mPID.PatientName.FamilyName.Value
        rstX!Firstname = mPID.PatientName.GivenName.Value
        rstX.Update
    Else
        ' Insert Record
        MsgBox ("New Record")
    End If
    rstX.Close
Previous
Reply
Map
View

Click here to load this message in the networking platform