dbTalk Databases Forums  

Problem with update.

mailing.database.myodbc mailing.database.myodbc


Discuss Problem with update. in the mailing.database.myodbc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Problem with update. - 04-24-2006 , 04:25 AM






------=_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.=20

I set statment:=20
SQLSetStmtAttr(hstmt,SQL_ATTR_CURSOR_SCROLLABLE,(S QLPOINTER)SQL_SCROLLABL=
E,0);=20
SQLSetStmtAttr(hstmt,SQL_ATTR_CURSOR_TYPE,(SQLPOIN TER)SQL_CURSOR_DYNAMIC,=
0);=20
SQLSetStmtAttr(hstmt,SQL_ATTR_CONCURRENCY,(SQLPOIN TER)SQL_CONCUR_LOCK,0);=
=20

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

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

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

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

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

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


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--


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.