|
-
Oct 3rd, 2000, 10:10 AM
#1
Thread Starter
Member
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>
-
Oct 3rd, 2000, 10:23 AM
#2
Fanatic Member
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
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Oct 3rd, 2000, 10:25 AM
#3
Thread Starter
Member
Determine data type question follow up -- DAO
-
Oct 3rd, 2000, 10:27 AM
#4
Fanatic Member
Just tried it in DAO 3.6, works fine , so you should be ok
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Oct 3rd, 2000, 10:28 AM
#5
Fanatic Member
hm
declare ls_value as variant
if VarType(ls_Value) = vbDate then
'
else if vartype(ls_value) = vbString
etc...
-
Oct 3rd, 2000, 10:32 AM
#6
Thread Starter
Member
-
Oct 3rd, 2000, 10:34 AM
#7
Thread Starter
Member
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?
-
Oct 3rd, 2000, 10:46 AM
#8
Fanatic Member
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
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|