Results 1 to 2 of 2

Thread: [RESOLVED] Run time Error 3709

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2009
    Posts
    110

    Resolved [RESOLVED] Run time Error 3709

    Code:
    Private Sub cmdPrint_Click()
    If Opt1.Value = True Then
        Dim cnview As New ADODB.connection
        Dim rsview As New ADODB.Recordset
    
        'Call connection(cnview, App.Path & "\Seeyou.mdb", "endromida")
        Call connection(cnview, "\\SEEYOU-PC\shared\Seeyou.mdb", "endromida")
        Call Recordset(rsview, cnview, "SELECT * FROM fabric_shirt order by Fbcode asc")
    
        If rsview.RecordCount = 0 Then
        MsgBox "No Record Found On Query.", vbCritical, "Seeyou"
       
        Else
        Set fab_en.DataSource = rsview
        fab_en.Orientation = rptOrientLandscape
        fab_en.Show
        End If
    
        Set rsview = Nothing
    Else
    If Opt2.Value = True Then
        
        Dim tcnview As New ADODB.connection
        Dim trsview As New ADODB.Recordset
    
        Call connection(tcnview, App.Path & "\Seeyou.mdb", "endromida")
        'Call connection(tcnview, "\\SEEYOU-PC\shared\Seeyou.mdb", "endromida")
        Call Recordset(trsview, cnview, "SELECT * FROM fabric_tro order by Fbcode asc")
        
        If trsview.RecordCount = 0 Then
            MsgBox "No Record Found On Query.", vbCritical, "Seeyou"
           
        Else
            Set fab_en.DataSource = trsview
            fab_en.Orientation = rptOrientLandscape
            fab_en.Show
        End If
        
        Set trsview = Nothing
    End If
    End If
    End Sub
    Getting for 2nd Option, The connection cannot be used to perform this operation.its either closed or invalid in this context

  2. #2
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,459

    Re: Run time Error 3709

    Is this what is invalid?

    trsview.RecordCount
    Please remember next time...elections matter!

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