Help! ADO Command - Cursor Type 
Author Message
 Help! ADO Command - Cursor Type

am having some trouble opening an editable recordset.  When I open a
recordset with the command object, I can't seem to edit or move backwards in
the recordset.  It seems that the cursortype defaults to AdOpenForwardOnly.
How do I open a dynamic recordset from the command object?

Here's the basics of how I'm doing it now.

    Dim cnn As new ADODB.Connection

    With cnn
        .Provider = "sqloledb"
        .Properties("Data Source") = "(Local)"
        .Properties("Initial Catalog") = "Temp"
        .Properties("User ID") = "sa"
        .Open
    End With

    Dim cmm As New ADODB.Command

   Set cmm.ActiveConnection = cnn

    cmm.CommandText = stQueryName ' stQueryName is passed as parameter

    cmm.CommandType = adCmdStoredProc

    Dim rstRecordSet As ADODB.Recordset
    Set rstRecordSet = cmm.Execute

Thanks to any who can help
Drew Chaplin



Sat, 09 Nov 2002 03:00:00 GMT  
 Help! ADO Command - Cursor Type
You can set this property at the Recordset object

Regards,

Ronald


Quote:
> am having some trouble opening an editable recordset.  When I open a
> recordset with the command object, I can't seem to edit or move backwards
in
> the recordset.  It seems that the cursortype defaults to
AdOpenForwardOnly.
> How do I open a dynamic recordset from the command object?

> Here's the basics of how I'm doing it now.

>     Dim cnn As new ADODB.Connection

>     With cnn
>         .Provider = "sqloledb"
>         .Properties("Data Source") = "(Local)"
>         .Properties("Initial Catalog") = "Temp"
>         .Properties("User ID") = "sa"
>         .Open
>     End With

>     Dim cmm As New ADODB.Command

>    Set cmm.ActiveConnection = cnn

>     cmm.CommandText = stQueryName ' stQueryName is passed as parameter

>     cmm.CommandType = adCmdStoredProc

>     Dim rstRecordSet As ADODB.Recordset
>     Set rstRecordSet = cmm.Execute

> Thanks to any who can help
> Drew Chaplin



Sat, 09 Nov 2002 03:00:00 GMT  
 Help! ADO Command - Cursor Type
Look at the CursorType property of the recordset object.

It will help.

With respect

Alex



Quote:
> am having some trouble opening an editable recordset.  When I open a
> recordset with the command object, I can't seem to edit or move
backwards in
> the recordset.  It seems that the cursortype defaults to
AdOpenForwardOnly.
> How do I open a dynamic recordset from the command object?

> Here's the basics of how I'm doing it now.

>     Dim cnn As new ADODB.Connection

>     With cnn
>         .Provider = "sqloledb"
>         .Properties("Data Source") = "(Local)"
>         .Properties("Initial Catalog") = "Temp"
>         .Properties("User ID") = "sa"
>         .Open
>     End With

>     Dim cmm As New ADODB.Command

>    Set cmm.ActiveConnection = cnn

>     cmm.CommandText = stQueryName ' stQueryName is passed as parameter

>     cmm.CommandType = adCmdStoredProc

>     Dim rstRecordSet As ADODB.Recordset
>     Set rstRecordSet = cmm.Execute

> Thanks to any who can help
> Drew Chaplin

Sent via Deja.com http://www.deja.com/
Before you buy.


Sat, 09 Nov 2002 03:00:00 GMT  
 Help! ADO Command - Cursor Type
Thanks to the several people who got me headed in the right track, but I'm
still having a problem

when I open the recordset with the open method it still open forwardonly
even though I am telling it to open something else

    rstRecordSet.Open cmm, , adOpenDynamic
I tried several combonations of the cursortype and lock type with no luck.

PLEASE!  what should I do?
thanks
Drew

Quote:

>Look at the CursorType property of the recordset object.

>It will help.

>With respect

>Alex



>> am having some trouble opening an editable recordset.  When I open a
>> recordset with the command object, I can't seem to edit or move
>backwards in
>> the recordset.  It seems that the cursortype defaults to
>AdOpenForwardOnly.
>> How do I open a dynamic recordset from the command object?

>> Here's the basics of how I'm doing it now.

>>     Dim cnn As new ADODB.Connection

>>     With cnn
>>         .Provider = "sqloledb"
>>         .Properties("Data Source") = "(Local)"
>>         .Properties("Initial Catalog") = "Temp"
>>         .Properties("User ID") = "sa"
>>         .Open
>>     End With

>>     Dim cmm As New ADODB.Command

>>    Set cmm.ActiveConnection = cnn

>>     cmm.CommandText = stQueryName ' stQueryName is passed as parameter

>>     cmm.CommandType = adCmdStoredProc

>>     Dim rstRecordSet As ADODB.Recordset
>>     Set rstRecordSet = cmm.Execute

>> Thanks to any who can help
>> Drew Chaplin

>Sent via Deja.com http://www.deja.com/
>Before you buy.



Sat, 09 Nov 2002 03:00:00 GMT  
 Help! ADO Command - Cursor Type
Drew;

I'm not seeing where the CursorLocation Property is being set, in your
code, is it possible that it is set to "adUseClient"?  If so this may
be why your having the problems your having.  When the cursor is a
client-side cursor your cursor can only be "adOpenStatic"
or "adOpenForwardOnly".

Paul


Quote:
> Thanks to the several people who got me headed in the right track,
but I'm
> still having a problem

> when I open the recordset with the open method it still open
forwardonly
> even though I am telling it to open something else

>     rstRecordSet.Open cmm, , adOpenDynamic
> I tried several combonations of the cursortype and lock type with no
luck.

> PLEASE!  what should I do?
> thanks
> Drew


> >Look at the CursorType property of the recordset object.

> >It will help.

> >With respect

> >Alex



> >> am having some trouble opening an editable recordset.  When I open
a
> >> recordset with the command object, I can't seem to edit or move
> >backwards in
> >> the recordset.  It seems that the cursortype defaults to
> >AdOpenForwardOnly.
> >> How do I open a dynamic recordset from the command object?

> >> Here's the basics of how I'm doing it now.

> >>     Dim cnn As new ADODB.Connection

> >>     With cnn
> >>         .Provider = "sqloledb"
> >>         .Properties("Data Source") = "(Local)"
> >>         .Properties("Initial Catalog") = "Temp"
> >>         .Properties("User ID") = "sa"
> >>         .Open
> >>     End With

> >>     Dim cmm As New ADODB.Command

> >>    Set cmm.ActiveConnection = cnn

> >>     cmm.CommandText = stQueryName ' stQueryName is passed as
parameter

> >>     cmm.CommandType = adCmdStoredProc

> >>     Dim rstRecordSet As ADODB.Recordset
> >>     Set rstRecordSet = cmm.Execute

> >> Thanks to any who can help
> >> Drew Chaplin

> >Sent via Deja.com http://www.deja.com/
> >Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Sun, 10 Nov 2002 03:00:00 GMT  
 Help! ADO Command - Cursor Type
If you want to edit a recordset, the best way is to use a ServerSide, Keyset
mode, OptimisticLocking

Jonathan Allen


Quote:
> Thanks to the several people who got me headed in the right track, but I'm
> still having a problem

> when I open the recordset with the open method it still open forwardonly
> even though I am telling it to open something else

>     rstRecordSet.Open cmm, , adOpenDynamic
> I tried several combonations of the cursortype and lock type with no luck.

> PLEASE!  what should I do?
> thanks
> Drew


> >Look at the CursorType property of the recordset object.

> >It will help.

> >With respect

> >Alex



> >> am having some trouble opening an editable recordset.  When I open a
> >> recordset with the command object, I can't seem to edit or move
> >backwards in
> >> the recordset.  It seems that the cursortype defaults to
> >AdOpenForwardOnly.
> >> How do I open a dynamic recordset from the command object?

> >> Here's the basics of how I'm doing it now.

> >>     Dim cnn As new ADODB.Connection

> >>     With cnn
> >>         .Provider = "sqloledb"
> >>         .Properties("Data Source") = "(Local)"
> >>         .Properties("Initial Catalog") = "Temp"
> >>         .Properties("User ID") = "sa"
> >>         .Open
> >>     End With

> >>     Dim cmm As New ADODB.Command

> >>    Set cmm.ActiveConnection = cnn

> >>     cmm.CommandText = stQueryName ' stQueryName is passed as parameter

> >>     cmm.CommandType = adCmdStoredProc

> >>     Dim rstRecordSet As ADODB.Recordset
> >>     Set rstRecordSet = cmm.Execute

> >> Thanks to any who can help
> >> Drew Chaplin

> >Sent via Deja.com http://www.deja.com/
> >Before you buy.



Sun, 10 Nov 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Help! ADO Command - Cursor Type

2. ADO cursor location and cursor type question

3. Help Reqd: ADO Recordset changes Cursor Type Dynamically

4. command with stored procedure and cursor type

5. ADO Cursor types in VBScript/ASP ??

6. ADO Recordset Cursor Types & Connections Question

7. ADO, OLE DB and Oracle - can't addNew to recordset, wrong cursor type

8. ADO cursor type question

9. ASP/ADO Cursor Types in VBScript ???

10. ADO Cursor-Types

11. ADO Cursor types

12. About ADO Cursor Type

 

 
Powered by phpBB® Forum Software