The Code that I have despatched to you will work, provided you do the following.
Open an new exe project.
create a form with one command button.
Pull down the top menu, project
select references.
4 things are defaultly checked for you.
They are
1. Visual Basic for Application
2.Visual Basic runtime object and procedures
3.Visual Basic Objects and Procedures
4. OLE Automation.
Corecct?
Then You browse through the list by pressing the down arrow key, where you will land up in Microsoft ActiveX Data Objects 2.5 Library.
check the box left of it and press ok.
again pulldown the project menu, select references and see whether the Microsoft ActiveX Objects 2.5 Library is checked as the 5th one.
If so click ok.
If this library is not there in your system, try to select a nearest version.
ie, 2.1,2.6,2.7,2.8 any one of them or all
click ok
you are once again on the form window where you have created the command button.
on the rightside pan click the leftmost rectangle(white) for code view.
The Form_load Sub will be there and your cursor blinking in between
the sub and the end sub
Cut and past my code there.
The last line will be a second end sub. Delete it.
Now just run the program by clicking the statrt (arrow head).
Report to me whether any compile error it is giving, if yes, please tell me on what piece of code.
bravo Go ahead!
Happy programming
AV Manoharan