home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmAlter
- Caption = "Alter Table"
- ClientHeight = 4365
- ClientLeft = 60
- ClientTop = 450
- ClientWidth = 7860
- Icon = "frmAlter.frx":0000
- LinkTopic = "Form1"
- ScaleHeight = 4365
- ScaleWidth = 7860
- StartUpPosition = 2 'CenterScreen
- Begin VB.Frame Frame3
- Caption = "Drop Column"
- Height = 1095
- Left = 0
- TabIndex = 12
- Top = 2520
- Width = 7815
- Begin VB.CommandButton Command4
- Caption = "Drop"
- Height = 255
- Left = 120
- TabIndex = 15
- Top = 720
- Width = 855
- End
- Begin VB.ComboBox Combo2
- Height = 315
- Left = 120
- TabIndex = 8
- Text = "Combo2"
- Top = 360
- Width = 2295
- End
- End
- Begin VB.Frame Frame2
- Caption = "Alter Column"
- Height = 1335
- Left = 0
- TabIndex = 11
- Top = 1200
- Width = 7815
- Begin VB.CheckBox Check2
- Caption = "Allow Nulls"
- Height = 255
- Left = 6600
- TabIndex = 7
- Top = 360
- Width = 1095
- End
- Begin VB.TextBox Text3
- Height = 285
- Left = 5400
- TabIndex = 6
- Text = "Text3"
- Top = 360
- Width = 495
- End
- Begin VB.ComboBox Combo4
- Height = 315
- Left = 2880
- TabIndex = 5
- Text = "Combo3"
- Top = 360
- Width = 1935
- End
- Begin VB.CommandButton Command3
- Caption = "Alter"
- Height = 255
- Left = 120
- TabIndex = 14
- Top = 840
- Width = 855
- End
- Begin VB.ComboBox Combo1
- Height = 315
- Left = 120
- TabIndex = 4
- Text = "Combo1"
- Top = 360
- Width = 2295
- End
- Begin VB.Label Label2
- Caption = "Size"
- Height = 255
- Left = 5520
- TabIndex = 17
- Top = 120
- Width = 375
- End
- Begin VB.Label Label1
- Alignment = 2 'Center
- Caption = "Type"
- Height = 255
- Left = 2880
- TabIndex = 16
- Top = 120
- Width = 1935
- End
- End
- Begin VB.Frame Frame1
- Caption = "Add Column"
- Height = 1095
- Left = 0
- TabIndex = 10
- Top = 0
- Width = 7815
- Begin VB.CheckBox Check1
- Caption = "Allow Nulls"
- Height = 315
- Left = 6600
- TabIndex = 3
- Top = 360
- Width = 1095
- End
- Begin VB.TextBox Text2
- Height = 285
- Left = 5400
- TabIndex = 2
- Text = "Text2"
- Top = 360
- Width = 495
- End
- Begin VB.TextBox Text1
- Height = 285
- Left = 120
- TabIndex = 0
- Text = "Text1"
- Top = 360
- Width = 2295
- End
- Begin VB.CommandButton Command1
- Caption = "Add"
- Height = 255
- Left = 120
- TabIndex = 13
- Top = 720
- Width = 855
- End
- Begin VB.ComboBox Combo3
- Height = 315
- Left = 2880
- TabIndex = 1
- Text = "Combo3"
- Top = 360
- Width = 1935
- End
- Begin VB.Label Label4
- Caption = "Size"
- Height = 255
- Left = 5520
- TabIndex = 19
- Top = 120
- Width = 375
- End
- Begin VB.Label Label3
- Alignment = 2 'Center
- Caption = "Type"
- Height = 255
- Left = 2880
- TabIndex = 18
- Top = 120
- Width = 1935
- End
- End
- Begin VB.CommandButton Command2
- Caption = "Done"
- Height = 375
- Left = 3360
- TabIndex = 9
- Top = 3840
- Width = 1095
- End
- Attribute VB_Name = "frmAlter"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Public AlterType As String
- Private Sub Combo3_Change()
- Select Case Combo3.Text
- Case "binary", "char", "nchar", "nvarchar", "varbinary", "varchar"
- Text2.Enabled = True
- Case Else
- Text2.Enabled = False
- End Select
- End Sub
- Private Sub Combo3_Click()
- Select Case Combo3.Text
- Case "binary", "char", "nchar", "nvarchar", "varbinary", "varchar"
- Text2.Enabled = True
- Case Else
- Text2.Enabled = False
- End Select
- End Sub
- Private Sub Combo4_Change()
- Select Case Combo4.Text
- Case "binary", "char", "nchar", "nvarchar", "varbinary", "varchar"
- Text3.Enabled = True
- Case Else
- Text3.Enabled = False
- End Select
- End Sub
- Private Sub Combo4_Click()
- Select Case Combo4.Text
- Case "binary", "char", "nchar", "nvarchar", "varbinary", "varchar"
- Text3.Enabled = True
- Case Else
- Text3.Enabled = False
- End Select
- End Sub
- Private Sub Command1_Click()
- If Text1.Text = "" Then
- MsgBox "Enter New Column Name."
- Exit Sub
- End If
- On Error GoTo errorfound
- Set conn = New adodb.Connection
- Set cmd1 = New adodb.Command
- strConnect = "Provider=SQLOLEDB;server=" + Server + ";database=" + DBName + ";uid=" + UID + ";pwd=" + PWD + ";"
- conn.Open strConnect
- cmd1.ActiveConnection = conn
- Sql = "Alter table " + TableName + " add " + Text1.Text + " " + Combo3.Text
- Select Case Combo3.Text
- Case "binary", "char", "nchar", "nvarchar", "varbinary", "varchar"
- binaryoece34Lr"
- Btab0rchar"
- Text2.Enablenn = Ne Tele " + TableName + "
- Tele " + TableName + "
- Tele " + TableName + "
- TelN" + + Txcl0S+ "
- TelN" + + Txcl03= Fb Else
- T3rclN" + + Txc", "varchar"
- binarl+ Txc", "varchar"
- binarl+ Txc", "varchar"
- binarl+ Txc", "varchar"
- I e"
- Width
- I e"
- 95dGAsrchar", "varbieclaredI2 DBN3gU
- lobalNamu xc", CommanText3.EConnection = conn
- Sql = "Alter C binaPWD + ";"
- conn.Open strConnect0m 6I;nrarbieclaredI2 DBN3
- binheBlt
- se
- Text$o0)NamGxE e"
- binarl+ Y2 DBN3gU
- lobalNbinary8iext + " " + Combo3.Text
- Select Case Combo3.Text
- Case "binary", "ch= xt
- ), "va Combo4.Text
- Case "binary",nection = conn
- Sql = "Alter C binaPWD + ";"
- conn.Open strConnect0m 6I;nrarbieclareda
- leLm 6I;nrarbkonn
- Sqlary", "ch= xt);nrarnnec binarl+ T "ch= xt);nrarnnec binar1n.Open strConnect0m 6I;nrPar"da
- leLm 6I6I;nrPar"daTxc", "varchar"
- binarl+ Txc", "varchar"
- bin"GrTxcCI2Enrarbihar"
- biyn"GrTxcC1rrarbihar"
- biyn"GrTxcC1rrarbihar"
- biyn"GrTx1n.Open strConnect0m 6I;nrPlaredIcfsCtribute VB_GlobalNameSpace = Faary)ce = Faary)ce = Faary)ce = Faary)ce = Faary)ce = Faary)ce = Faary)ce = Faary)ce = Faary)ce = Faary)ce = FolNb"
- Y,ner biyn"GrTFaary)ce = FolNb"
- Y,ner = FolN7 = Faary)crTFaary)ce = FolNb"
- Y,ner = Fo" + UIDolNb"
- 4 nY,ner = Fo" + UIDolNb"
- 4 nY6WD + ";"
- conn.OpenUm nY6WD + ";"
- con + )ce =1ce NY6WD +Cr"da
- leLm 6e = Faary)c4i" + TableName + "ase "binary"m lex e"
- Width
- Il1 TS Width
- d4rCon nY,neo" + Width binarl+ Txc", "varchar"
- o " + 6nx2
- Il aH"
- Qr "ase "bin sm lex e"
- Htaar ,nye "se "bin = F
-