Re: Incorrect number of parameters, expected 2.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I will try Dmitriy's suggestion when I get a chance, but I don't think it
will work.

As I understand, you can also "quote" any identifier in square brackets and
ODBC will replace them with whatever the underlying driver wants. I do this
routinely with field names, I tried that and it didn't work either.

Since Matt was able to get it to work with the table name in double quotes
by modifying the actual query to have numeric constants instead of string
constants, I believe him when he says it's a bug in the ODBC driver.

"Dmitriy Ivanov" <divanov_NOSP@xxxxxxxx> wrote in message
news:dhijjn$317g$1@xxxxxxxxxxxxxx
> Hello Dave,
>
> "Matt Neerincx [MSFT]" <mattn@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> MNM> Appears to be a bug in the Access ODBC driver and how it handles
> MNM> string constants embedded in the SQL. I think it is interpreting
> MNM> the string constant "Customers" as a unresolved column name.
> MNM>| ...snip...|
>
> Appears to be a MSFT bug in choosing a knowledgeable person responsible
> for
> support and consulting in ODBC.
>
> DW> If I use ODBC to connect to the Northwind sample database, and
> DW> execute the statement
> DW>
> DW> SELECT COUNT(*) from "Customers and Suppliers by City";
> DW>
> DW> I get the error
> DW>
> DW> Incorrect number of parameters, expected 2.
>
> You should use single quotes instead of double with the Access driver,
> i.e.
>
> SELECT COUNT(*) from `Customers and Suppliers by City`;
>
> See
> SQLGetInfo(hdbc, SQL_IDENTIFIER_QUOTE_CHAR, ...);
>
> Generally, SQL syntax for ODBC slightly differs from the one acceptable by
> Access. (Actually the former is closer to the SQL standard.)
> --
> Sincerely,
> Dmitriy Ivanov
> Common Lisp ODBC interface - www.ystok.ru
>
>
>


.



Relevant Pages

  • Re: [PHP] ODBC and long text fields
    ... "Text" is a MS SQL field for ... MSSQL specific php extension? ... MSSQL functions still require an ODBC driver underneath, ...
    (php.general)
  • Re: AS400 & filter by date
    ... we need to import data from AS400 to MS SQL 2000 via ODBC driver ... (iSeries ODBC by IBM). ... with system date (MS SQL) ... CURRENT_DATE which you would then have to convert to the number format that ...
    (microsoft.public.sqlserver.dts)
  • Embedded SQL in COBOL (was: If you were inventing CoBOL...)
    ... If the SQL is talking ... >through an ODBC driver, it can access any brand of relational ... When the compiler provides an ODBC client driver, ...
    (comp.lang.cobol)
  • Re: HOWTO?: force optimizer to use a "remote index join" when joining local to remote table
    ... If you are using ODBC, you can turn on ODBC tracing ... This will work for any ODBC driver or client, ... ODBC messages take the form of SQL statements. ... syntax is similar to MS SQL Server SQL. ...
    (microsoft.public.access.externaldata)
  • Re: Special Table and Column Names
    ... Using SQL, ... This is fine, but when using SQLTables to get a list of tables, ODBC ... gives you NO indication that the table is "special", and needs quotes ... SQLTables contains all the special characters, ...
    (microsoft.public.data.odbc)