Solved

Returning Recordset Data in a 3 tier client server database application

Posted on 1998-10-05
6
201 Views
Last Modified: 2013-12-25
I have a 3 tier vb database application.
Client App <-> ActiveX DLL Server App <-> Database
The client calls the Server requesting a list of say client codes from the Database. The server contains properties and methods for access the database. The server queries the database and retrieves a recordset containing client codes. How can I pass back the entire recordset to the client app ? It is not possible to assign a function a return value of a recordset.
0
Comment
Question by:bradyj
6 Comments
 

Author Comment

by:bradyj
ID: 1496631
Adjusted points to 200
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1496632
The client can pass a recordset object by reference, and the server can set the argument to the recordset:

'Server:
Sub GetRecordset(Rs as recordset)
 Set Rs=Database.openrecordset("whatever")
End Sub

'Client
Dim R as recordset
Srv.GetRecordset R

0
 

Author Comment

by:bradyj
ID: 1496633
I'm not sure if you read the question correctly:

Your proposal passes a Recordset from the Client to the Server.

I want the Server to pass a recordset as a Return Value from a function back to the Client.

ie. Server -> Recordset -> Client

NOT Client -> Recordset -> Server


eg. Server function

Public Function GetData as Recordset

ie. the return value of the Function is a Recordset. You will see hthat this is not allowed. Therefore how can I pass back a recordset ?

0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 8

Expert Comment

by:MikeP090797
ID: 1496634
The client passes an empty recordset, a pointer. The server constructs the recordset, and returns it in it's param. After the GetData() call, Rs will be the recordset passed back by the server. Try and see for yourself
0
 
LVL 1

Expert Comment

by:Staplehead
ID: 1496635
My understanding is that this *is* possible in VB6... is that an option for you?

If not, I've seen code that passes a ComboBox (Control datatype) to the server, allowing the server to populate the control...

Larry
0
 
LVL 2

Accepted Solution

by:
vspeter earned 200 total points
ID: 1496636
I guess, you want to return the recordset back to the client so you can manipulate it on the client. But you've got to ask yourself, what can i do with this recordset WITHOUT the connection handle ?. Because from what you describe, the 'Server' holds everything in term of database connection, queries ...etc, to retrieve data from the database.

My answer is that you can not have recordset as returned type (I guess Microsoft didn't allow you to do that because the recordset does not hold any information regarding the connection handle that was used).

I would probably use the same technique suggested by MikeP and Staplehead using array where you can dynamically resize if need.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now