Skip to content

Instantly share code, notes, and snippets.

@AlexLaforge
Forked from marcelodeandrade/typeValue.asp
Created February 28, 2020 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexLaforge/0996c1db637cb33d4a6d54773bb04eb9 to your computer and use it in GitHub Desktop.
Save AlexLaforge/0996c1db637cb33d4a6d54773bb04eb9 to your computer and use it in GitHub Desktop.
Convert value by recordset value type
public function typeValue(value)
select case TypeName(value)
case "Byte": typeValue = cBool(value)
case "Integer": typeValue = cInt(value)
case "Long": typeValue = cLng(value)
case "Single": typeValue = cDbl(value)
case "Double": typeValue = cDbl(value)
case "Currency": typeValue = cDbl(value)
case "Decimal": typeValue = cDbl(value)
case "Date": typeValue = cDate(value)
case "Boolean": typeValue = cBool(value)
case "String": typeValue = cStr(value)
case else: typeValue = cStr(value)
end select
end function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment