🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #17

Desperate help needed - INSERT issues.

#17
From: Mike Collins
Date: Sat, 22 Mar 2008 02:07
39 lines
2631 bytes
Hi all, first off, happy Easter.

Secondly, i having major issues with a really basic database.  I'm trying to 
do an INSERT statement and i keep getting an database syntax exceptions 
raise, which looks like this:

Project SupportMIS.exe raised exception class EOleException with message 
'Syntax error in INSERT INTO statement'. Process stopped. Use Step or Run to 
continue.


Firstly, I'm using ADO, I have TADOConnection and a TADOQuery and i'm 
connecting to an MS Access 2003 database, using the Microsoft Jet 4.0 OLE 
Provider.  I have three tables, Staff, SEN and StaffSEN.  Staff table 
contains information about staff and each are identified by a unique staffId 
string value, SEN contains information about course that can be taken and 
each course is identified by a unique auto-number (generated in Access). 
StaffSEN is used as a link in-between these tables.  It contains the 
staffId, senId, and two other string fields, description and action.

Now, I need to do an INSERT statement to link a staff member to a SEN 
course.  I have the staffId and senId, and so i;m attempting something like

INSERT INTO StaffSEN
(staffId, senId, description, action)
VALUES ("12345a", 3, "some description", "some action");

However, when i do this, i get an exception raised.  Initially I was using 
parameters but i've tried it by constructing the SQL as a string and also by 
hardcoding it.  I get the same result regardless.  If i remove the 
description and action values and references then it all works but i 
desperately need to be able to insert these additional fields.

If i us the original statement in MS Access then it works ok.

Any help or pointers would be much appreciated - i'm meant to have this 
completed by Tuesday.

Many thanks in advance,
Technical Details
Message-ID: <47e46771$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,1ca92cff8c459d51,start
X-Google-Attributes: gid10698b,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mike Collins" <its@TheBottomOfThePost>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Desperate help needed - INSERT issues.
Date: Sat, 22 Mar 2008 02:07:18 -0000
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.3959
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133
NNTP-Posting-Host: 89.241.134.222
Message-ID: <47e46771$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1206151025 89.241.134.222 (21 Mar 2008 18:57:05 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail