Category VB6

Extract file name from file Path in VB6

Imaging you have Path like: C:\Program Files\Microsoft.NET\ADOMD.NET\100\db.dll and you want extract file name “db.dll” from Path, here is the solution: Private Sub ExtractFileName (sPath As String) Dim aFName() As String Dim sPath2 As String Dim sFileName As String sPath2 =…

List down file in directory VB6

List down file inside folder using VB6: Here is a piece of code which is do this: This code will get list of file in folder and separate file name and extension and put in array.   Private Sub GetFilesName (sFileDir  As String) Dim…

How to Install VB6 on Windows vista , 7 and 8

Create a 0-byte file in the C:\Windows directory called msjava.dll. Don’t just install via the Autorun executable; instead browse the Visual Studio 6 CD (or folder), right-click Setup.exe and select Run As Administrator. On any Program Compatibility Assistant warnings, click…

Validation with GotFocus and LostFocus

The best time to validate the a field’s contents is when the user attempts to leave the field. The validate event apply to when user attempt to set focus to another field on the same form or  when the form…

Automation Error Accessing the OLE Registry

This problem happen in win7, becuse of the compatibility issue. It s easy to slove this problem. 1.Right click on VB6 icon and choose properties. 2. choose the Compatibility tab 3. Tick Run this program in compatibility  mode for: you…