Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Another ADO questions
Message
De
08/12/1999 09:50:06
 
 
À
07/12/1999 18:52:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00296681
Message ID:
00300291
Vues:
61
>Hi J :o)
>
>I tried the following as you suggested:
>I added the below line in the oConnect [(oConnect = CREATEOBJECT("adodb.connection")] object.
>
>.CursorLocation = adUseClient
>
>Then I retrieve a RecordSet using oCommand [oCommand = CREATEOBJECT("adodb.command")] object.
>
>WITH oCommand
>.CommandType = adStoredProc
>.CommandText = "Get_All_Open_Invoices"
>.ActiveConnection = oConnection
>ENDWITH
>oRecordSet = oCommand.Execute
>
>When do the following I get "the operation is not supported by the Provider" type message.
>
>oRecordSet.AddNew <-- this crashes
>
>However, when I retrieve a RecordSet using the RecordSet object, the oRecordSet.AddNew works?
>
>What am I missing?
>
>Thanks,
>
>Mal
>
>>Set client side recordset property of connection object (CursorLocation). You also want to read the docs on the way you can combine your options for recordset types. For example, you cannot have a dynamic client side recordset. HTH
>
>>>Hi all:
>>>
>>>ADO (using OLE DB) from SQL SERVER 7.0 is what I'm trying to implement.
>>>
>>>I can't seem to get a client side cursor when using the ADO COMMAND object to get a RECORDSET via STORED PROCEDURES. Is the combination of COMMAND Object/STORED PROCEDURES to retrieve a RECORDSET always read only or is there something I'm missing?
>>>
>>>Thanks in advance,
>>>
>>>Mal

This is because the Execute method of the command object always returns a read only recordset (adLockType = 1). Try opening the recordset with the recordset open command and passing the command that you already have as a parameter. At the end of your ENDWITH:

oRS=CreateObject("ADODB.Recordset")
oRS.Open(oCommand, oConnection, 3, 4)

Where 3 is CursorType adOpenStatic and 4 is LockType adLockBatchOptimistic. HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform