Re: Command Oject to pass parameters and CursorLocation



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


.



Relevant Pages

  • Re: Opening parameterized ADO Recordset with Dynamic/Keyset cursor typ
    ... This gives me a static recordset, ... cursorlocation to adUseClient, then of course, the only cursor type you will ... parameter values to the Command object, ... database as quickly as possible, dynamic/keyset cursors are never needed, at ...
    (microsoft.public.data.ado)
  • Re: Return a recordset from an MDB
    ... the Execute method of the Command object to return a Recordset, ... It's the cursor type, not its ... You never need to use a Command's Execute method to open a recordset. ...
    (microsoft.public.scripting.vbscript)
  • Re: Command Oject to pass parameters and CursorLocation
    ... recieved any results in my recordset. ... The Cursor location for RecordSet returned is whatever the current Cursor ... Location of the underlying Connection for Command object is set to. ... DO NOT set Connection. ...
    (microsoft.public.data.ado)
  • Re: Command Oject to pass parameters and CursorLocation
    ... recieved any results in my recordset. ... The Cursor location for RecordSet returned is whatever the current Cursor ... Location of the underlying Connection for Command object is set to. ... DO NOT set Connection. ...
    (microsoft.public.data.ado)
  • Re: Command Oject to pass parameters and CursorLocation
    ... recieved any results in my recordset. ... The Cursor location for RecordSet returned is whatever the current Cursor ... Location of the underlying Connection for Command object is set to. ... DO NOT set Connection. ...
    (microsoft.public.data.ado)