Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Returning Recordset Data in a 3 tier client server database application

Posted on 1998-10-05
6
Medium Priority
?
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 600 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

688 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