Solved

Make a Recordset Object

Posted on 2001-08-26
18
293 Views
Last Modified: 2013-11-25
I'd like to make a database server program and client program using Microsoft Winsock Control. The server program will run as a server to serve a request from the client. The client will be able to send the SQL statement and will get the result as recordset. (for example: like SQL Server and ADO Object in the client)
My question is:
How to make an object like ADO Recordset?
is it possible to send the recordset using TCP/IP from the server to the client so the client can navigate through the records just like ADO does with SQL Server.
0
Comment
Question by:falconew
  • 6
  • 4
  • 3
  • +2
18 Comments
 
LVL 6

Accepted Solution

by:
sharmon earned 300 total points
ID: 6427589
Check this out, it might be everything you are looking for...

http://www.pscode.com/xq/ASP/txtCodeId.23760/lngWId.1/qx/vb/scripts/ShowCode.htm
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6429330
Maybe using a disconnected recordset on client side.
0
 
LVL 1

Author Comment

by:falconew
ID: 6430460
Thanks for your response. The application from the link it refers to is very cool. But I need to make a multipurpose database server like SQL Server and I also want to develop the recordset object myself. I know how to connect and send data using Winsock, but I don't have any idea how to make an object like ADO connecting to SQL Server.
0
 
LVL 1

Author Comment

by:falconew
ID: 6430530
Thanks for your response. The application from the link it refers to is very cool. But I need to make a multipurpose database server like SQL Server and I also want to develop the recordset object myself. I know how to connect and send data using Winsock, but I don't have any idea how to make an object like ADO connecting to SQL Server.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6430716
falconew, don't push refresh button from navigator, instead use Reload question at top of page. Doing so, you avoid repeated posts.
Cheers
0
 
LVL 1

Expert Comment

by:raybeam
ID: 6431223
why using winsock? why not ODBC ?
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6431961
With ODBC, don't you need to stay on  line?
0
 
LVL 6

Expert Comment

by:sharmon
ID: 6433088
When re-reading your question, it appears to me now that you don't want to use ADO with SQL server over a winsock connection, you want to create your own SQL type server and ADO type object to communicate and use winsock as the connection between the two?  Is this correct?
0
 
LVL 1

Expert Comment

by:raybeam
ID: 6433116
no, you just open and transmit on demand...but maybe the question is about streaming raw data without the need of a driver (ODBC)

this question is ambiguious, clarification needed...

Regards,

RayZor
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 1

Author Comment

by:falconew
ID: 6434982
Sharmon, yes you are correct. and I don't want to use the ODBC driver either. I want to create my own SQL Server type if it is possible and my own MS-ADO like. Do you all have any idea how to do this.

Raybeam, Yes I want to send the streaming raw data over TCP/IP network using winsock or anything else if possible but I don't know which the efficient way is if the data are more than thousand records.

Any Idea or suggestion would be be appeciated.
0
 
LVL 7

Expert Comment

by:Z_Beeblebrox
ID: 6435035
This is definately a non-trivial question. You have to ask yourself what exactly are you trying to acheive? What features does your recordset object need? Does it need to support SQL? Does it need to support editing? Does it need to support data types? And as for the database, what kind of database do you want? Do you want a relational database? What kinds of fields will you support, integer, data, fixed length string, variable length string, blob, etc? These are very important questions which will have a significant impact on your design. And I do know what I am talking about, I have built my own ADO-like object which is used to access and modify tables stored in binary on the disk. Basically it is ADO-lite and SQL Server (more like Access) built into one. However it supports a decent range of SQL select statements including inner joins, comparisons, field naming, etc as well as updates through the record's fields. It supports most datatypes that VB supports except for variable length strings. This was a substantial project and I had to make some significant design decisions to begin with like: how many users should be accessing this database at a time? Generally one. Is performance important? Not terribly. Are bulk updates required? No. Etc etc etc.

Compared to the above, the question of how to transmit the recordset across a network is relatively trivial, but it will depend on what functionality your recordset has? Here's another question, do you want to support server side cursors, client side cursors, or both?

Zaphod.
0
 
LVL 1

Author Comment

by:falconew
ID: 6435138
Thanks for the response.
Ok let me make simple for my question.

Actually I don't need to create my own ADO-like object as complete and excelent as the MS-ADO. But for now I just need to create an object which could send an sql statement to my own server and the server will send back the result to the client. The application for the server will use MS-ADO to access the MSAccess database and using the winsock control to send the result of the query to the client.
In the client program I need to facilitate it with an object which is for just navigating the result.

Actually the URL link from Sharmon is a good example. But when I try to make about one thousand of records in the MSAccess database, the program can not handle so many data and the response is too long.

Do I need a low level programming to achieve this? or any idea how does MSADO and MSSQL communicate?
0
 
LVL 7

Expert Comment

by:Z_Beeblebrox
ID: 6435198
OK, do you need to make updates, or just get read only recordsets? If it is read only, the easiest way is to use disconnected recordsets. There are lots of websites that discuss how to do this. You can also use disconnected recordsets to do updates, but they will be asynchronous so you may get into replication conflicts. You will probably find that there is a lot of overhead associated with disconnected recordsets, but this is unavoidable unless you can make some simplifying assumptions about the data you are dealing with. If you can, then you can create you own streaming system, although this would not be easy.

Zaphod.
0
 
LVL 7

Expert Comment

by:Z_Beeblebrox
ID: 6435200
Oops, maybe I wasn't too clear. What I meant was create a disconnected recordset on the server, and then transmit that entire recordset to the client, not making the recordset on the client and then disconnecting it.

Zaphod.
0
 
LVL 1

Author Comment

by:falconew
ID: 6435317
Ok, I know what you mean. But how to transfer such amount of records to the client and the client can navigate the record?

Thanks.
0
 
LVL 7

Expert Comment

by:Z_Beeblebrox
ID: 6435338
ADO disconnected recordsets have a special feature... they are persistable. What this means is that they have the ability to convert themselves to a stream of bytes, and then 'rehydrate' themselves. What this means is that you can save a disconnected recordset to a file or, in your case, send it accross a socket connection. Unfortunately, all I have is theoretical knowledge of this, I have no idea how you actually go about doing it.....

Actually, I just took a look at the ADODB libary, and there is, in addition to the connection, recordset, etc, a stream object. This looks very interesting. Unfortunately I don't have time to look into it right now, but you should be able to find some documentation on Microsoft's webpage. This might just do exactly what you want :)

Zaphod.
0
 
LVL 1

Expert Comment

by:raybeam
ID: 6435990
keep in mind the security breach and encryption factor...TCP/IP proctocols aren't 100% secure you know...

I guess the best idea to do so is to send the data and the queries in chunks...make a list of commands you might need, similar to SQL SELECT, DELETE and stuff like that, send the query in chunk and receive the data in chunks...I used this with an SQL server withouth an ODBC driver, I treated the connection as a user and had the Queries sent over TCP/IP and received the results also in chunks...
0
 
LVL 1

Author Comment

by:falconew
ID: 6438984
Thanks for all of your response.
I wish I could give all of you the score :)
Because of no choice, I should go for the Sharmon's answer.
0

Featured Post

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.

Join & Write a Comment

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

760 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

17 Experts available now in Live!

Get 1:1 Help Now