BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TClientDataSet - ADO Microsoft Access

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Gregory A. Dunn
Guest





PostPosted: Thu Feb 19, 2004 3:37 pm    Post subject: TClientDataSet - ADO Microsoft Access Reply with quote



Hello,

I am using the following object structure to view/edit data in a Microsoft
Access Table: ADOConnection - TADOQuery - TDataSetProvider -
TClientDataSet - TDataSource - TDBGrid. I can edit data fine in the TDBGrid
but when I try to run the TADOQuery.ApplyUpdates method, I get the following
error Syntax error in INSERT INTO Statement'. The problem appears to be
that the INSERT statement built is:
insert into tblStations
(SiteID,StationName,Memo)
(?,?,?)

The ? for the query parameters do not work in Access. Access expects [.]
for parameters. Do you know any way to resolve this problems?

Thanks,
Greg Dunn
[email]gregd (AT) eagleresearchcorp (DOT) com[/email]
304-757-6565 ext 117



Back to top
Viatcheslav V. Vassiliev
Guest





PostPosted: Thu Feb 19, 2004 6:07 pm    Post subject: Re: TClientDataSet - ADO Microsoft Access Reply with quote



Access accepts ? for parameter but Memo is reserved word. Try enclose all
names in brackets:

insert into [tblStations] ([SiteID], [StationName], [Memo]) (?, ?, ?)

or use quote char - ` (it is not single quote):

insert into `tblStations` (`SiteID`, `StationName`, `Memo`) (?, ?, ?)

//------------------------------------------
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)

"Gregory A. Dunn" <gregd (AT) eagleresearchcorp (DOT) com> сообщил/сообщила в новостях
следующее: news:4034d869$1 (AT) newsgroups (DOT) borland.com...
Quote:
Hello,

I am using the following object structure to view/edit data in a Microsoft
Access Table: ADOConnection - TADOQuery - TDataSetProvider -
TClientDataSet - TDataSource - TDBGrid. I can edit data fine in the
TDBGrid
but when I try to run the TADOQuery.ApplyUpdates method, I get the
following
error Syntax error in INSERT INTO Statement'. The problem appears to be
that the INSERT statement built is:
insert into tblStations
(SiteID,StationName,Memo)
(?,?,?)

The ? for the query parameters do not work in Access. Access expects [.]
for parameters. Do you know any way to resolve this problems?

Thanks,
Greg Dunn
[email]gregd (AT) eagleresearchcorp (DOT) com[/email]
304-757-6565 ext 117






Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.