|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: JeremyS (JeremyS
BRITANNIAINC.COM)Date: Tue Jun 12 2001 - 07:27:43 CDT
Thank you for your advice. I greatly appreciate it!
Jeremy
-----Original Message-----
From: Steve Johnson [mailto:sjohnson
3TSYSTEMS.COM]
Sent: Wednesday, June 06, 2001 4:33 PM
To: DCOM
DISCUSS.MICROSOFT.COM
Subject: Re: Sending & Recieving Recordsets
Try setting the CursorLocation property of the recordset to adUseClient
before the query.
Steve Johnson
3t Systems
mailto://sjohnson
3tsystems.com
(303) 858-8800 x265
> I am a novice programmer at best, and I am attempting to learn how
> to create DCOM objects. I am a bit hung up on returning a recordset to a
> client program(that is running on another computer) from a DCOM object. I
> have written a simple client that calls a remote object method
> that queries
> an SQL database, pulls desired fields into a recordset and returns that
> recordset to the client program. The client program then populates a
> listbox and a flexgrid with the field entries.
>
> The test recordset contains 719 entries. The program
> runs extremely
> slow. It seems to take nearly a whole second for the program to enter one
> field into the listbox. I believe that I am missing something very
> fundamental, but I am unable to detect my inconsistancy. I have included
> snippets of my code for both the client and server in this email. Any
> suggestions would be greatly appreciated.
>
>
> Thank you
> Jeremy
>
>
> Server side code(VB6): method
>
> Public Function getdata() As ADODB.Recordset
> Dim rs As ADODB.Recordset
> Dim cn As ADODB.Connection
>
> Set cn = New ADODB.Connection
> Set rs = New ADODB.Recordset
> cn.Open "Provider=SQLOLEDB.1;Password=<password goes
> here>;Persist Security
> Info=True;User ID=<id goes here>;Initial Catalog=TestAccount;Data
> Source=<server name>"
>
> 'looking at a customer table and pulling non-blank customer name fields
> into a recordset
> rs.Open "select cunam from ___cust where cunam <> ''", cn,
> ADODB.adOpenForwardOnly, ADODB.adLockOptimistic
>
> Set getdata = rs
>
> End Function
>
> Client side code(VB6):
>
> Dim rs as ADODB.Recordset
> Dim custlist as hello.greeting 'this is the name of the DCOM object
>
> Private Sub Command1_Click()
>
> Dim entry As String
> Set custlist = CreatObject("hello.greeting")
> Set rs = custlist.GetData()
> Set DataGrid1.DataSource = rs
>
> Do While rs.EOF <> True
> entry = rs.Fields("Cunam")
> list1.AddItem (entry)
> rs.MoveNext
> Loop
>
> Label6.Caption = list1.ListCount
> MsgBox "Finished Populating List Box"
> End Sub
>
> ----------------------------------------------------------------
> Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
> contains important info. Save time, search the archives at
> http://discuss.microsoft.com/archives/index.html .
> To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
----------------------------------------------------------------
Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
----------------------------------------------------------------
Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]