📄 frmdmoobjectexplorer.frm
字号:
VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form frmDMOObjectExplorer
BorderStyle = 3 'Fixed Dialog
Caption = "Code Wizard - for RC2"
ClientHeight = 7224
ClientLeft = 408
ClientTop = 792
ClientWidth = 11544
Icon = "frmDMOObjectExplorer.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 7224
ScaleWidth = 11544
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton Command4
Caption = "Copy Uninst"
Height = 300
Left = 9240
TabIndex = 11
Top = 120
Width = 1092
End
Begin VB.CommandButton Command3
Caption = "Copy C#"
Height = 300
Left = 10440
TabIndex = 9
Top = 120
Width = 972
End
Begin VB.CommandButton Command2
Caption = "Copy Inst"
Height = 300
Left = 8160
TabIndex = 8
Top = 120
Width = 972
End
Begin VB.CommandButton Command1
Caption = "Generate..."
Height = 300
Left = 6840
TabIndex = 6
Top = 120
Width = 1215
End
Begin VB.ComboBox Combo2
Height = 315
Left = 4200
TabIndex = 1
Text = "Combo1"
Top = 120
Width = 2535
End
Begin VB.ComboBox Combo1
Height = 315
Left = 960
TabIndex = 0
Text = "Combo1"
Top = 120
Width = 2535
End
Begin TabDlg.SSTab SSTab1
Height = 6612
Left = 120
TabIndex = 4
Top = 480
Width = 11292
_ExtentX = 19918
_ExtentY = 11663
_Version = 393216
TabOrientation = 2
Style = 1
Tab = 2
TabHeight = 520
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 8.4
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
TabCaption(0) = "install.sql"
TabPicture(0) = "frmDMOObjectExplorer.frx":0442
Tab(0).ControlEnabled= 0 'False
Tab(0).Control(0)= "txtIN"
Tab(0).ControlCount= 1
TabCaption(1) = "Uninstall.sql"
TabPicture(1) = "frmDMOObjectExplorer.frx":045E
Tab(1).ControlEnabled= 0 'False
Tab(1).Control(0)= "txtUN"
Tab(1).Control(0).Enabled= 0 'False
Tab(1).ControlCount= 1
TabCaption(2) = "C# DB Class"
TabPicture(2) = "frmDMOObjectExplorer.frx":047A
Tab(2).ControlEnabled= -1 'True
Tab(2).Control(0)= "txtCS"
Tab(2).Control(0).Enabled= 0 'False
Tab(2).ControlCount= 1
Begin VB.TextBox txtCS
Height = 6375
Left = 480
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 10
Text = "frmDMOObjectExplorer.frx":0496
Top = 120
Width = 10692
End
Begin VB.TextBox txtUN
Height = 6375
Left = -74520
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 7
Text = "frmDMOObjectExplorer.frx":049C
Top = 120
Width = 10692
End
Begin VB.TextBox txtIN
Height = 6375
Left = -74520
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 5
Text = "frmDMOObjectExplorer.frx":04A2
Top = 120
Width = 10692
End
End
Begin VB.Label Label1
Caption = "Tables"
Height = 375
Left = 3600
TabIndex = 3
Top = 120
Width = 975
End
Begin VB.Label Database
Caption = "Database"
Height = 375
Left = 120
TabIndex = 2
Top = 120
Width = 975
End
End
Attribute VB_Name = "frmDMOObjectExplorer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Change()
Dim i As Integer
Dim namX As SQLDMO.Tables
Set namX = oSQLServerActive.Databases(Combo1.Text).Tables
Combo2.Clear
For i = 1 To namX.Count
Combo2.AddItem namX.Item(i).name
Next
On Error Resume Next
'Show top server
Combo2.ListIndex = 0
End Sub
Private Sub Combo1_LostFocus()
Combo1_Change
End Sub
Private Sub Command1_Click()
Command2.Enabled = False
Command3.Enabled = False
Dim oTable As SQLDMO.Table
Set oTable = oSQLServerActive.Databases(Combo1.Text).Tables(Combo2.Text)
txtIN = ""
txtUN = ""
txtCS = ""
If GetIdentityKey(oTable) = "" Then
MsgBox "Unable to find suitable KEY!" & vbCrLf & "Only Single Identity Autoincrement Integer Keys!"
Else
'install.sql procedures
txtIN = txtIN + GetCreateTable(oTable) & vbCrLf & vbCrLf
txtIN = txtIN + GetCreateTriggers(oTable) & vbCrLf & vbCrLf
txtIN = txtIN + GetSelectSingleSP(oTable) & vbCrLf & vbCrLf
txtIN = txtIN + GetSelectSP(oTable) & vbCrLf & vbCrLf
txtIN = txtIN + GetDeleteSP(oTable) & vbCrLf & vbCrLf
txtIN = txtIN + GetAddSP(oTable) & vbCrLf & vbCrLf
txtIN = txtIN + GetUpdateSP(oTable)
'uninstall.sql procedures
txtUN = txtUN + GetUninstallSP(oTable) & vbCrLf & vbCrLf
'C#
txtCS = txtCS + "using System;" & vbCrLf
txtCS = txtCS + "using System.Configuration;" & vbCrLf
txtCS = txtCS + "using System.Data;" & vbCrLf
txtCS = txtCS + "using System.Data.SqlClient;" & vbCrLf
txtCS = txtCS + "using Rainbow.Configuration;" & vbCrLf
txtCS = txtCS + vbCrLf
txtCS = txtCS + "namespace Rainbow.DesktopModules" & vbCrLf
txtCS = txtCS + "{" & vbCrLf
txtCS = txtCS + "public class " + oTable.name + "DB" & vbCrLf
txtCS = txtCS + vbTab + "{" & vbCrLf
txtCS = txtCS + GetCSharpGetSingle(oTable) & vbCrLf & vbCrLf
txtCS = txtCS + GetCSharpGet(oTable) & vbCrLf & vbCrLf
txtCS = txtCS + GetCSharpDelete(oTable) & vbCrLf & vbCrLf
txtCS = txtCS + GetCSharpAdd(oTable) & vbCrLf & vbCrLf
txtCS = txtCS + GetCSharpUpdate(oTable) & vbCrLf & vbCrLf
txtCS = txtCS + vbTab + "}" & vbCrLf
txtCS = txtCS + "}"
End If
Command2.Enabled = True
Command3.Enabled = True
End Sub
Private Sub Command2_Click()
Clipboard.Clear
Clipboard.SetText txtIN, vbCFText
End Sub
Private Sub Command3_Click()
Clipboard.Clear
Clipboard.SetText txtCS, vbCFText
End Sub
Private Sub Command4_Click()
Clipboard.Clear
Clipboard.SetText txtUN, vbCFText
End Sub
Private Sub Form_Load()
Dim i As Integer
Dim namX As SQLDMO.Databases
Set namX = oSQLServerActive.Databases
For i = 1 To namX.Count
Combo1.AddItem namX.Item(i).name
Next
On Error Resume Next
'Show top server
Combo1.ListIndex = 0
Combo1_Change
txtIN = ""
txtUN = ""
txtCS = ""
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload frmSQLServersLogin
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -