Results 1 to 3 of 3

Thread: SQL question

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 1999
    Location
    Greenville, MS, Washington
    Posts
    38

    Post

    Can anyone tell me what is wrong here.
    Code:
        Dim rs As ADODB.Recordset
        Dim sSQL As String
            
        sSQL = "SELECT FeedGrowth.Batch, FeedGrowth.[Current Hd], FeedGrowth.CurrentLbs, FeedGrowth.Size From FeedGrowth " & _
        "WHERE (((FeedGrowth.Batch) Like ('*" & lblPondFrom.Caption & "*'))) " & _
        "ORDER BY FeedGrowth.Size DESC"
        
        Set rs = GetRecordSet(sSQL)
        
        Set hfgPondFrom.DataSource = rs
    My grid doesn't load.

  2. #2
    Member
    Join Date
    Nov 1999
    Posts
    63

    Post

    Change those asterisks (*) to percent (%) and you should be good to go. You've just encountered one of the problems with using MS Access to prototype your SQL statements. The asterisks might have worked in DAO, but ADO wants them to be percent signs.

    Gerald

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 1999
    Location
    Greenville, MS, Washington
    Posts
    38

    Post

    You da man Gerald! thanks

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