PDA

Click to See Complete Forum and Search --> : SQL question


gvirden
Jan 18th, 2000, 02:10 AM
Can anyone tell me what is wrong here.

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.

Gerald
Jan 18th, 2000, 03:48 AM
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

gvirden
Jan 18th, 2000, 08:03 AM
You da man Gerald! thanks