vb6 - Date Variable shows default value as 00:00:00 in VB 6.0 -


i defined variable date in visual basic 6.0 under:

dim procdate date 

it working fine , accepted date derived database.

today, got error showing data type mismatch variable. when checked default value, shows 00:00:00 time format without date value.

what reason this?

you seem assigning string procdate.

this rules assigning string format produces date. it's known let coercion.

string date

if source string can interpreted either date/time, time, or date value (in precedence order) according host-defined regional settings, value converted date.

otherwise, if source string can interpreted number or currency value according host-defined regional settings, , resulting value within magnitude range of double, value converted nearest representable double value, , value let-coerced date. if coerced value within range of date, result date value.

if source string not interpreted date/time, time, date, number or currency value, runtime error 13 (type mismatch) raised. if conversion double resulted in overflow, runtime error 13 (type mismatch) raised instead of runtime error 6 (overflow) otherwise raised.


Comments