Jerry N
asked on
Converting Access string to DBTYPE_DATE
I'm using Access 2010 and have a routine that sends parameters to an Oracle procedure.
It works great for strings (adChar) and Numbers(adDouble) but I'm trying to send it a date.
I think it needs a DBTYPE_DATE.
I dim:
Dim cPW As New ADODB.Command
Dim aPNames() As ADODB.Parameter
Then I set the "core":
Set aPNames(iCount) = cPW.CreateParameter(, adDBDate, adParamInput)
Then I get to the point where I assign the value
cPW.Parameters.Append aPNames(iCount)
aPNames(iCount).Value = aParam(iCount, 3)
aParam is a string array. Aparam(iCount,3) is "20110501".
I get the error:
Application uses a value of the wrong type for the operation
What do I need to send it and how do I get there?
It works great for strings (adChar) and Numbers(adDouble) but I'm trying to send it a date.
I think it needs a DBTYPE_DATE.
I dim:
Dim cPW As New ADODB.Command
Dim aPNames() As ADODB.Parameter
Then I set the "core":
Set aPNames(iCount) = cPW.CreateParameter(, adDBDate, adParamInput)
Then I get to the point where I assign the value
cPW.Parameters.Append aPNames(iCount)
aPNames(iCount).Value = aParam(iCount, 3)
aParam is a string array. Aparam(iCount,3) is "20110501".
I get the error:
Application uses a value of the wrong type for the operation
What do I need to send it and how do I get there?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER