Connecting Tech Pros Worldwide Help | Site Map

How to establish connection to TCP port 13 on a remote server from within VBA?

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 02:04 PM
MLH
Guest
 
Posts: n/a
Default How to establish connection to TCP port 13 on a remote server from within VBA?

I wrote a letter to NIST in Boulder, Colorado asking how to glean
time/date from their servers from inside an Access 97 app and
VBA. Their reply is shown below. Trouble is, I do not know how
to do what they've recommended. Anybody on this forum know
what is specifically needed?
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx


Hello,
[color=blue]
> I'm sure the Daytime Protocol (RFC-867) is much better imple-
> mented. I would like to know how to implement it from
> within Visual Basic on a web-enabled PC.[/color]

Establish a connection to tcp port 13 on any of our servers. The
server will respond with a single line of text giving the date and
time in a rather obvious format.
The time message is derived directly from our atomic clock ensemble,
and it should be accurate to about 0.1 seconds or better.
I don't know how eBay determines the time, and I don't know if it
is correct.

Judah Levine
Time and Frequency Division
NIST Boulder

  #2  
Old November 13th, 2005, 02:04 PM
David W. Fenton
Guest
 
Posts: n/a
Default Re: How to establish connection to TCP port 13 on a remote server from within VBA?

MLH <CRCI@NorthState.net> wrote in
news:1fs2k1tbmt3jfnn9o1dh8r3j954k3rt6um@4ax.com:
[color=blue]
> I wrote a letter to NIST in Boulder, Colorado asking how to glean
> time/date from their servers from inside an Access 97 app and
> VBA. Their reply is shown below. Trouble is, I do not know how
> to do what they've recommended. Anybody on this forum know
> what is specifically needed?[/color]

I did extensive Googling on this, in the hopes of finding code that
directly uses WSOCK32 to do the task, but all I found was examples
that use winsock ActiveX controls.

I couldn't even find a listing for the WSOCK32 API, since it's quite
obvious that it can do the job.

The code for some of the controls was *very* easy, though, but I
just don't believe in implementing outside dependencies in my Access
apps.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
  #3  
Old November 13th, 2005, 02:04 PM
MLH
Guest
 
Posts: n/a
Default Re: How to establish connection to TCP port 13 on a remote server from within VBA?

>I did extensive Googling on this, in the hopes of finding code that[color=blue]
>directly uses WSOCK32 to do the task, but all I found was examples
>that use winsock ActiveX controls.
>
>I couldn't even find a listing for the WSOCK32 API, since it's quite
>obvious that it can do the job.
>
>The code for some of the controls was *very* easy, though, but I
>just don't believe in implementing outside dependencies in my Access
>apps.[/color]

Agree with you totally on the last point. References can get
out-a-control when you start relying on outside dependencies.
Not to mention the fact that, if it breaks, you can't fix it and
you probably can't get anyone to fix it.
  #4  
Old November 13th, 2005, 02:04 PM
polite person
Guest
 
Posts: n/a
Default Re: How to establish connection to TCP port 13 on a remote server from within VBA?

On Mon, 03 Oct 2005 14:03:43 -0400, MLH <CRCI@NorthState.net> wrote:
[color=blue]
>I wrote a letter to NIST in Boulder, Colorado asking how to glean
>time/date from their servers from inside an Access 97 app and
>VBA. Their reply is shown below. Trouble is, I do not know how
>to do what they've recommended. Anybody on this forum know
>what is specifically needed?
>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxx
>
>
>Hello,
>[color=green]
>> I'm sure the Daytime Protocol (RFC-867) is much better imple-
>> mented. I would like to know how to implement it from
>> within Visual Basic on a web-enabled PC.[/color]
>
> Establish a connection to tcp port 13 on any of our servers. The
>server will respond with a single line of text giving the date and
>time in a rather obvious format.
> The time message is derived directly from our atomic clock ensemble,
>and it should be accurate to about 0.1 seconds or better.
> I don't know how eBay determines the time, and I don't know if it
>is correct.
>
>Judah Levine
>Time and Frequency Division
>NIST Boulder[/color]

Hi
Use the time server to keep your PC clock in time, and just read that from
Access.
See freeware at http://www.snapfiles.com/freeware/ne...wtimesync.html

  #5  
Old November 13th, 2005, 02:04 PM
MLH
Guest
 
Posts: n/a
Default Re: How to establish connection to TCP port 13 on a remote server from within VBA?

Although I appreciate the work-around suggesting, I'm looking for an
actual technique here. I want to establish the connection from within
VBA - controlling everything from within code.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx
[color=blue]
>
>Hi
>Use the time server to keep your PC clock in time, and just read that from
>Access.
>See freeware at http://www.snapfiles.com/freeware/ne...wtimesync.html[/color]

  #6  
Old November 13th, 2005, 02:04 PM
David W. Fenton
Guest
 
Posts: n/a
Default Re: How to establish connection to TCP port 13 on a remote server from within VBA?

MLH <CRCI@NorthState.net> wrote in
news:8n43k1hsenf27e8iat9a9fa5s8j6iuppts@4ax.com:
[color=blue][color=green]
>>I did extensive Googling on this, in the hopes of finding code
>>that directly uses WSOCK32 to do the task, but all I found was
>>examples that use winsock ActiveX controls.
>>
>>I couldn't even find a listing for the WSOCK32 API, since it's
>>quite obvious that it can do the job.
>>
>>The code for some of the controls was *very* easy, though, but I
>>just don't believe in implementing outside dependencies in my
>>Access apps.[/color]
>
> Agree with you totally on the last point. References can get
> out-a-control when you start relying on outside dependencies.
> Not to mention the fact that, if it breaks, you can't fix it and
> you probably can't get anyone to fix it.[/color]

I'm more concerned with issues of distributing a control with your
app, and of possible incompatibilities that could be introduced in
revisions of Windows.

I just don't quite understand why there aren't more examples of
using the WSOCK32 API directly in VB.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
  #7  
Old November 13th, 2005, 02:04 PM
John Mishefske
Guest
 
Posts: n/a
Default Re: How to establish connection to TCP port 13 on a remote serverfrom within VBA?

MLH wrote:[color=blue]
> Although I appreciate the work-around suggesting, I'm looking for an
> actual technique here. I want to establish the connection from within
> VBA - controlling everything from within code.
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx
>
>[color=green]
>>Hi
>>Use the time server to keep your PC clock in time, and just read that from
>>Access.
>>See freeware at http://www.snapfiles.com/freeware/ne...wtimesync.html[/color]
>
>[/color]
If you are looking for examples on how to use the WinSock library under VB then there are
many examples on the net. Port 13 has very limited usefulness as it is reserved (as a
"well-known port) for the "daytime" protocol defined by the RFC found here:
http://www.faqs.org/rfcs/rfc867.html

For an accurate time source you'll want to use a modern protocol like NTP or Simple NTP
(SNTP).

For a WinSock example see:

http://www.vbip.com/winsock-api/default.asp

--
'---------------
'John Mishefske
'---------------
  #8  
Old November 13th, 2005, 02:04 PM
MLH
Guest
 
Posts: n/a
Default Re: How to establish connection to TCP port 13 on a remote server from within VBA?

Judah Levine did write me back. I haven't had time to
look at his recommendations yet. And, he indicated too
that he had no knowledge of such VBA tools.


Hello,
[color=blue]
> I appreciate your reply. Unfortunately, we can find no tool
> that can be implemented from within VBA to make what you are
> suggesting happen, that is - from within an MS Access application
> and VBA...[/color]

I don't know anything about VBA -- I have never used it and our
client software is written in C.
I don't know if it would be of any help, but you can get a
number of example programs from our servers. For example, look at
the files in directory:

ftp://time.nist.gov/pub/daytime

Specifically, look at tcp_time_client.c, which shows a bare-bones
version
in C. If VBA does not support network socket connections, then it
might be possible to implement the connection in a VBA subroutine
written in C. I have never done this, but I assume that it is
possible.
However, my guess is that VBA supports winsock network calls, and it
is just a matter of getting the correct syntax using the C calls as
a guide.

Good luck.

Judah Levine
Time and Frequency Division
NIST Boulder

  #9  
Old November 13th, 2005, 02:04 PM
MLH
Guest
 
Posts: n/a
Default Re: How to establish connection to TCP port 13 on a remote server from within VBA?

Thx, John. I'll have a look at that when I get a moment.
Regards, Mike H.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.