Autor Beitrag
Anarkids
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 81

Win XP Pro, Freundin
Delphi 2006, C/C++, VisualBasic
BeitragVerfasst: Do 20.04.06 11:44 
high leute!

Eigentlich dürfte das Problem schnell gelöst sein, ich kenn sogar schon den Lösungsansatz. Nur leider stellt sich die Syntax mal wieder in meinen Weg :(

ausblenden Delphi-Quelltext
1:
2:
3:
4:
ado_q.close;
ado_q.sql.clear;
ado_q.sql.commatext := 'DELETE from Serverdaten where Servername = '''+combo2.text+'';
ado_q.execsql;


Also ich weiß, dass der String in Combo2.text in '' Übergeben werden muss, habe das auch schon manuell in Access versucht und es hat geklappt und wenn ich das so versuche, dann meckert er mich einfach an.

mfg
anarkids

_________________
Mr.D
Change begins with you - TODAY!
Alpha_Wolf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 297

Ubuntu, Win XP, Win Vista
C#, Delphi 6 Prof, Delphi 2007 Prof, Java
BeitragVerfasst: Do 20.04.06 11:57 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
ado_q.close;
ado_q.sql.clear;
ado_q.sql.commatext := Format('DELETE FROM Serverdaten WHERE Servername = %s', [Combo2.Text]);
ado_q.execsql;


ungetestet ;)

_________________
Diskutiere nie mit einem Irren - er zieht dich auf sein Niveau und schlägt dich mit seiner Erfahrung.
mikhal
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 109

Windows 10 Professional 64-Bit
VS 215 CE, Delphi 10.1 Berlin Professional
BeitragVerfasst: Do 20.04.06 12:05 
Versuchs mal so:
ausblenden Delphi-Quelltext
1:
ado_q.sql.commatext := 'DELETE from Serverdaten where Servername = ' + QuotedStr(combo2.text);					


Grüße
Mikhal

_________________
Computer erleichtern die Arbeit...
...und die Erde ist eine Scheibe!
Anarkids Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 81

Win XP Pro, Freundin
Delphi 2006, C/C++, VisualBasic
BeitragVerfasst: Do 20.04.06 12:07 
also jetzt meckert er mich net mehr an, aber dafür lösch er auch nix. klartext: fehlermeldung weg (spitze), datensatz bleibt (dooof)..

mfg,
anarkids

_________________
Mr.D
Change begins with you - TODAY!
Anarkids Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 81

Win XP Pro, Freundin
Delphi 2006, C/C++, VisualBasic
BeitragVerfasst: Do 20.04.06 12:09 
user profile iconmikhal hat folgendes geschrieben:
Versuchs mal so:
ausblenden Delphi-Quelltext
1:
ado_q.sql.commatext := 'DELETE from Serverdaten where Servername = ' + QuotedStr(combo2.text);					


Grüße
Mikhal


danke, funktioniert bestens ;-)

schönen tag noch!

_________________
Mr.D
Change begins with you - TODAY!
Alpha_Wolf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 297

Ubuntu, Win XP, Win Vista
C#, Delphi 6 Prof, Delphi 2007 Prof, Java
BeitragVerfasst: Do 20.04.06 12:50 
Hatte in der Eile was vergessen..

ausblenden Delphi-Quelltext
1:
ado_q.sql.commatext := Format('DELETE FROM Serverdaten WHERE Servername = ''%s''',					


Ich bevorzuge den Format Befehl da dieser Übersichtlicher ist. Natürlich auch kombinierbar mit QuotedStr

_________________
Diskutiere nie mit einem Irren - er zieht dich auf sein Niveau und schlägt dich mit seiner Erfahrung.