home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
- Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
- Begin VB.Form Form1
- Caption = "SQLEXE"
- ClientHeight = 5025
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 6795
- LinkTopic = "Form1"
- ScaleHeight = 5025
- ScaleWidth = 6795
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton ExecuteSQL
- Caption = "Execute SQL"
- Height = 375
- Left = 5385
- TabIndex = 4
- Top = 1395
- Width = 1290
- End
- Begin VB.TextBox txtSQL
- Height = 750
- Left = 135
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 3
- Top = 975
- Width = 4620
- End
- Begin VB.Data Data1
- Caption = "Data1"
- Connect = "Access"
- DatabaseName = ""
- DefaultCursorType= 0 'DefaultCursor
- DefaultType = 2 'UseODBC
- Exclusive = 0 'False
- Height = 345
- Left = 165
- Options = 0
- ReadOnly = 0 'False
- RecordsetType = 1 'Dynaset
- RecordSource = ""
- Top = 4575
- Visible = 0 'False
- Width = 6630
- End
- Begin VB.CommandButton DBOpen
- Caption = "Open Database"
- Height = 375
- Left = 5385
- TabIndex = 2
- Top = 300
- Width = 1290
- End
- Begin MSDBGrid.DBGrid DBGrid1
- Bindings = "Sqlform.frx":0000
- Height = 2895
- Left = 135
- OleObjectBlob = "Sqlform.frx":0014
- TabIndex = 1
- Top = 2175
- Width = 6585
- End
- Begin MSComDlg.CommonDialog CommonDialog1
- Left = 6240
- Top = 930
- _ExtentX = 847
- _ExtentY = 847
- _Version = 393216
- FontSize = 1.17491e-38
- End
- Begin VB.Label Label4
- Caption = "Database Name"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 225
- Left = 135
- TabIndex = 7
- Top = 75
- Width = 1725
- End
- Begin VB.Label Label3
- Caption = "SQL Statement"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 240
- Left = 135
- TabIndex = 6
- Top = 720
- Width = 1680
- End
- Begin VB.Label Label2
- Caption = "Query Results"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 240
- Left = 135
- TabIndex = 5
- Top = 1890
- Width = 1590
- End
- Begin VB.Label Label1
- BorderStyle = 1 'Fixed Single
- Height = 255
- Left = 135
- TabIndex = 0
- Top = 360
- Width = 4605
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub DBOpen_Click()
- On Error GoTo NoDatabase
- CommonDialog1.CancelError = True
- CommonDialog1.Filter = "Databases|*.MDB"
- CommonDialog1.ShowOpen
- Data1.DatabaseName = CommonDialog1.FileName
- Data1.Refresh
- If Err = 0 Then
- Label1.Caption = CommonDialog1.FileName
- Else
- MsgBox Err.Description
- End If
- NoDatabase:
- On Error GoTo 0
- End Sub
- Private Sub ExecuteSQL_Click()
- On Error GoTo SQLError
- Data1.RecordSource = txtSQL
- Data1.Refresh
- Exit Sub
- SQLError:
- MsgBox Err.Description
- End Sub
-