Re: Command Oject to pass parameters and CursorLocation
- From: Ruth <Ruth@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 15 Apr 2006 10:27:01 -0700
Try using single quotes rather than the #.
"Greg P" wrote:
I just realized I didn't give you anything to work with!!! Here is the.
parameter I create, as I said it looks good in the watch window. dteWeek is
dimmed as a date and = 4/14/06. In access I am asking for anydata <= this
date. If I type that in in Access I get the correct response. The "Value"
in the watch window is "#4/14/06#". I'm not sure what is wrong?
objCmd.Parameters.Append objCmd.CreateParameter("prmDayEnd", adDate, , ,
dteWeek)
"Greg P" wrote:
Steven,
Thanx for the response, I had tried your suggestion earlies and didn't
recieved any results in my recordset. After removeing two parameters that
were date oriented I did recieved the correct results. So the problem is in
the date parameters.
I'm not why though? I am doing a watch on the one I've added back and can't
see anything wrong with it. The value has "#" signs around it of course and
when I type those same values into access I recieve the correct result, yet
when I pass them I get nothing?!?
You answered my question wonderfully yet I would wonder if you had any
insight on this date parameter problem. If not I can repost as a new
question.
Thank You!
"Stephen Howe" wrote:
Ok so I'm frustrated!!! What I'm trying to do is pass paramters from a
VB6
app to a "stored procedure" on access. Get the resulting recordset and
display it in a data grid.
I create some parameters, append them to the command object open the
recordset using objcmd.execute(). This sets the resulting recordset
CursorLocation adUseServer, and the cursorType AdopenForward only.
Would be.
The Cursor location for RecordSet returned is whatever the current Cursor
Location of the underlying Connection for Command object is set to. And that
defaults to Server-sided.
For Server-sided, the RecordSet returned by the Comamnd object is always
ForwardOnly, ReadOnly
For Client-sided, the RecordSet returned by the Comamnd object is always
Static, ReadOnly
This
can't be displayed in a datagrid, the CursorLocation must be set to
adUseClient.
After searching about this for a while the only options anyone has offered
are to use the connection object or the recordset object to open the
recordset, but if I do that I can't pass the needed parameters to the
query/stored proc?!?
1. Set up the Command object with correct Parameters. DO set Connection.
2. Set up the Recordset object with Cursor Location, CursorType, LockType.
DO NOT set Connection.
3. Do RecordSet Open(), passing as Source Object the Command Object.
4. The only thing I am uncertain about is whether you set the Recordsets 4th
(5th??) parameter to adStoredProc or the Command object. I think it might be
on the Command object, the Recordsets 4th (5th??) parameter should describe
what the 1st parameter is.
Stephen Howe
- Follow-Ups:
- References:
- Re: Command Oject to pass parameters and CursorLocation
- From: Stephen Howe
- Re: Command Oject to pass parameters and CursorLocation
- From: Greg P
- Re: Command Oject to pass parameters and CursorLocation
- Prev by Date: Re: MSDAORA provider not found
- Next by Date: Re: Crystal Reports using datasets
- Previous by thread: Re: Command Oject to pass parameters and CursorLocation
- Next by thread: Re: Command Oject to pass parameters and CursorLocation
- Index(es):
Relevant Pages
|
|