Results 1 to 2 of 2

Thread: ADODC Question

  1. #1
    Join Date
    Apr 2003

    Unanswered: ADODC Question

    Can you use a sql statement that includes a join for a recordsource in an adodc control? I am having trouble getting a data grid to 'behave' trying to set it's recordsource properties in code. Here is my code:


    sql = "SELECT * FROM PartData pd INNER JOIN RaceData rd ON pd.RaceID = rd.RaceID "
    sql = sql & "WHERE rd.EventID = " & lEventID & " ORDER BY pd.LastName, pd.FirstName"
    Set rs = New Recordset
    rs.Open sql, conn, adOpenStatic, adLockOptimistic
    Set dgPartData.DataSource = rs


    Could I use this in an adodc as the recordsource?


  2. #2
    Join Date
    Jul 2003
    Amsterdam, Nederland

    Smile Yep you can

    Yes you can.

    That is you can do it in code .

    First you have to set the propertys of the controle,
    odbc connection/db-string ect.

    First set the recordsource to 8 (unknown)

    in code build your sql string, then set the recordsource property to text and set the text to your sql string and refrsh it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts