Re: Passing a Date parameter to a Parametrized query
- From: "Ken Snell [MVP]" <kthsneisllis9@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 14 Oct 2005 15:54:20 -0400
Try this:
Dim par As ADODB.Parameter
cmdObj.CommandText = "qryUpdateDepositTemp"
cmdObj.CommandType = adCmdStoredProc
cmdObj.ActiveConnection = CurrentProject.Connection
Set par = New ADODB.Parameter
par.Type = adDateTime
par.Size = 8
par.Direction = adParamInput
par.Value = dDate
cmdObj.Parameters.Append par
cmdObj.Execute
--
Ken Snell
<MS ACCESS MVP>
"tuvi" <tuvi@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:579A5487-B813-4F38-BCDB-43FB8CF061D2@xxxxxxxxxxxxxxxx
>I have the following query:
>
> PARAMETERS [dDate] DateTime;
> UPDATE DepositTemp SET DepositTemp.DepositDate = [dDate];
>
> And here is my code:
>
> cmdObj.CommandText = "qryUpdateDepositTemp"
> cmdObj.CommandType = adCmdStoredProc
> cmdObj.ActiveConnection = CurrentProject.Connection
> cmdObj.Execute Parameters:=dDate
>
> It always return error saying that wrong type of data!!!!
>
> I try the same above procedure for updating a different data type such as
> a
> Long Number and it works fine.... it just not works with a Date data type.
>
> Please help...
>
> I have Access 2003
.
- Follow-Ups:
- Re: Passing a Date parameter to a Parametrized query
- From: Ken Snell [MVP]
- Re: Passing a Date parameter to a Parametrized query
- Prev by Date: Re: Passing a Date parameter to a Parametrized query
- Next by Date: Re: Passing a Date parameter to a Parametrized query
- Previous by thread: Re: Passing a Date parameter to a Parametrized query
- Next by thread: Re: Passing a Date parameter to a Parametrized query
- Index(es):
Relevant Pages
|
|