Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Send Back a Array from DLL Automtion Server from SQL
Message
 
To
11/05/2001 14:00:25
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00506314
Message ID:
00506736
Views:
13
You could send back an ADO.Recordset - this will basically be an object with multiple records in it. There's lots about ADO on MSDN.

>I will like to gather a array or maybe a better way from a ole automation server.
>Example in my form i create a commandbutton FIN i retreve the value from the not empty fields and send the criteras to my server and construct a sqlexec but
>no tmp file or remote view created. I can fill cMemberInfo with 1 row but if the result are multiple rows i will like to store the result to a array and send back my array to my form and fill a grid. But i found no way to return the array or maybe you have a better solution.
>
>Thank you for your help.
>
>Server EX:
>Define CLASS OLESERVER AS custom OLEPUBLIC
> Procedure InitConnection
> Lparameters cUserID, cPassword
> Public nHandle
> nHandle = SQLConnect('RezWare', cUserID, cPassword)
> Return Iif(nHandle < 0, .F., .T.)
> Endproc
>
>*Get or find Member(s)
>*@cMemberInfo return info for only 1 rows
>*cDelimiter ","
>*cOnTable table Member
>*cFilter string from form like lastname = "Roy"
>
> Procedure GetMember
> Lparameters cMemberInfo, cDelimiter, cOnTable, cFilter
> Private lcSQL
> lcSQL = "Select "+ cOnTable + ".* FROM " + cOnTable +" WHERE " + cFilter
> nHandle = SQLConnect('RezWare', "MARCEL", "")
> If SQLEXEC(nHandle, lcSQL, 'c_result') < 0
>*This.SetError
> Return -1
> Endif
>
> If RecCount("c_result") = 0
> Return 0
> Else
> cMemberInfo = AllTrim(c_result.lname) + ;
> cDelimiter + ;
> AllTrim(c_result.fname) + ;
> cDelimiter + ;
> AllTrim(c_result.hphone) + ;
> cDelimiter + ;
> AllTrim(c_result.address) + ;
> cDelimiter + ;
> AllTrim(c_result.city) + ;
> cDelimiter + ;
> AllTrim(c_result.state) + ;
> cDelimiter + ;
> AllTrim(c_result.zip) + ;
> cDelimiter
> Return RecCount("c_result")
> Endif
> Endproc
>Enddefine
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Previous
Reply
Map
View

Click here to load this message in the networking platform