Results 1 to 4 of 4

Thread: ADO Problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Posts
    120
    i m trying to use withevents keyword on my recordset but i do not get to any event and i dont know why

    any help will be appreciated

    10x
    shachar shaty

  2. #2
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    From MSDN:

    Code:
    Dim WithEvent connEvent as Connection
    Dim conn as New Connection
    set connEvent = conn      'Turn on event support.
    conn.Open(...)
    ...
    set connEvent = Nothing   'Turn off event support.
    ...
    Private Sub connEvent_ConnectComplete(ByVal err as ADODB.Error, adStatus as ADODB.EventStatus, ByVal pConnectionas ADODB.Connection)
    'Check the error object only if adStatus equals adStatusErrorsOccurred.
    ...
    End Sub
    I know its for a connection, but the same principle should apply for a recordset
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  3. #3
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    Here you go:
    Code:
    Dim WithEvents Rs As Recordset
    Dim RecS As New Recordset
    
    Private Sub Form_Load()
    Set RecS = Rs
    End Sub
    
    Private Sub Rs_FetchComplete(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
    
    End Sub
    
    Private Sub Rs_FetchProgress(ByVal Progress As Long, ByVal MaxProgress As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
    
    End Sub
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Posts
    120
    first of all 10x but the same thing that you wrote
    for the recordset i tried and didnt succeed
    if you try it you will find out that it doesnt work
    with the recordset althogh it works on the connection
    shachar shaty

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