Problem with update.

------=_NextPart_000_000B_01C6678B.DEAF3FE0
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

Hi,

I had a problems with updating rowset.
I use odbc driver ver. 3.51.12 on WinXp and I couldn't update any row.

I set statment:
SQLSetStmtAttr(hstmt,SQL_ATTR_CURSOR_SCROLLABLE,(SQLPOINTER) SQL_SCROLLABL=
E,0);
SQLSetStmtAttr(hstmt,SQL_ATTR_CURSOR_TYPE,(SQLPOINTER)SQL_CU RSOR_DYNAMIC,=
0);
SQLSetStmtAttr(hstmt,SQL_ATTR_CONCURRENCY,(SQLPOINTER)SQL_CO NCUR_LOCK,0);=


I bind col:
SQLBindCol(hstmt,1,SQL_C_SLONG,&ret,0,&cb);

I fetch row:
SQLFetchScroll(hstmt, SQL_FETCH_NEXT, 0);

I change ret value
and I try update row:
SQLSetPos(hstmt,1,SQL_UPDATE,SQL_LOCK_NO_CHANGE);

And then I get exception:
"Unhandled exception at 0x1004c170 in odbc_test.exe: 0xC0000005: Access =
violation reading location 0x00000000."

When I change SQL_LOCK_NO_CHANGE to SQL_LOCK_EXCLUSIVE
I get odbc error:
"[MySQL][ODBC 3.51 Driver][mysqld-5.0.18-max]Invalid cursor position"
code: "HY109"

When I use MS SQL Server and it's driver everthing works. The same code, =
table and data.


I found that the problem was with binding columns. My sql query took all =
columns from the table and i only bind one column. Is any way to take =
columns and bind not all ?

Thanks for comments.
Roman
------=_NextPart_000_000B_01C6678B.DEAF3FE0--
p_romm [ Mo, 24 April 2006 10:43 ] [ ID #1286981 ]
Datenbanken » gmane.comp.db.mysql.odbc » Problem with update.

Vorheriges Thema: Access Error when linking/exporting Data through MySQL ODBC connection
Nächstes Thema: Show columns from table like 'field' and odbc 3.51.12