Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionIf conn.State = 1 Then Dim Champ_1 As String, Champ_2 As String Dim Champ_3 As String, Champ_4 As String Dim Champ_5 As String, Champ_6 As String Dim Numero As String Champ_1 = tbxChamp1.Value Champ_2 = tbxChamp2.Value Champ_3 = tbxChamp3.Value Champ_4 = tbxChamp4.Value Champ_5 = tbxChamp5.Value Champ_6 = tbxChamp6.Value Numero = "numero" sqlstr = "CREATE TABLE " & tbxNomTable & "(" _ & Numero & " " & "int(10) PRIMARY KEY AUTO_INCREMENT" & "," _ & Champ_1 & " " & Type1.Value & "," _ & Champ_2 & " " & Type2.Value & "," _ & Champ_3 & " " & Type3.Value & "," _ & Champ_4 & " " & Type4.Value & "," _ & Champ_5 & " " & Type5.Value & "," _ & Champ_6 & " " & Type6.Value _ & ")" conn.Execute sqlstr MsgBox "Données ajoutées avec succès !", vbMsgBoxRight, "Information" Else MsgBox "Impossible d'éffectuer cette opération, vous n'êtes pas connecter à la base !", vbCritical, "Attention" End If
If conn.State = 1 Then sqlstr = "INSERT INTO " & cbxListeTable & " SET " _ & ComboBox2.Value & " = '" & tbxEnregistrement & "'" conn.Execute sqlstr Label24 = tbxEnregistrement & " à été ajouté au champ " & ComboBox2.Value Else MsgBox "Impossible d'éffectuer cette opération, vous n'êtes pas connecter à la base !", vbCritical, "Attention" End If
INSERT INTO `atelier`.`personne` ( `numero` , `Nom` , `Prenom` , `Adresse` , `Telephone` , `Site` ) VALUES ( NULL , 'TEst455', '', '', '', '' );
NotNull = "NOT NULL" sqlstr = "CREATE TABLE " & tbxNomTable & "(" _ & Numero & " " & "int(10) PRIMARY KEY AUTO_INCREMENT" & "," _ & Champ_1 & " " & Type1.Value & " " & NotNull & "," _ & Champ_2 & " " & Type2.Value & " " & NotNull & "," _ & Champ_3 & " " & Type3.Value & " " & NotNull & "," _ & Champ_4 & " " & Type4.Value & " " & NotNull & "," _ & Champ_5 & " " & Type5.Value & " " & NotNull & "," _ & Champ_6 & " " & Type6.Value & " " & NotNull & ")"