Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Visual Basic (https://www.askmehelpdesk.com/forumdisplay.php?f=469)
-   -   Invalid oudside procedure (https://www.askmehelpdesk.com/showthread.php?t=91735)

  • May 11, 2007, 11:20 PM
    vasu_43
    invalid oudside procedure
    I want to creat data report in run time give specific date criteria while run code below gives arror message "invalid oudside procedure and highlighting on the ""Provider=Microsoft.Jet.OLEDB.4.0;"

    Private Sub DTPicker1_Change()
    Dim Mycon As New ADODB.Connection
    Dim M2 As New ADODB.Recordset
    Dim S1 As String

    S1 = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & _
    App.Path & "MainDB.mdb"
    'M2.Open "select * from MainDB where booking_from>=#" & DTPicker1.Value & "# and InvDate <=# " & DTPicker2.Value & "# order by InvDate", Mycon, adOpenDynamic, adLockOptimistic
    M2.Open "select * from MainDB where booking_from>=#" & DTPicker1.Value & "#, Mycon, adOpenDynamic, adLockOptimistic"
    'Here I have used two dtpicker controls which consists of any two dates

    Set DataReport2.DataSource = M2
    DataReport2.WindowState = vbMaximized
    DataReport2.Show vbModal
    M2.Close
    Mycon.Close
    End Sub

  • All times are GMT -7. The time now is 01:33 PM.