Wednesday, March 7, 2012

Error in INSERT INTO

Hi,
I'm sure that this is quite a simple program. I am generating an INSERT INTO statement in the Query builder (!) of Visual Basic .NET, and I consistantly get the following error: "Missing semi-colon at the end of the end of the SQL statement." The SQL stat
ement in question is:
INSERT INTO tblBlocks
(ActualTotalHoles, Block_Name, BlockComment, ChargedHoles, PlannedTotalHoles, Site_Name)
VALUES (?, ?, ?, ?, ?, ?)
SELECT tblBlocks.Block_Name, tblBlocks.Site_Name
FROM tblBlocks
WHERE (tblBlocks.Block_Name =?),( tblBlocks.Site_Name = ?);
Would much appreciate some help - Thanks.
It's being interpreted as two SQL statements, not one. The missing
semi-colon should come after VALUES(?, ?, ?, ?, ?, ?);
"Lite" <anonymous@.discussions.microsoft.com> wrote in message
news:C052EA2E-9424-4E0C-9D30-8FAFC93F064B@.microsoft.com...
> Hi,
> I'm sure that this is quite a simple program. I am generating an INSERT
INTO statement in the Query builder (!) of Visual Basic .NET, and I
consistantly get the following error: "Missing semi-colon at the end of the
end of the SQL statement." The SQL statement in question is:
> INSERT INTO tblBlocks
> (ActualTotalHoles, Block_Name, BlockComment,
ChargedHoles, PlannedTotalHoles, Site_Name)
> VALUES (?, ?, ?, ?, ?, ?)
> SELECT tblBlocks.Block_Name, tblBlocks.Site_Name
> FROM tblBlocks
> WHERE (tblBlocks.Block_Name =?),( tblBlocks.Site_Name = ?);
> Would much appreciate some help - Thanks.

No comments:

Post a Comment