ADO Date parameter error 
Author Message
 ADO Date parameter error

In VB 6.0, sql server 6.5,
Using ADO, I have a parameter:

With mprmMeetingDate
         .Name = msMeetingDate
         .NumericScale = 0
         .Precision = 0
         .Type = adDBTimeStamp
         .Size = 0
         .Direction = adParamInput
End With

But when I try to set it and execute the command object  associated with
it
I get a "The conversion of char to smalldatetime resulted in a
smalldatetime value out of range"

So I tried adding an empty time to the end of the date"
Public Const gsNoTime = "12:00 AM"

With mcomGet_Orders_For_Day
        .Parameters(msMeetingDate).Value = ssDate_OrderDate.DateValue &
Space(1) & gsNoTime
        Set mrstOrders_For_Day = .Execute
end with

ssDate_OrderDate.DateValue is equal to 5/22/00

But that didn't work.

Does anyone know how I can get this to work??

Thanks in Advance,
Laurence Nuttall - UCLA



Fri, 08 Nov 2002 03:00:00 GMT  
 ADO Date parameter error
Try setting the size to a diferent value (10 works for me, or simply
vba.len(vntValue))

Also try explicitly converting the date with VBA.CDate(x) - or have you
done that...or is the property already of datatype Date?

Not sure this helps...



Quote:
> In VB 6.0, sql server 6.5,
> Using ADO, I have a parameter:

> With mprmMeetingDate
>          .Name = msMeetingDate
>          .NumericScale = 0
>          .Precision = 0
>          .Type = adDBTimeStamp
>          .Size = 0
>          .Direction = adParamInput
> End With

> But when I try to set it and execute the command object  associated
with
> it
> I get a "The conversion of char to smalldatetime resulted in a
> smalldatetime value out of range"

> So I tried adding an empty time to the end of the date"
> Public Const gsNoTime = "12:00 AM"

> With mcomGet_Orders_For_Day
>         .Parameters(msMeetingDate).Value = ssDate_OrderDate.DateValue
&
> Space(1) & gsNoTime
>         Set mrstOrders_For_Day = .Execute
> end with

> ssDate_OrderDate.DateValue is equal to 5/22/00

> But that didn't work.

> Does anyone know how I can get this to work??

> Thanks in Advance,
> Laurence Nuttall - UCLA

Sent via Deja.com http://www.deja.com/
Before you buy.


Sun, 10 Nov 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ADO Command Date parameter: idiocy

2. ADO Parameters and DATEs

3. Date type parameter in ADO command

4. Can't pass a NULL date parameter via ADO to SQL stored procedure

5. Date parameter error in VB6

6. Vb6+CR7+Parameters+Date+Error

7. Parameters Date Field gives Run-time Error 3421??????

8. Date Parameter Error

9. Parameters Date Field gives Run-time Error 3421??????

10. Error 3075 Syntax error in date where no date is involved

11. ADO Call Oracle function with out parameter only (syntax error)

12. Error with parameter append query in ADO 2.1

 

 
Powered by phpBB® Forum Software