I have this application that uses ODBC to retrieve a recordset from an Oracle database. Whenever I fire the Enter command I get an error with:
...if I'm using a sum statement via SQL, what is the correct syntax for referencing that part of the recordset to display it in a label or textbox? Here is the larger portion of code:
...I've tried:
...and:
...and:
...but I still get the sytax error?
Code:
txtSOH.Text = rsmain_4("sum(avail_qty)")
...if I'm using a sum statement via SQL, what is the correct syntax for referencing that part of the recordset to display it in a label or textbox? Here is the larger portion of code:
Code:
strsql_soh = "select a.itm_cd, sum(c.avail_qty) from gm_itm a, gm_sku b, gm_inv_loc c" & _
" Where a.itm_cd = b.itm_cd And b.sku_num = c.sku_num" & _
" and a.itm_cd = '" & mskItem.Text & "' group by a.itm_cd"
Set rsmain_4 = New ADODB.Recordset
rsmain_4.Open strsql_soh, cn, adOpenKeyset, adLockReadOnly
If rsmain_4.EOF Then
MsgBox "This item does not have any current by size inventory information.", vbCritical, "Error"
Exit Sub
Else
txtSOH.Text = rsmain_4("sum(avail_qty)")
End If
...I've tried:
Code:
txtSOH.Text = rsmain_4("sum(c.avail_qty)")
...and:
Code:
txtSOH.Text = rsmain_4("avail_qty")
...and:
Code:
txtSOH.Text = rsmain_4("sum(avail_qty)")
...but I still get the sytax error?