Updating MyODBC Error
am 25.04.2006 15:47:03 von rafarife ----------MailBlocks_8C83685DE59A8E8_2D88_8E95_mblkn-m02.sys ops.aol.com
Content-Type: multipart/alternative;
boundary="--------MailBlocks_8C83685DE59A8E8_2D88_8E96_mblkn -m02.sysops.aol.com"
----------MailBlocks_8C83685DE59A8E8_2D88_8E96_mblkn-m02.sys ops.aol.com
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello,
I have a problem when I try to update a record in a client-cursor.
=20
I am using Visual Basic 6.0, MyOdbc 3.51.12, Windows 2000 and ADO 2.8, and I=
=20
have found the problem both in Mysql 4.0 and Mysql 4.1 (latest versions) wit=
h
InnoDB.
Here is the code:
........................
Dim Conexion as ADODB.Connection
Dim Opciones As Long
Set Conexion =3D New ADODB.Connection
Opciones =3D 1 + 2 + 8 + 16384
=20
'Open the connection
Conexion.ConnectionString =3D "DRIVER=3D{MySQL ODBC 3.51 Driver};" _
& "SERVER=3Dlocalhost;" _
& "UID=3Duser;PWD=3Dpassword;OPTION=3D" & Str$(Opcione=
s)
Conexion.Open
=20
'open the cursor
Dim MiSet as ADODB.Recorset,MiSQL as string
Set MiSet =3D New ADODB.Recordset
=20
'SQL to get the cursor
MiSQL=3D"select articulos.*,tPrv.Nom PrvNom from articulos " & _
"inner join artdivision ad on articulos.cod=3Dad.cod and ad.division=3D'00=
1' " & _
"left join proveedores tPrv on articulos.prv=3DtPrv.cod " & _
"where articulos.cod>'Z0000008' order by articulos.cod asc limit 1"
'Configuring then cursor
MiSet.CursorLocation =3D adUseClient
MiSet.CursorType =3D adOpenStatic
MiSet.LockType =3D adLockOptimistic
MiSet.Properties("Update Criteria") =3D adCriteriaKey
MiSet.Properties("Update Resync") =3D adResyncNone
MiSet.Properties("Unique Table").Value =3D "articulos"
=20
'Open the cursor
MiSet.Open MiSQL, Conexion, , , adCmdText 'This opens the cursor. (Ok)
=20
'This does not run
MiSet!Nom=3D"New name"
MiSet.Update ->ERROR ...=20
=20
I get the following error:
?conexion.Errors(0).Description,conexion.Errors(0).NativeErr or,conexion.Err=
ors(0).Number
Informaci=F3n de columna clave insuficiente para realizar la operaci=F3n Up=
date o Refresh. =20
1007 -2147467259=20
'The information of the key column is not sufficient to do the update or re=
fresh'
=20
........................
If I get the cursor from this SQL:
SELECT ARTICULOS.*,TPRV.NOM PRVNOM FROM ARTICULOS=20
INNER JOIN ARTDIVISION AD ON ARTICULOS.COD=3DAD.COD AND AD.DIVISION=3D'001'=20
LEFT JOIN PROVEEDORES TPRV ON ARTICULOS.PRV=3DTPRV.COD=20
WHERE ARTICULOS.COD<'Z0000250' ORDER BY ARTICULOS.COD DESC LIMIT 1
=20
I cannot either update the cursor.=20
I think It is a problem of MyODBC.
I have sent the tables in the MyTables.Sql file.
Thanks in advance,
Rafa
=20
___________________________________________________
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
http://mail.netscape.com
----------MailBlocks_8C83685DE59A8E8_2D88_8E96_mblkn-m02.sys ops.aol.com
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
lo,
and I
have found the problem both in Mysql 4.0 and Mysql 4.1 (latest ver=
sions) with
InnoDB.
Here is the code:
.......................
Dim Opciones As Long
Conexion.ConnectionString =3D "DRIVER=3D{MySQL=20=
ODBC 3.51 Driver};" _
&nb=
sp; =20=
& "SERVER=3Dlocalhost;" _
&=
nbsp;  =
; & "UID=3Duser;PWD=3Dpassword;OPTION=3D" & Str$(Opciones) V>
Dim MiSet as ADODB.Recorset,MiSQL as string
MiSQL=3D"select articulos.*,tPrv.Nom PrvNom f=
rom articulos " & _
"inner join artdivision ad on articulos.co=
d=3Dad.cod and ad.division=3D'001' " & _
"left join proveedore=
s tPrv on articulos.prv=3DtPrv.cod " & _
"where articulos.cod&=
gt;'Z0000008' order by articulos.cod asc limit 1"
'Configuring then cursor
MiSet.CursorLocation =3D adUseClient
>MiSet.CursorType =3D adOpenStatic
MiSet.LockType =3D adLockOptimistic
>MiSet.Properties("Update Criteria") =3D adCriteriaKey
MiSet.Properties("=
Update Resync") =3D adResyncNone
MiSet.Properties("Unique Table").Value=20=
=3D "articulos"
MiSet.Open MiSQL, Conexion, , , adCmdText 'This ope=
ns the cursor. (Ok)
MiSet!Nom=3D"New name"
MiSet.Update ->ERROR=
...
nexion.Errors(0).Number
Informaci=F3n de columna clave insuficiente=
para realizar la operaci=F3n Update o Refresh.  =
;
1007 =
-2147467259
date or refresh'
.......................
INNER JOIN ARTDIV=
ISION AD ON ARTICULOS.COD=3DAD.COD AND AD.DIVISION=3D'001'
LEFT JOIN PRO=
VEEDORES TPRV ON ARTICULOS.PRV=3DTPRV.COD
WHERE ARTICULOS.COD<'Z00002=
50' ORDER BY ARTICULOS.COD DESC LIMIT 1
I think It is a problem of MyODBC.
Rafa
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
=3D"http://mail.netscape.com">http://mail.netscape.com
----------MailBlocks_8C83685DE59A8E8_2D88_8E96_mblkn-m02.sys ops.aol.com--
----------MailBlocks_8C83685DE59A8E8_2D88_8E95_mblkn-m02.sys ops.aol.com
Content-Type: text/plain; charset=us-ascii
--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org
----------MailBlocks_8C83685DE59A8E8_2D88_8E95_mblkn-m02.sys ops.aol.com--