How to access RDO with VB 5.0 and MS SQL Server 5.0 
Author Message
 How to access RDO with VB 5.0 and MS SQL Server 5.0

How do you do updates using VB 5.0 using RDO to SQL Server 6.5 and transaction processing.

I know that with DAO I do the following....

____________________________
workspace.BeginTransaction

do until stop
        recordset.Edit
                some field here to edit
        recordset.update
loop

workspace.committrans
____________________________

Here are the steps I have for rdo. Please correct as necessary...

____________________________
Step 1: A Connectioni established using this connect string
("UID=a;PWD=b;DATABASE=c;SERVER=e;DRIVER={SQL SERVER};DSN='';") and the following function called
Connect.....The function resides in an ACTIVE X DLL

Public Function Connect(sConnect As String) As Boolean

    Dim TimeExpected As Single
    Dim Ts As Single, Tn As Single

    On Error GoTo ConnectError

    TimeExpected = 15

    Connect = True

    Set cn = New rdoConnection

    With cn
        .Connect = sConnect
        .CursorDriver = rdUseServer
        .EstablishConnection rdDriverNoPrompt, False, rdAsyncEnable
        .QueryTimeout = 0

        DoEvents
        While .StillConnecting
            Tn = Int(Timer - Ts)
            If Tn < TimeExpected Then
            Else
                TimeExpected = TimeExpected + 10
            End If
            DoEvents
        Wend

    End With

    Exit Function

ConnectError:
    Dim merror As rdoerror

    For Each merror In rdoEngine.rdoErrors
        With merror
            MsgBox .Number & " " & .Description, vbCritical, "clsAdmin connect error"
        End With
    Next merror

    Connect = False

End Function

Step 2: An updateable RDO resultset is created using the following code....(this is a fragment
only).  CParams is a collection that is passed into this fragment.

            For x = 1 To CParams.Count
                If CParams.Item(x) = CParams.Item("SqlString") Then
                    'Set rs = cn.OpenResultset(CParams.Item(x), rdOpenDynamic, rdConcurLock,
rdExecDirect)
                    Set rs = cn.OpenResultset(CParams.Item(x), rdOpenKeyset, rdConcurLock,
rdExecDirect)
                End If
            Next
____________________________

Lawrence M. Seldin, CMC, CPC
Author of POWER TIPS FOR THE APPLE NEWTON and INTRODUCTION TO CSP



http://www.*-*-*.com/



Sun, 18 Feb 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. VB 5.0 Enterprise Edition does not contain MS SQL Server 6.5 Developer Edition

2. True DB Grid 5.0 and VB 5.0 using RDO

3. True DB Grid 5.0 and VB 5.0 using RDO

4. Can I access to SQL Server with CR 4.1.6 (with VB 5.0)

5. Can't access to SQL Server with Crystal Report for VB 5.0

6. HELP !!! VB 5.0 + GRAPHICS SERVER 5.0

7. US-NY-New York City-Visual Basic-MS ACCESS-SQL Server-SYBASE-RDO

8. Accessing MS SQL Server Text Fields via RDO

9. Accessing MS SQL Server Text Field via RDO

10. VB 5.0/Crystal Reports/ MS SQL Task Scherduler

11. VB 5.0 and SQL Server 6.5 Contract

12. Problem with SQL Server, VB 5.0 using a Grid and RDC

 

 
Powered by phpBB® Forum Software