Server and Client TCP with Access 97

  • Thread starter Thread starter Flavio
  • Start date Start date
F

Flavio

please a simple but well defined source code
for tcp socket connection Server and client
with vba

thanks in advance
FLAVIO
 
I assume when you say server/client, you mean the TCP socket.

You are well aware that using JET with ms-access is NOT a client to server
based system. There fore you CAN NOT make a socket connection to a JET
DATABASE.

If you are looking to make a socket connation to a database using ms-access,
then you can just link to a server based system via odbc. When you link to
sql server (or oracle,or whatever), you are in fact using a socket
connection, and thus can connect over the internet.

However, if by the term client/server you mean a simply socket connection,
and are NOT TALKING about database connection, then you cannot do this
natively with ms-access. You can't with VB either.

However, you most certainly can use the Winsock control, and it does
implement the classic TCP connection between two computers. In fact, I have
used the VB6 Winsock control which is designed for VB6, and access97 is vb5.
As I recall, my test code has some problems with certain methods and
properties of the Winsock control, but most, if not all of it worked just
fine. In fact, I used the Winsock control to turn ms-access into a newsgroup
reader. However, my newsgroup read also had nifty features like messaging
cancelling to newsgroups (which is VERY frowned upon). So, in good
conscience I deleted that code, as I DID NOT want a newsgroup reader
floating around with the ability to cancel other peoples post (you can do
this, but most newsgroup readers don't give you the option to do this. So,
it is ONLY the lack of the option that stops you from cancelling other
peoples posts. Also, a growing number of newsgroup servers DO NOT accept
cancel messages, as this ability/feature of newsgroups is often abused).

I am now kind of kicking myself for throwing out that code. One year later,
and I now complete forget how to use the Winsock control! However, it is not
hard, as I recall only spending one evening to create a newsgroup reader
with ms-access. And, I am not a VB developer!

Using the Winsock control, you can use email, newsgroups or even send
commands to grab web sites. Really very easy. All I did was use a search
engine, and look a few Winsock examples. My code to grab web pages should
have been saved!

I also spend a bit of time in the msdn site looking at the references for
winsock.

Here is two pictures of ms-access as a newsgroup reader:

http://www.attcanada.net/~kallal.msn/test/winsock.htm

It would have been a snap to add a "chat" window to my ms access application
also!

So, just search the web for any VB Winsock example, and you will get
zillions of examples. Most of those examples will work with ms-access. Of
course, the code needs to be tweaked a bit, as often the code examples
assume a VB form. However, really, the winsock control is very easy to use.

So, if you are trcying to write some TCP connect sutff to imiplent a chat
progtram in ms-access, then the winsock will do this very easy. If you are
trying make a TCP connection to a remote database, then I am afreed this
will NOT work *unless* of couse you decide to write both a client, and
server program. Even if you do write such a program, you will have a lot of
work if you trying to use a database remotly. The solition to use a database
remote is of couse to use sql server, or the free desktop edtion of sql
server that is included with ms-access (I mean, why write code when you got
free datbase engines like the MSDE? or even MySql...both which will work
with ms-access). This free client to server based system has been included
for the last 3 versions of office (2000,2002,2003).

Also, if you are tying to connect to a access dabase accross the net, then
you can use a VPN, but you better read the follwoing notes on trying that
crazy idea:

http://www.attcanada.net/~kallal.msn/Wan/Wans.html
 
the ms vb winsock control should not be used as a server,
as it has a memory leak when used as a server.

(david)
 
i don't want use a soket connection for data transfer but simple
interprocess comunications
for protection purpose !!!!
FLAVIO
 
Flavio said:
i don't want use a soket connection for data transfer but simple
interprocess comunications
for protection purpose !!!!
FLAVIO

Yes, then you can use the Winsock control.

No doubt, when referring to winsock, the term client, and term server is
often used.

Unfortunately, throwing that term into a database newsgroup can be a real
source of confusion, since the term client/server means something quite
different, but familiar to database users also!

But, to answer you question, yes...you can most certainly use Winsock to
communicate between two processes, or two computers via a socket (TCP/IP)
connection.
 
Back
Top