Query Analyzer in VB6

The program illustrates on how to create a simple query analyzer using Visual Basic 6 (front-end) and MSSQL Server 2000 (Back-end). Query Analyzer is a fairly straightforward and simple tool to use. Since the user interface is user-friendly and easy to navigate, the purpose of this section is not to provide a basic tutorial on using Query Analyzer, but to help you get more out of Query Analyzer by pointing out some of its more useful features that you might not be aware of.
  • Capable of executing basic sql (structure query language) command such as select, insert, update and delete 
  • Capable of executing advanced sql scripts such as INNER JOIN, WHERE, ORDER BY, BETWEEN and etc.) 
  • Capable of identifying errors or incorrect sql statements. 
Code snippet

Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
With rs
    .Open strQuery, cn, 1, 2
    If .EOF = False Then
        Set Me.DataGrid1.DataSource = rs
        picDisplay.Print "Record/s affected (" & .RecordCount & ")"
    End If
End With

Figure 1
Displaying all records from table Employee where the skill name is Marketing

Click Contact Us to request the source code