home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
- Begin VB.UserControl Remote_DB
- ClientHeight = 4905
- ClientLeft = 0
- ClientTop = 0
- ClientWidth = 6345
- ScaleHeight = 4905
- ScaleWidth = 6345
- Begin MSDBGrid.DBGrid DBGrid1
- Bindings = "Remote_DB.ctx":0000
- Height = 3255
- Left = 120
- OleObjectBlob = "Remote_DB.ctx":0014
- TabIndex = 0
- Top = 1080
- Width = 6135
- End
- Begin VB.CommandButton Command2
- Caption = "Refresh"
- Height = 375
- Left = 5400
- TabIndex = 5
- Top = 600
- Width = 855
- End
- Begin VB.ComboBox tabulky
- Height = 315
- Left = 2520
- TabIndex = 4
- Text = "Combo1"
- Top = 600
- Width = 2775
- End
- Begin MSComDlg.CommonDialog Soubor
- Left = 5520
- Top = 3600
- _ExtentX = 847
- _ExtentY = 847
- _Version = 393216
- End
- Begin VB.TextBox Text1
- Height = 375
- Left = 2520
- TabIndex = 2
- Top = 120
- Width = 3735
- End
- Begin VB.CommandButton Command1
- Caption = "Nalistuj databßzi"
- Height = 375
- Left = 120
- TabIndex = 1
- Top = 120
- Width = 2295
- End
- Begin VB.Data Data1
- Caption = "Data1"
- Connect = "Access"
- DatabaseName = ""
- DefaultCursorType= 0 'DefaultCursor
- DefaultType = 2 'UseODBC
- Exclusive = 0 'False
- Height = 375
- Left = 120
- Options = 0
- ReadOnly = 0 'False
- RecordsetType = 1 'Dynaset
- RecordSource = ""
- Top = 4440
- Width = 6135
- End
- Begin VB.Label Label1
- Caption = "Seznam tabulek v databßzi"
- Height = 375
- Left = 120
- TabIndex = 3
- Top = 600
- Width = 2295
- End
- End
- Attribute VB_Name = "Remote_DB"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = True
- Private Sub Command1_Click()
- On Error GoTo chyba
- Soubor.CancelError = True
- Soubor.DefaultExt = "*.mdb"
- Soubor.ShowOpen
- a = Soubor.FileName
- If a = "" Then GoTo chyba
- Text1.Text = a
- Data1.DatabaseName = a
- For i = 0 To tabulky.ListCount - 1
- tabulky.RemoveItem 0
- Next i
- Dim db As Database
- Set db = OpenDatabase(a)
- For i = 0 To db.TableDefs.Count - 1
- tabulky.AddItem db.TableDefs(i).Name
- Next i
- Exit Sub
- chyba:
- MsgBox Error
- End Sub
-
- Private Sub Command2_Click()
- On Error Resume Next
- Data1.RecordSource = tabulky.Text
- Data1.Refresh
- End Sub
-
-