views:

267

answers:

2

We have a Visual Basic application inside of Microsoft Access and we need to make a network connection. With VB6, there was a handy little control called WinSock that made this possible, but I can't find anything similar for the stripped down VB version that exists inside of Microsoft Access. Any ideas?

Since I'm not getting any answers, I'll try to clarify what I need this for.

My application sends out an email, and we're currently using a built-in Outlook object to create a message and send it in the background. The drawback is that it prompts the user to approve an "outside program" to send an email, which is frustrating our users and seems unnecessary. All of the other emailing options I've been able to find online require us to either download or purchase a control, which would be too labor intensive for us to deploy to all of our users.

I was hoping to use a socket control to manually connect to the SMTP server and send a message (since this is trivial in other languages) but I can't find any way to make a TCP connection in VBA.

A: 

The email "security" feature added by Microsoft has frustrated many developers. I don't know of an elegant solution. I've used the freeware app ClickYes Express with success, but of course that's not the answer you seek.

Smandoli
Yeah, we might end up having no option but to go with that type of solution. It just frustrates me that I can't find a simple answer for how to make a TCP connection anywhere. With VB6, I could just toss in a winsock control and be off and running. SMTP is such a simplistic protocol that it would be trivial for me to rewrite our code to connect to our own mail server manually.It just seems dumb that I can't find a quick solution here.
Eric Ryan Harrison
I really can't imagine all the frustrations that might go with using VBA after VB! It's like you're a kayaker trying to use a canoe; and you ask me, who has only had experience in a canoe, if it's really impossible to do a complete "eskimo roll" in a canoe. "Yep. It is." But I thank God for canoes ... and VBA.
Smandoli
Terrible solution, as you can't be sure you're appropving the right dialog.
David-W-Fenton
+1  A: 

I just dealt with this very issue in the last month. For various reasons, CDO was not adequate, direct use of MAPI way too complex, and the Outlook prompt you complain about completely unacceptable.

I ended up using Outlook Redemption. It's widely used by Access developers, though I found it to be rather convoluted and not terribly well-documented. But it is doing the job quite well.

David-W-Fenton