how can i determine the datatype of the field im accessing, im using the rs.fields = <string>. What if the data type of the field is not string, i need to know so i can convert my <string>
Printable View
how can i determine the datatype of the field im accessing, im using the rs.fields = <string>. What if the data type of the field is not string, i need to know so i can convert my <string>
you need to query the Rs.Fields("FieldName").Type, this will return for example:
adVarBinary A binary value (Parameter object only).
adVarChar A String value (Parameter object only).
adVariant An Automation Variant (DBTYPE_VARIANT).
I'm assuming you're using ADO
im using DAO
Just tried it in DAO 3.6, works fine :), so you should be ok
declare ls_value as variant
if VarType(ls_Value) = vbDate then
'
else if vartype(ls_value) = vbString
etc...
thanks guys
you need to query the Rs.Fields("FieldName").Type, this will return for
example:
adVarBinary A binary value (Parameter object only).
adVarChar A String value (Parameter object only).
adVariant An Automation Variant (DBTYPE_VARIANT).
---
are there adVarInteger and adVarDate?
Heres the complete list for DAO:
dbBigInt Big Integer
dbBinary Binary
dbBoolean Boolean
dbByte Byte
dbChar Char
dbCurrency Currency
dbDate Date/Time
dbDecimal Decimal
dbDouble Double
dbFloat Float
dbGUID GUID
dbInteger Integer
dbLong Long
dbLongBinary Long Binary (OLE Object)
dbMemo Memo
dbNumeric Numeric
dbSingle Single
dbText Text
dbTime Time
dbTimeStamp Time Stamp
dbVarBinary VarBinary
HTH