Use this format for the datestring: 'yyyymmdd'
No spaces, slashes, dashes etc. and it will never get confused.

--

Andrew J. Kelly
SQL Server MVP


"brinet.adnane" <brinet.adnanewanadoo.fr> wrote in message
news:%23jPSzjZRDHA.1976TK2MSFTNGP11.phx.gbl...
> hi, i'm trying to pass date type from visual basic to sql sevrer 2000
using
> stored procedure but always gettinh the message:
> unable to convert date type to varchar type!
> and when putting the sql code in the yser it work as i'm using:
>
>
>
> ***********
> declare Myvardate as varchar
> set Myvardate ="07/07/2003"
>
> exec MyStoredProcNAme Myvardate
>
> it's working good, but when calliing from visual basic theres always a
> problem
> in the stored proc i'm declaring both the variable as datetime type or
> varchar(nvarchar) but niet!
>
> my visual basic program
> Dim cn as ADODB.Connection
> Dim Rs as ADODB.Recordset
> Dim Myvardate as variant or string or Date
>
> Myvardate="07/07/2003"
>
> set Rs= cn.Execute("MyStoredProcNAme '" & Myvardate & "' ")
>
> and the stored proc i'm trying to covert using the Cast function but
nothing
> is happen, always the same message error: error converting from
datetimetype
> to caracter type!
>
> thank's
>
>
>
>
>
>