Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapter help
Message
De
22/01/2004 20:53:13
 
 
À
22/01/2004 20:45:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00869655
Message ID:
00869720
Vues:
14
Hey Aleksey,

Thanks, I just figured that out about 10 minutes ago.

Aloha,

James

>>Hi All,
>>
>>I'm trying to use SQL Stored procedures to populate my cursors via the CursorAdapter. Everything works fine EXCEPT when I want to do a paramaterized select.
>>
>>Here's the .SelectCmd
>>
>>
>>Exec FileRole_SelProc @KFileRole=?This.cSelectKey
>>
>>
>>This.cSelectKey is populated with a Guid that does exist in the SQL table. The error I get is:
>>
>>1435 Microsoft OLE DB Provider for SQL Server: No value given for one or more required parameters.
>>
>>Any idea of what's going on?
>>
>>Aloha,
>>
>>James
>
>Hi James,
>
>You have to provide ADODB.Command object if SelectCmd has parameters:
>
>CLOSE DATABASES all
>CLEAR
>SET MULTILOCKS ON
>
>LOCAL oCA as CursorAdapter
>
>oCA=CREATEOBJECT("CursorAdapter")
>oCA.AddProperty("cSelectKey","6E131438-A9EE-445D-902B-02AAD992A9B8")
>oCA.SelectCmd="Exec #test @KFileRole=?This.cSelectKey"
>
>oCon=CREATEOBJECT("ADODB.Connection")
>oCon.Open("Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=Northwind;Data Source=(local)")
>oCon.Execute("create procedure #test @KFileRole uniqueidentifier as select @KFileRole")
>oRs=CREATEOBJECT("ADODB.Recordset")
>oRS.ActiveConnection=oCon
>
>oCA.DataSource=oRS
>oCA.DataSourceType="ADO"
>
>oCom=CREATEOBJECT("ADODB.Command")
>oCom.ActiveConnection=oCon
>
>IF oCA.CursorFill(,,,oCom)
>	LIST
>ELSE
>	AERROR(aerrs)
>	DISPLAY MEMORY LIKE aerrs
>ENDIF	
>
>RETURN
>
>
>Thanks,
>Aleksey.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform