Date type parameter in ADO command 
Author Message
 Date type parameter in ADO command

I use Microsoft Oracle OLE DB to connect to Oracle 8.1.5 database. One
of my stored procedure is defined like this -

CREATE OR REPLACE Procedure getOrders (io_cursor IN OUT
getData.c_Order,
StartDate IN date, EndDate IN date)

    sqlstr = "{call getOrders({resultset 0, io_cursor},?,?)}"
    Set cmd = New Command
    With cmd
        Set .ActiveConnection = conDB
        .CommandText = sqlstr
        .CommandType = adCmdText
        .Parameters(0).Value = '10-1-1999'
        .Parameters(1).Value = '12-1-1999'
    End With
    Set rs = New Recordset
    Set rs = cmd.Execute(reccount)

But this shows an error. How can I send date as parameters?

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



Sat, 24 May 2003 03:00:00 GMT  
 Date type parameter in ADO command
Quote:
>     sqlstr = "{call getOrders({resultset 0, io_cursor},?,?)}"
>     Set cmd = New Command
>     With cmd
>         Set .ActiveConnection = conDB
>         .CommandText = sqlstr
>         .CommandType = adCmdText

I always add
          .Parameters.Refesh    'This makes the data types match the code.
then'
        .Parameters(0).Value = DateValue1
        .Parameters(1).Value = DateValue2
Quote:

> I use Microsoft Oracle OLE DB to connect to Oracle 8.1.5 database. One
> of my stored procedure is defined like this -

> CREATE OR REPLACE Procedure getOrders (io_cursor IN OUT
> getData.c_Order,
> StartDate IN date, EndDate IN date)

>     sqlstr = "{call getOrders({resultset 0, io_cursor},?,?)}"
>     Set cmd = New Command
>     With cmd
>         Set .ActiveConnection = conDB
>         .CommandText = sqlstr
>         .CommandType = adCmdText
>         .Parameters(0).Value = '10-1-1999'
>         .Parameters(1).Value = '12-1-1999'
>     End With
>     Set rs = New Recordset
>     Set rs = cmd.Execute(reccount)

> But this shows an error. How can I send date as parameters?

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



Sat, 24 May 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ADO Command Date parameter: idiocy

2. host data type in data environment command parameters

3. Can't set date-time type stored procedure parameters in VB6

4. Passing Parameter Of Date Type

5. Problems passing DATE type parameter to sub report

6. ADO Parameter type

7. Need help on ADO commands and parameters

8. multiple ADO command parameters

9. ADO command parameter syntax

10. ADO: Command with parameters

11. ADO: commands and parameters

12. ADO Command with parameters

 

 
Powered by phpBB® Forum Software