Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

[Generic Connectivity Using ODBC][Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error (SQL State: 07001; SQL Code: 0)

ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Generic Connectivity Using ODBC][Microsoft][ODBC SQL Server Driver]
COUNT field incorrect or syntax error
(SQL State: 07001; SQL Code: 0) ORA-06512: at line 9

Anyone know this error.. pls help us.

thanks in advance.

like image 841
user1802125 Avatar asked Nov 06 '12 06:11

user1802125


2 Answers

Since you do not provide any type of code from where this error is generated I can only guess here. After asking Google and found this, it looks like COUNT field incorrect or syntax error could mean that you use the wrong number of parameters in your call.

If you posted the code where the error is generated from it could help a lot to understand what could go wrong.

like image 166
Qben Avatar answered Oct 17 '22 09:10

Qben


I just lost at least an hour+ debugging my code to see what the issue was. I was using an ADODB connection in VBA with parameters. Apparently if don't have the Set keyword, debugging output will look like the parameter has a value, but it's not actually there upstream. Of course I knew Set was needed, but it's easy to overlook when you're trying to spot the problem.

Problem:

    params(1) = cmd.CreateParameter("Email_ID", adInteger, adParamInput, , EmailID)

Corrected code:

    Set params(1) = cmd.CreateParameter("Email_ID", adInteger, adParamInput, , EmailID)
like image 27
Eric Harlan Avatar answered Oct 17 '22 09:10

Eric Harlan