Sub Main
Printer Friendly Page
- This is the initial module that runs in VB.
- The module calls modADO.DataOpen to create a connection with the data source.
- If ADO Main returns with boolDataOpen to TRUE, then the data connection was
successfully created.
- The module also calls LoadFormByName
to load the initial form with the name in the variable frmname.
- This allows the module to be reused for any application.
Public Sub Main()
Dim boolDataOpen As Boolean
Dim strname As String
Dim frmname As String
frmname = "frmProductList"
Screen.MousePointer = vbHourglass
boolDataOpen = modADO.DataOpen()
If boolDataOpen Then
LoadFormByName frmname
Else
MsgBox "Connection to Database failed."
End If
Screen.MousePointer - vbDefault
End Sub
View the code for DataOpen()
View the code for LoadFormByName()