ADOVB.exe Demonstrates How to Use ADO with Visual BasicID: Q172403
|
ADOVB.exe is a self-extracting compressed file containing sample code that demonstrates how to use ActiveX Data Objects (ADO) within Visual Basic.
The following files is available for download from the Microsoft
Software Library:
Adovb.exeFor more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:
Q119591 How to Obtain Microsoft Support Files from Online Services
FileName | Size | Date |
---|---|---|
AdoDemo.mdb | 332KB | 7/28/97 |
AdoVB | 18KB | 8/5/97 |
AdoVB.vbp | 1KB | 8/5/97 |
AdoVbEx | 6KB | 7/28/97 |
Private Sub cmdTemplate_Click()
Dim Conn1 As adodb.Connection
On Error GoTo VbError ' Trap (non-ADO) error/exceptions
' Create Connection Object (using early binding)
Set Conn1 = new ADODB.Connection
On Error GoTo AdoError ' Trap any error/exception
Conn1.ConnectionString = AccessConnect
Conn1.Open
'----------------------
' YOUR CODE GOES HERE!
'----------------------
' Successful Shutdown
Conn1.Close
Done:
' Miscellaneous (graceful) Cleanup
On Error Resume Next
Set Conn1 = Nothing
Exit Sub
' ADO Error/Exception Handler
AdoError:
' Save Error Information!
ErrNumber = Err.Number
ErrSource = Err.Source
ErrDescription = Err.Description
AdoErrorEx List1, Conn1
' Non-ADO Native error/exception handler
VbError:
VbErrorEx List1, ErrNumber, ErrSource, ErrDescription
GoTo Done
End Sub
QNumber Title
Q172403 FILE: Adovb.exe Demonstrates How to Use ADO with Visual Basic
Q174565 FILE: Adovc.exe Demonstrates How to Use ADO with Visual C++
Q182782 FILE: Adovj.exe Demonstrates How to Use ADO with Visual J++
Q185033 FILE: Adoacc.exe Demonstrates Using ADO with Access 97
Additional query words: kbdse kbcrossref
Keywords : kbcode kbfile kbsample kbADO kbVBp
Version : WINDOWS:1.0,1.5,2.0,5.0,6.0
Platform : WINDOWS
Issue type : kbinfo
Last Reviewed: February 15, 1999