Error 42000 Microsoft Odbc Visual Foxpro Driver Syntax Error

Posted on

Why am I receiving the error message '*** Error: (42000) [Microsoft][ODBC Excel Driver] Invalid SQL statement' when using the DB Tester functions against Excel?

If you are receiving the '*** Error: (42000) [Microsoft][ODBC Excel Driver] Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.' error message when using the SilkTest DB Tester functions against an Excel worksheet as shown below:

Microsoft

The reason for this is because you are attempting to run an SQL Statement that it not supported by the Microsoft ODBC Driver when working with Excel. The supported SQL statements are described in solution Which SQL statements are supported by SilkTest DB_Tester?.

Driver

May 05, 2010  The following table shows which versions of the Microsoft SQL Server ODBC driver shipped with recent versions and service packs (SP) of Microsoft SQL Server. It also lists the operating system versions under which the drivers are certified to run and the versions of SQL Server against which they are certified to work. 'The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing.

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
1 of 1
‎2013-02-1520:44

Microsoft Odbc Visual Foxpro Driver Cannot Update The Cursor

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ('Material') accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.

Hy
I want to insert into ODBC and I have the error: ERROR [42000] [Microsoft][ODBC Visual FoxPro Driver]Syntax error.
My code is:

The problem is with the data, but I cannot figure out what is the problem.
Can someone help me?
Thanks

user599977user599977

1 Answer

try with a ? instead of @data in the query, like this:

Msdn says:

When CommandType is set to Text, the .NET Framework Data Provider for ODBC does not support passing named parameters to an SQL statement or to a stored procedure called by an OdbcCommand. In either of these cases, use the question mark (?) placeholder.

UPDATEyou could try concatenating your date directly in the insert in this format { d '2011-03-10' } (see ODBC Datetime Format for reference) and drop the parameter.

In this revised edition, authors Christian Bauer, Gavin King, and Gary Gregory cover Hibernate 5 in detail with the Java Persistence 2.1 standard (JSR 338). 9.5 Using Java Persistence in EJB components 426. Injecting an. Directions for downloading Hibernate packages, in source or binary form, are. Hibernate persistence unit.

Paolo FalabellaPaolo Falabella

Not the answer you're looking for? Browse other questions tagged c#datetimeinsertodbc or ask your own question.