Thread View: borland.public.cppbuilder.database.ado
2 messages
2 total messages
Started by Rainer Welzel
Thu, 08 Sep 2005 16:20
SQL INSERT Problem
Author: Rainer Welzel
Date: Thu, 08 Sep 2005 16:20
Date: Thu, 08 Sep 2005 16:20
21 lines
1488 bytes
1488 bytes
Hi,
I have trouble to set an SQL INSERT command .
This is the Code:
Memo3->Clear();
Memo3->Lines->Add(" INSERT INTO Adler ");
Memo3->Lines->Add("lfd");
Memo3->Lines->Add("VALUES ('xxxxxxx') ");
ADOQuery->SQL->Clear();
ADOQuery->SQL = Memo3->Lines;
ADOQuery->Open();
// throws an Exception: .. Syntax-Error in the INSERT INTO command .....
The Database is an MS-ACCESS Database with a simple table named 'Adler'
with fields LFD NACHNAME VORNAME ....
lfd is a textfield: width 7
thx
Rainer Welzel
Re: SQL INSERT Problem
Author: Viatcheslav V. Vassiliev
Date: Thu, 08 Sep 2005 20:03
Date: Thu, 08 Sep 2005 20:03
38 lines
2048 bytes
2048 bytes
You missed braces around lfd:
INSERT INTO Adler (lfd) VALUES('xxxxxx')
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Rainer Welzel" <master@fgg-welzel.de> �������/�������� � ��������
���������: news:43206486$1@newsgroups.borland.com...
> Hi,
> I have trouble to set an SQL INSERT command .
> This is the Code:
>
> Memo3->Clear();
> Memo3->Lines->Add(" INSERT INTO Adler ");
> Memo3->Lines->Add("lfd");
> Memo3->Lines->Add("VALUES ('xxxxxxx') ");
>
> ADOQuery->SQL->Clear();
> ADOQuery->SQL = Memo3->Lines;
>
> ADOQuery->Open();
> // throws an Exception: .. Syntax-Error in the INSERT INTO command
> .....
>
> The Database is an MS-ACCESS Database with a simple table named 'Adler'
> with fields LFD NACHNAME VORNAME ....
> lfd is a textfield: width 7
>
> thx
> Rainer Welzel
>
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads