Hier sind meine SQLs:
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles Button7.Click
Dim sql As String
Dim TestAnrede As String
If RadioAnredeHerr.Checked Then
TestAnrede = "Herr"
ElseIf RadioAnredeFrau.Checked Then
TestAnrede = "Frau"
Else
MessageBox.Show("Sie haben keine Anrede ausgewählt!")
End If
If FlagNeu = 1 Then
sql = "INSERT INTO adressen (anrede, titel, vorname," & _
" nachname, firma, strasse, hausnr, plz, ort, land, tele1, tele2," & _
"mobil1," & _
" mobil2, fax1, fax2, email, ankauf, verkauf, kontakt, url) VALUES(" & _
"'" & TestAnrede & "','" & _
TextTitel.Text & "', '" & TextVorname.Text & "','" & _
TextNachname.Text & "','" & TextFirma.Text & _
"','" & TextStrasse.Text & "','" & TextHausnr.Text & "','" & _
TextPLZ.Text & "','" & TextOrt.Text & _
"','" & ComboLand.Text & "','" & TextTel1.Text & "','" & _
TextTel2.Text & "','" & TextMobil1.Text & _
"','" & TextMobil2.Text & "','" & TextFax1.Text & "','" & _
TextFax2.Text & "','" & TextEmail.Text & _
"','" & TextAnkauf.Text & "','" & TextVerkauf.Text & "','" & _
TextKontakt.Text & "','" & TextUrl.Text & "' )"
FlagNeu = 0
ElseIf FlagNeu = 0 Then
sql = "UPDATE adressen SET anrede ='" & TestAnrede & "' , titel ='" _
& _
TextTitel.Text & "' , vorname ='" & TextVorname.Text & _
"' , nachname ='" & TextNachname.Text & _
"', firma='" & TextFirma.Text & "', strasse='" & _
TextStrasse.Text & "', hausnr='" & TextHausnr.Text & _
"', plz='" & TextPLZ.Text & "', ort='" & TextOrt.Text & _
"', land='" & ComboLand.Text & _
"', tele1='" & TextTel1.Text & "', tele2='" & _
TextTel2.Text & "', mobil1='" & TextMobil1.Text & _
"', mobil2='" & TextMobil2.Text & "', fax1='" & _
TextFax1.Text & "', fax2='" & TextFax2.Text & _
"', email='" & TextEmail.Text & "', ankauf='" & _
TextAnkauf.Text & "', verkauf='" & TextVerkauf.Text & _
"', kontakt='" & TextKontakt.Text & "', url='" & _
TextUrl.Text & "' WHERE id='" & TextID.Text & "' "
End If
execNQuery(sql)
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles Button6.Click
Dim sql As String = "DELETE FROM adressen WHERE id='" & TextID.Text & _
"'"
execNQuery(sql)
End Sub
End Class
Liebe Gr??e
Nicole
Manche geben schneller auf als die anderen.
Ich geh?re zu den anderen. |