figure it out

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manjeetgrang
    New Member
    • Feb 2008
    • 36

    figure it out

    i have a datagrid and ADODC whose prperties are set at designtime . And runs well i need to display specific records in the grid for today's date on click of command box named activeorders. i put this code and when i run it grid comes blank . any solution

    Private Sub activeorders_Cl ick()
    Dim cn As New ADODB.Connectio n
    Dim rs As Recordset
    cn.Open ("DSN=northwind ")
    Set rs = cn.Execute("sel ect * from tblreceivedorde rs where pickupdate = cvdate('" & Date & "')")
    ' i need records for today's date in grid
    Set Adodc2.Recordse t = rs
    Adodc2.Refresh
    DataGrid2.Refre sh
    End Sub
  • jeffstl
    Recognized Expert Contributor
    • Feb 2008
    • 432

    #2
    Originally posted by manjeetgrang
    i have a datagrid and ADODC whose prperties are set at designtime . And runs well i need to display specific records in the grid for today's date on click of command box named activeorders. i put this code and when i run it grid comes blank . any solution

    Private Sub activeorders_Cl ick()
    Dim cn As New ADODB.Connectio n
    Dim rs As Recordset
    cn.Open ("DSN=northwind ")
    Set rs = cn.Execute("sel ect * from tblreceivedorde rs where pickupdate = cvdate('" & Date & "')")
    ' i need records for today's date in grid
    Set Adodc2.Recordse t = rs
    Adodc2.Refresh
    DataGrid2.Refre sh
    End Sub
    I don't know because I can't see how you've set all the properties up but a guess is:

    Code:
    adodc2.datasource = rs
    Also You might want to double check your SQL and make sure it is actually returning results. If your SQL or database data is somehow not returning results then your grid would also be blank.

    Comment

    • manjeetgrang
      New Member
      • Feb 2008
      • 36

      #3
      i have tested the returned recored set. it has shown values in the textbox


      Originally posted by jeffstl
      I don't know because I can't see how you've set all the properties up but a guess is:

      Code:
      adodc2.datasource = rs
      Also You might want to double check your SQL and make sure it is actually returning results. If your SQL or database data is somehow not returning results then your grid would also be blank.

      Comment

      Working...