Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error 22026 "String Data, Length Mismatch"

256 views
Skip to first unread message

Neumann@discussions.microsoft.com Julia Neumann

unread,
Oct 16, 2009, 5:21:01 AM10/16/09
to
Hello,

I think I am running into the known bug
http://support.microsoft.com/kb/325765/en-us
trying to update multiple nvarchar values (SQL_C_WCHAR) via ODBC.

After SQLBindParameter() and SQLExecute() and SQLParamData() and
SQLPutData() on the first value, SQLParamData() fails on the second value
with state 22026 and message (in German)
"[Microsoft][ODBC SQL Server Driver]Zeichenfolgedaten mit ungültiger Länge"

The error occurs with SQL Server 2000, 2005 (SP 3) and 2008.
The workaround described in the KB article works: Inserting the values as
SQL_C_CHAR. But that' s not possible.

Is the hotfix mentioned in the article available or are there any other
remedies?
Thanks in advance
Julia

Sylvain Lafontaine

unread,
Oct 16, 2009, 1:32:15 PM10/16/09
to
I suppose that this hotfix is still available from Microsoft. Did you
contact them?

But first, the first thing to do would be to verify that you're still on
MDAC 2.7 (or lower). If you have applied all the latest updates, you should
be at MDAC 2.8 or higher (2.81). Also, you don't tell us on which operating
system (at the client) this error is happening.

Finally, you should try with the latest ODBC driver available: the Native
Provider; available in in the SQL-Server 2008 Feature Pack:

http://www.microsoft.com/DownLoads/details.aspx?familyid=B33D2C78-1059-4CE2-B80D-2343C099BCB4&displaylang=en

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)


"Julia Neumann" <Julia Neu...@discussions.microsoft.com> wrote in message
news:B20A546F-52DA-4C95...@microsoft.com...


> Hello,
>
> I think I am running into the known bug
> http://support.microsoft.com/kb/325765/en-us
> trying to update multiple nvarchar values (SQL_C_WCHAR) via ODBC.
>
> After SQLBindParameter() and SQLExecute() and SQLParamData() and
> SQLPutData() on the first value, SQLParamData() fails on the second value
> with state 22026 and message (in German)

> "[Microsoft][ODBC SQL Server Driver]Zeichenfolgedaten mit ung�ltiger
> L�nge"

Julia Neumann

unread,
Oct 21, 2009, 4:40:12 AM10/21/09
to
Hi!

"Sylvain Lafontaine" wrote:
> I suppose that this hotfix is still available from Microsoft. Did you
> contact them?

I'm planning to do that now.

> But first, the first thing to do would be to verify that you're still on
> MDAC 2.7 (or lower). If you have applied all the latest updates, you should
> be at MDAC 2.8 or higher (2.81). Also, you don't tell us on which operating
> system (at the client) this error is happening.

The client's operating system is Windows XP SP 3.
The error occurred with driver version 2000.85.1132.00.
But the same error occurs with the latest driver 2007.200.2531.00:
[Microsoft][SQL Server Native Client 10.0]String data, length mismatch

I think I have to ask for the hotfix.
Julia

raj.v...@gmail.com

unread,
Nov 26, 2018, 4:39:39 AM11/26/18
to
Hi,

I am facing the same issue when trying to run the insert query which has 2 long text fields. I am using the odbc driver 13 and MDAC is also greater than 2.8 as mentioned. What is the solution for this issue.

Regards,
Rajesh
0 new messages