Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Multiuser / Networking / August 2007

Tip: Looking for answers? Try searching our database.

Sending Entire Access Recordsets over Winsock?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Trepalium@gmail.com - 07 Aug 2007 21:07 GMT
Hello,

  I have been playing with the Winsock control microsoft provides in
their developer editions. I can send basic variables such as strings
and booleans but is there a way I can send an entire recordset without
having to write the table definitions and data to the other database
through string statements or another base variable method?

I think it would be interesting to use winsock to send access table
information. From what I have seen winsock connections tend to be
faster that Jet or other data retrieval methods.

Any help or insight would be appreciated.

Again... I'm looking at how to send an entire recordset WITHOUT having
to programatically write table defs and data.

Thanks,
Trep.
Albert D. Kallal - 08 Aug 2007 01:31 GMT
What do you plan to send the data to on the other end???

You have to have a process running on he other end.

You don't send windsock data to a file on the other end, you *connect* to
some program or processing running on the other end.

> From what I have seen winsock connections tend to be
> faster that Jet or other data retrieval methods.

I kind of doubt that. On the other hand, the last 4 versions of office and
ms-access have shipped with a socket based database engine (it called sql
server).

So, if you looking to dump the windows file system (which is what a JET
based mdb back end is, and move to a tc/ip interface, then you don't need
Winsock, you simply run sql server on the other end).

So, a "socket" based connection has been available to access
developers...and it called sql server....

I suppose you could roll your own Winsock code, but you going have to have
something running on the other end.

>send an entire recordset WITHOUT having
to programatically write table defs and data.

Send it to what? What you do plan to have running on the other end?

Either you roll your own communication system to transfer this information
and then decode it on the other end. You have to come up with you own means
to "send" this structure. You could also use somtng that is designed for
this process. Today, often that "format" is typically a xml string. So, your
"serialized" is in xml format, and then you decode it on the other end. In
place of rolling your own "structure" system, you use one of bazillion xml
libraries out there, but you could build your own delimited string.

Signature

Albert D. Kallal    (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com

Trepalium@gmail.com - 08 Aug 2007 02:42 GMT
I'm trying to send this data to another access DB. so one access db
sends recordset info via winsock tcp/ip. I'm aware of sql server. This
feature does not offer the flexibility I require.

On Aug 7, 8:31 pm, "Albert D. Kallal" <PleaseNOOOsPAMmkal...@msn.com>
wrote:
> What do you plan to send the data to on the other end???
>
[quoted text clipped - 38 lines]
> Edmonton, Alberta Canada
> pleaseNOOSpamKal...@msn.com
Albert D. Kallal - 08 Aug 2007 05:02 GMT
> I'm trying to send this data to another access DB. so one access db
> sends recordset info via winsock tcp/ip. I'm aware of sql server. This
> feature does not offer the flexibility I require.

ah..ok...more clear....

The problem is that you never "send" something to a access db, you use the
windows file system, and simply "open" the file. In other words, you no more
send data to a power point file then to a mdb file. It is just a plane Jane
windows file, and you ALWAYS open this file FROM YOUR computer (the jet
database engine simply opens the file). That is why you can't "connect" to a
mdb file that resides on a web server, you would have to have windows
networking connect to the web serer, and then you would browse via the
standard windows file system.

A file is a file is a file, no matter if it is word, or power point, or in
this case a mdb file. It is nothing special..and you can't "winsock" data to
a power point file no more then a mdb file....

So, as mentioned, you could have Winsock *connect* to a process running on
the other machine, but that has no relation to power point files, or bmp
files, or a mdb file..which are all opened by windows networks. JET is not a
socket based system, but simply windows file opening....nothing more,
nothing less....

You could run a web server on he other end, and connect to that,..and that
web server can then connect to the mdb file. So, you certainly can setup a
php gets/posts etc to interact with the mdb file via a wininet, but your
communicating with a "system" or a "process" on the other end that can
accept a socket connection.

A plane Jane windows file, be it a text file, or mdb file is not a socket
based connection, but simply a plane Jane windows file open. When you open a
power point file, or a mdb file on your server,  the server does not know
this is a mdb file, or a power point file...it simply a file..and no
processing EVER occurs on the server side (except for passing the file open
and file to your local computer).

You don't "install" jet on your server, any more then you install power
point. that software is installed and runs on your *local* computer, and
nothing beyond windows file opening occurs on the server side. There is no
differencing opening a word file, or a mdb file from your server. You don't
"send" that file data, you simply *save* your file, and programs like word
(or ms-access) does not care if that file is drive "c:", or a mapped drive
"e:" that is somewhere else...

A file is a file is a file, and a horse is a horse is a horse...

Zero processing occurs on the other end, and you have nothing "Winsock" to
connect to...

Signature

Albert D. Kallal    (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com

Larry Linson - 08 Aug 2007 05:40 GMT
> I have been playing with the Winsock control
> microsoft provides in their developer editions.
[quoted text clipped - 4 lines]
> through string statements or another base
> variable method?

Winsock is just a communications method.  You can send whatever you define
the "protocol" to handle between the sending and receiving software.
Apparently you are asking if Access has some built-in capability to transmit
an entire Table from one database to another using Winsock, and the answer
is "No.".

> I think it would be interesting to use winsock to send access table
> information. From what I have seen winsock connections tend to be
> faster that Jet or other data retrieval methods.

I can think you might write code to export a table to XML format on the
local machine, and then read and transmit the records in that XML file to
the other database, where you'd have written code to receive the records and
write them to a file. Once the whole file was transmitted, the code on the
receiving machine could import the XML file.  But that's quite a bit of work
that I don't gather you wanted to do...

As Albert stated: there must be a program running to send, and a program
running to receive.  Neither of those is built-in to Access, so you would
have to create both of them and assure they were executed at the proper
time.

 Larry Linson
 Microsoft Access MVP
Trepalium@gmail.com - 08 Aug 2007 15:17 GMT
I guess I should have been a little more specific. Microsoft has built
a Winsock Activex control class that comes with developer edition. My
questions was whether or not that control could be utilized to send
recordsets as a whole.

the winsock control seems to only allow sending and received of basic
VB variable types (i.e. strings,singles, arrays, boolean, etc...).I
did a little more in depth research last night and it appears that
transferring recordsets(since the object type is more specifc to
access) is not possible as a whole.

I've already used the winsock code to send basic variables and send
sql statements to another database that executes them.

I do like your approach about the XML tables though. If I can export
the tables into perhaps an XML format or even a CSV file, I could send
the data through winsock and then have access reimport it on the other
side.

So looks like having to programmatically rewrite the table in the
receiving database is the solution here if I want to use winsock.

BTW. there is no direct businessneed, I just was wanting to experiment
with Winsock a little.

Thanks for the good advice though.

-Trep

> <Trepal...@gmail.com> wrote
>
[quoted text clipped - 31 lines]
>   Larry Linson
>   Microsoft Access MVP
Larry Linson - 09 Aug 2007 03:16 GMT
Just for my information, what do you mean when you say "recordsets as a
whole?"  I think of  a Recordset as that which you retrieve, Record by
Record, when you use db.OpenRecordset . . . not as an Access object like a
Table, Query, etc..

If you want/need to send the table definition, that could be done... by
sending a new table name, properties, and field definitions the same way, if
you had software on the other end to receive and accumulate it, then create
the table and fields.

And, by defining an appropriate protocol to be used on both the sending and
receiving ends, you could send record information, either one field at a
time, or group the information and send it in "chunks."

In fact, I have a colleague and friend who, several years ago, used VB6 with
Winsock API calls to "turn a Jet database into a server" for error logging /
reporting on the inhouse network where he worked. Each workstation had a
copy of the "error reporting" application... it would send "transactions
containing error information" to the back end where that data was logged
into an Access database.  I am not certain if he also included the ability
for a workstation to retrieve its error history.  His environment... more
than 200 users, but because it was "error" data only, very low volume.  I
thought it very interesting, but suspect something similar might be done
with links via MyODBC to MySQL or another open-source (free) server DB, or
now, to SQL Server 2005 Express.

Larry Linson
Microsoft Access MVP

>I guess I should have been a little more specific. Microsoft has built
> a Winsock Activex control class that comes with developer edition. My
[quoted text clipped - 66 lines]
>>   Larry Linson
>>   Microsoft Access MVP
Trepalium@gmail.com - 09 Aug 2007 20:42 GMT
I was wanting basically to open a recordset in the database that is
acting as the server based on the tablename that the client database
sends and then have the recordset variable trasfer over to the client
database to use as if it was being locally set.

I've looked into to it more and I'm pretty sure that is not possible.
It looks like the best way is to send SQL statements through winsock
for the server database to run on it's tables and then somehow
programatically send this data to a temp table on the client database.

again,I'm looking at this at "just to know" way. I currently have no
practical application needing this.

> Just for my information, what do you mean when you say "recordsets as a
> whole?"  I think of  a Recordset as that which you retrieve, Record by
[quoted text clipped - 101 lines]
>
> - Show quoted text -
Larry Linson - 12 Aug 2007 01:37 GMT
> I was wanting basically to open a recordset in
> the database that is acting as the server based on
> the tablename that the client database sends and
> then have the recordset variable trasfer over to the
> client database to use as if it was being locally set.

I've never specifically asked about sending a recordset object via Winsock,
but I, too, doubt that it is possible.  Just to compare, the
DoCmd.SendObject does not work through Winsock, but allows sending the
output of a Table or Query via e-mail.

> I've looked into to it more and I'm pretty sure that
> is not possible. It looks like the best way is to send
> SQL statements through winsock > for the server
> database to run on it's tables and then somehow
> programatically send this data to a temp table on
> the client database.

This would be similar to the application I described, done with VB... though
as far as I know, he had a limited and discrete set of message information
that he transferred.

> again,I'm looking at this at "just to know" way.
> I currently have no practical application needing this.

If you pursue the matter, I'd be interested to hear what you did, and how it
worked... post back here or start a new thread.  But, as I said, you could
accomplish the same purpose by using a server DB for a back-end... but you'd
have some system requirements to meet that you would not have using Winsock.
If you have Win 2000 Pro, Win XP Pro, Vista Business or Ultimate, and a
server OS in your network, you'd meet the system requirements.

Larry Linson
Microsoft Access MVP
david@epsomdotcomdotau - 11 Aug 2007 12:20 GMT
You can send and receive detached ADO recordsets.
One of the formats is XML, if you look at it you will
see that you are sending and receiving the table definitions
and data. It's the same in the binary format, just harder
to see. But it's all done for you.

You just have to build a winsock client and server for
the detached recordsets.

If you want it to go faster, you would just send strings
and base variables. If you already know the table structure
at both ends, you don't have to send it with each recordset.

(david)

> Hello,
>
[quoted text clipped - 15 lines]
> Thanks,
> Trep.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.