Are you tired of using
to create the VBScript yet? Well, finally we can jump back to our familiar VB development environment and create a new DLL. Start a new project. This time we are going to create an ActiveX DLL file that will handle all of our database accesses.Notepad.exe
1. Start a new project of ActiveX DLL type:
2. Call our new project
and save it in visitor.vbp
. Name the DLL file \Chapter13
. This will hold the code for us.visitors.cls
Our DLL will expose two functions to the outside world. And remember that functions look like methods to the outside world. The
function will add a new user to our database and the setVisitor
function will retrieve information about existing users. Our DLL will have no visual face to the world, so there will be no forms. Just a DLL file with two functions. And remember we have to add the ADO references for our DLL to be able to access the components it needs. getVisitor
3. So now is a good time to add the ADO references to our file. Bring up the References dialog in your new project and add the references as shown in the screenshot:
Now we'll add the relevant methods to our DLL.