-2147217900 Error: Syntax error in INSERT INTO statement 
Author Message
 -2147217900 Error: Syntax error in INSERT INTO statement

All,

I am using VB6 SP5 and connecting to MSDE and Access databases. The
following command works fine in MSDE/SQL

INSERT INTO [Users] (UserName,Groups,Password,FName,LName) VALUES ('SYSTEM',
'Staff', 'QCLEY', 'Parr', 'Bruce')

It iwll not work connecting to Access 97 or Access 2000. I have looked at
the KB articles related to the error number and found nothing on the issue.
I can't see anything wrong with the query and it works fine in both Access
97 and Access 2000 when run as a query within the database. I just cannot
seem to get it to run from within VB.

I have tried ADO 2.0 through 2.6 with no success. I have also tried renaming
table and field names just in case. No luck there either.

Thanks in advance for the help...

Bruce Parr

Any suggestions?



Sat, 14 Aug 2004 23:50:24 GMT
 -2147217900 Error: Syntax error in INSERT INTO statement

Should just be a SQL syntax difference between Access AND MSDE/SQL Server.
Try

INSERT INTO Users (UserName,Groups,Password,FName,LName) SELECT
'System','Staff','QCLEY','Parr','Bruce'

Usually works for me inseting into an Access db backend from VB

HTH

Nelson


Quote:
> All,

> I am using VB6 SP5 and connecting to MSDE and Access databases. The
> following command works fine in MSDE/SQL

> INSERT INTO [Users] (UserName,Groups,Password,FName,LName) VALUES
('SYSTEM',
> 'Staff', 'QCLEY', 'Parr', 'Bruce')

> It iwll not work connecting to Access 97 or Access 2000. I have looked at
> the KB articles related to the error number and found nothing on the
issue.
> I can't see anything wrong with the query and it works fine in both Access
> 97 and Access 2000 when run as a query within the database. I just cannot
> seem to get it to run from within VB.

> I have tried ADO 2.0 through 2.6 with no success. I have also tried
renaming
> table and field names just in case. No luck there either.

> Thanks in advance for the help...

> Bruce Parr

> Any suggestions?



Sun, 15 Aug 2004 02:57:49 GMT
 -2147217900 Error: Syntax error in INSERT INTO statement
I just ran into the same error message, and it turned out that one of
my field names is apparently a reserved word, so all I had to do was
to put brackets ( [ ] ) around the field name (just like you did for
the table name "Users") and it worked fine. I suspect that "Password"
is the culprit.


Quote:
> All,

> I am using VB6 SP5 and connecting to MSDE and Access databases. The
> following command works fine in MSDE/SQL

> INSERT INTO [Users] (UserName,Groups,Password,FName,LName) VALUES
('SYSTEM',
> 'Staff', 'QCLEY', 'Parr', 'Bruce')

> It iwll not work connecting to Access 97 or Access 2000. I have
looked at
> the KB articles related to the error number and found nothing on the
issue.
> I can't see anything wrong with the query and it works fine in both
Access
> 97 and Access 2000 when run as a query within the database. I just
cannot
> seem to get it to run from within VB.

> I have tried ADO 2.0 through 2.6 with no success. I have also tried
renaming
> table and field names just in case. No luck there either.

> Thanks in advance for the help...

> Bruce Parr

> Any suggestions?



Sun, 15 Aug 2004 04:15:29 GMT
 -2147217900 Error: Syntax error in INSERT INTO statement
Brian,

DingDingDing....Thanks for the reply. I guess that was just a brilliant
brain-fart on my part. I should have caught that. Perhaps without the sleep
deprivation I would have...

Later,
Bruce

Quote:
> I just ran into the same error message, and it turned out that one of
> my field names is apparently a reserved word, so all I had to do was
> to put brackets ( [ ] ) around the field name (just like you did for
> the table name "Users") and it worked fine. I suspect that "Password"
> is the culprit.



> > All,

> > I am using VB6 SP5 and connecting to MSDE and Access databases. The
> > following command works fine in MSDE/SQL

> > INSERT INTO [Users] (UserName,Groups,Password,FName,LName) VALUES
> ('SYSTEM',
> > 'Staff', 'QCLEY', 'Parr', 'Bruce')

> > It iwll not work connecting to Access 97 or Access 2000. I have
> looked at
> > the KB articles related to the error number and found nothing on the
> issue.
> > I can't see anything wrong with the query and it works fine in both
> Access
> > 97 and Access 2000 when run as a query within the database. I just
> cannot
> > seem to get it to run from within VB.

> > I have tried ADO 2.0 through 2.6 with no success. I have also tried
> renaming
> > table and field names just in case. No luck there either.

> > Thanks in advance for the help...

> > Bruce Parr

> > Any suggestions?



Sun, 15 Aug 2004 06:45:53 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Error-2147217900, Syntax error in FROM clause

2. SQL Syntax error in ORDER BY clause.(-2147217900)

3. error -2147217900 instead of error -2147217873 from SQLserver

4. Error: -2147217900 (80040E14); Provider Error: 14262 (37B6)

5. Syntax error in INSERT INTO statement.

6. Syntax error in INSERT INTO statement

7. Syntax error in INSERT INTO statement.

8. Syntax error in INSERT INTO statement

9. Syntax error in insert statement

10. Syntax error in INSERT statement

11. Syntax error in INSERT INTO statement

12. Syntax error in INSERT INTO statement


 
Powered by phpBB® Forum Software