Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21248

[RESOLVED] Run time Error 3709

$
0
0
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

Viewing all articles
Browse latest Browse all 21248

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>