Advertisement
sergrv

get_price

Mar 30th, 2020
641
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Function get_price(goodsid As Long) As Double
  2. Dim rs As New ADODB.Recordset
  3. Dim sql$
  4.  
  5. sql$ = "SELECT goods.PRICE FROM goods WHERE goods.IS_DELETED=0 AND goods.ID=" & goodsid & ";"
  6. OpenMyRecordset rs, sql$, , , True
  7. If Not rs.BOF Then
  8. get_price = Nz(rs!PRICE)
  9. Else
  10. get_price = 0
  11. End If
  12.  
  13. If Not rs Is Nothing Then
  14.      If rs.State = adStateOpen Then rs.Close
  15.      Set rs = Nothing
  16. End If
  17. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement