1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
Private Sub travail()
Dim cpt As Integer
Dim x As New ArrayList
Dim champ, type, ch, taille, measure As String
x = GetTypeAndTailleAttributCoche()
ch = ""
measure = ""
For cpt = 0 To x.Count - 3 Step 3
champ = x.Item(cpt).ToString
type = x.Item(cpt + 1).ToString
taille = x.Item(cpt + 2).ToString
If ch = "" Then
If taille = "" Then 'attribut qui n'a pa de taille max généralment pour type comme (int ,datetime...) A revoir
ch = champ + " " + type
Else
ch = champ + " " + type + " " + taille ' a revoir et a remplacer par la taille réelle ( decimal ????)
End If
Else
If taille = "" Then
ch = ch + "," + champ + " " + type
Else
ch = ch + "," + champ + " " + type + " " + taille
End If
End If
If measure = "" Then
measure = champ
Else
measure = measure + "," + champ
End If
Next
objFait.SetConn(strConDefaut)
'ajouter le test pour la verification si la table existe dans la base
If objFait.ExistTable(baseDefaut, "Fact" & TextBox2.Text) = True Then
'MessageBox.Show("This Fact exists ,Please modify the name", "Fact", MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, MessageBoxOptions.DefaultDesktopOnly, True)
MsgBox("This Fact exists ,Please modify the name", MsgBoxStyle.OkOnly)
TextBox2.Focus()
Else
objFait.CreateTableFait(TextBox2.Text, ch)
Newid = objFait.GetLastIdFact + 1
objFait.InsertIntoTableFact(Newid, TextBox2.Text & "_Key", measure, TextBox2.Text)
Me.Hide() Exception:Opération inter-threads non valide : le contrôle 'CréationFait' a fait l'objet d'un accès à partir d'un thread autre que celui sur lequel il a été créé.
frmInfoSchema.Show()
End If
End Sub
Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
travail()
End Sub |
Partager