Access 2013 library reference for Jim Dettman's tcpip.accdb

I had this question after viewing MS Access VBA--Check if there's an internet connection..

I downloaded Jim's Access database for pinging (tcpip) but most of the code is red.
I guess i'm missing a library reference.
Using Access 2013. Can someone recommend a reference?
Philip WrightAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

als315Commented:
May be you have placed code into wrong type of module? It should be in class module.
Look at sample with form
TCPIP.accdb
0
Philip WrightAuthor Commented:
Reply to als315 - I just opened the Access database (TCPIP.accdb) and went to the VBA code module.
It is not a class module in TCPIP.accdb - so I think I'm missing a reference to some dlls.
All the 'Private Declare Function' lines at the head of the module are red.
So I guess it's not finding wsock32.dll , kernel32, icmp.dll etc.
0
als315Commented:
Do you have 64 bit Access version?
0
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

Fabrice LambertFabrice LambertCommented:
what's in red ?

Is it all the "Declare Function" statements ?
If so, it looks like a 32b vs 64b issue.

on 64b environment, these declaration should be written with ptrsafe and longptr statements whenever they use pointers.
0
Philip WrightAuthor Commented:
Yes
Current references (under Tools in the VBA window) are:
Visual Basic for Applications
Microsoft Access 15.0 Object Library
OLE Automation
Microsoft Office 15.0 Access database engine object
Microsoft XML, v6.0 (I just added this - do I need it?)

I'm pretty new to MS Access. Do you recommend any other references?
0
Philip WrightAuthor Commented:
Thanks, Fabrice.
I changed 'Private Declare Function' to 'Private Declare PtrSafe Function' and all the lines changed to black.
I should have realized this as I've encountered it once before - a while ago.

Does anyone recommend additions/deletions/changes to my library references?
I'm still a Newbie!
0
Fabrice LambertFabrice LambertCommented:
To my knowledge, the first 3 references are required.

The last 2 can be optional.
Remove one, see if your code still compile, if not, turn it back on.
Since you're a VBA rookie, that's the best thing for you.
0
Philip WrightAuthor Commented:
Thanks, everyone:
als315 - The 'Run' button in your TCPIP.accdb database returns 'Internet down' even though it clearly isn't - because I'm typing this.
The code in the form looks pretty basic. So I guess I'll have to do more troubleshooting. Lotsa fun!
Cheers
0
Philip WrightAuthor Commented:
Re: TCPIP.accdb
Looks like the error occurs on number of available sockets.

If WSAD.wMaxSockets < MIN_SOCKETS_REQD Then
    sErr = "This application requires a minimum of " & _
            CStr(MIN_SOCKETS_REQD) & " supported sockets."

    SocketsInitialize = False
    Exit Function
End If
0
Philip WrightAuthor Commented:
Does anyone actually have this TCPIP.accdb running on a 64 bit system?
I haven't had any luck.

WSAD.wMaxSockets returns zero no matter what I try.
How do I populate this?
0
als315Commented:
Sorry, I have no 64bit Access and can't test. Can you show your code? May be we will be able to find error in declaration
0
Philip WrightAuthor Commented:
To als315 - I haven't written any code on this as yet. I merely downloaded your copy of TCPIP.accdb
I went through the class module and added PtrSafe to all the declarations at the head. Then I substituted LongPtr for Long.
That's it.
The code runs fine but wMaxSockets always returns zero, as if there were no sockets left. I even ran 'netsh winsock reset' in a command window in case Windows had actually run out of sockets.
I'm attaching a copy of my revised module, however. Maybe I made some dumb error in my substitutions.
ocsTCPIP.txt
0
als315Commented:
Try an alternate version of connection check (alternate run button)
TCPIP.accdb
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Philip WrightAuthor Commented:
To ALS315 - Cool! I copied my adjusted declarations into the head of this module and it all works!
Thanks very much for your help and support. And patience!
0
als315Commented:
You are welcome
1
Philip WrightAuthor Commented:
To als315 - Actually, when I checked your added code, I see you're not using the original module, just the simple code in the new module.
So I didn't need to alter the code in the original module, just delete the module.
Again, thanks.
I clearly need to do more research of my own in this area. But - do you know offhand if there's any security or other downside to using the code in your second module. Is the code in the original ocsTCPIP module more secure?
0
als315Commented:
I see no difference in security of both codes. Both use OS functions
1
Philip WrightAuthor Commented:
Thanks everyone, and especially als315, for all your help on this. Much appreciated!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.