Bug #30386 Writing conflict through Access ODBC linked tables
Submitted: 13 Aug 2007 10:50 Modified: 19 Aug 2007 17:46
Reporter: Cristina Polo Conde Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:3.51.19 OS:Windows
Assigned to: CPU Architecture:Any

[13 Aug 2007 10:50] Cristina Polo Conde
Description:
Related to Bug #17213 which status is no feedback.

I have exactly the same problem using MyODBC 3.51.19 and MS Access 2002.

When I try to modify or delete a record, a message notifying a writing conflict appears,
however, there is no any other user conected.

I had no problems with the update of this table in the past but since last month I cannot
modify any record of this table and the same is happening with other tables, even from
different databases, but in this case the error does not appear always.

I would be very grateful if you could help me as soon as possible since it is very
important for the company.

The CREATEstatement follows:

contratos |CREATE TABLE `contratos` (
  `cod_presupuesto` varchar(5) NOT NULL default '',
  `area` char(3) default NULL,
  `proveedor` varchar(100) default NULL,
  `descripcion` varchar(255) default NULL,
  `inicio_cont` datetime default NULL,
  `fin_cont` datetime default NULL,
  `f_vto` datetime default NULL,
  `estado` varchar(50) default NULL,
  `observacion_estado` varchar(255) default NULL,
  `periodicidad` int(7) default NULL,
  `tipo_servicio` varchar(50) default NULL,
  `fianza` double(10,3) default NULL,
  `prorroga` varchar(50) default NULL,
  `fichero` varchar(50) default NULL,
  `duracion_contrato` int(7) default NULL,
  `fianza_prov` double(10,3) default NULL,
  `fecha_fianza` datetime default NULL,
  `fecha_adj` datetime default NULL,
  `fecha_form_contrato` datetime default NULL,
  `cuota` double(10,3) default NULL,
  `NContrato` int(11) default NULL,
  `fecha_firma` datetime default NULL,
  `fecha_alta_bd` datetime default NULL,
  `fecha_solicitud` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`cod_presupuesto`)
) TYPE=MyISAM |

How to repeat:
From MS Access 2002 link a table defined in mysql database.

Try to modify or delete a record.
[13 Aug 2007 16:20] MySQL Verification Team
Thank you for the bug report. Could you please see:

http://dev.mysql.com/doc/refman/5.0/en/myodbc-errors.html

25.1.6.3.7: How do I handle Write Conflicts or Row Location errors?
[14 Aug 2007 6:42] Cristina Polo Conde
Thank you very much for your help.

I had already looked at that manual reference and I tried the suggested solution but it failed. Nevertheless I have found the solution. The problem was in the last field:

`fecha_solicitud` datetime NOT NULL default '0000-00-00 00:00:00'

It is defined as a not null element with a default value and this value has an english format. I  guess that it does not fit well with MS Access (Spanish version). Eventually, I have defined that date as the others:

`fecha_solicitud` datetime default NULL,

I hope this can help somebody else.
[14 Aug 2007 8:00] Susanne Ebrecht
Hello Cristina,

Unfortunately, date formats are very country specific.

Is it ok, when we close this bug, because it is no bug?

Regards,

Susanne
[19 Aug 2007 17:46] Tonci Grgin
Hi Cristina and thanks for your report.

I was unable to verify the problem using:
 - MySQL server 5.0.48-pb1038 on WinXP Pro SP2 localhost
 - MyODBC 3.51.19 and Access 2003
 - Croatian date format (dd.MM.yyyy)
 - Test included inserting 55,2 in first two fields and then updating that record so that value of second field is 15

C:\mysql507\bin\mysqld-max-nt, Version: 5.0.48-pb1038-log (MySQL Pushbuild Edition, build 1038). started with:
TCP Port: 3306, Named Pipe: mypipe1
Time                 Id Command    Argument
070819 19:35:05	      1 Connect     root@localhost on test
		      1 Query       select @@version_comment limit 1
070819 19:35:24	      1 Query       CREATE TABLE `contratos` (
  `cod_presupuesto` varchar(5) NOT NULL default '',
  `area` char(3) default NULL,
  `proveedor` varchar(100) default NULL,
  `descripcion` varchar(255) default NULL,
  `inicio_cont` datetime default NULL,
  `fin_cont` datetime default NULL,
  `f_vto` datetime default NULL,
  `estado` varchar(50) default NULL,
  `observacion_estado` varchar(255) default NULL,
  `periodicidad` int(7) default NULL,
  `tipo_servicio` varchar(50) default NULL,
  `fianza` double(10,3) default NULL,
  `prorroga` varchar(50) default NULL,
  `fichero` varchar(50) default NULL,
  `duracion_contrato` int(7) default NULL,
  `fianza_prov` double(10,3) default NULL,
  `fecha_fianza` datetime default NULL,
  `fecha_adj` datetime default NULL,
  `fecha_form_contrato` datetime default NULL,
  `cuota` double(10,3) default NULL,
  `NContrato` int(11) default NULL,
  `fecha_firma` datetime default NULL,
  `fecha_alta_bd` datetime default NULL,
  `fecha_solicitud` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`cod_presupuesto`)
) TYPE=MyISAM
070819 19:36:49	      2 Connect     root@localhost on test
		      2 Query       SET NAMES latin1
		      2 Query       SELECT Config, nValue FROM MSysConf
		      2 Query       SHOW TABLE STATUS
070819 19:37:22	      2 Field List  contratos 
		      2 Query       SHOW TABLE STATUS LIKE 'contratos'
		      2 Field List  contratos 
		      2 Query       SHOW KEYS FROM `contratos`
070819 19:37:50	      2 Query       SELECT `contratos`.`cod_presupuesto` FROM `contratos`
070819 19:38:00	      2 Query       SET AUTOCOMMIT=0
		      2 Query       INSERT INTO  `contratos`  (`cod_presupuesto`,`area`) VALUES ('55','2')
		      2 Query       COMMIT
		      2 Query       SET AUTOCOMMIT=1
		      2 Query       SELECT `cod_presupuesto`,`area`,`proveedor`,`descripcion`,`inicio_cont`,`fin_cont`,`f_vto`,`estado`,`observacion_estado`,`periodicidad`,`tipo_servicio`,`fianza`,`prorroga`,`fichero`,`duracion_contrato`,`fianza_prov`,`fecha_fianza`,`fecha_adj`,`fecha_form_contrato`,`cuota`,`NContrato`,`fecha_firma`,`fecha_alta_bd`,`fecha_solicitud`  FROM `contratos`  WHERE `cod_presupuesto` = '55'
		      2 Query       SELECT `cod_presupuesto`,`area`,`proveedor`,`descripcion`,`inicio_cont`,`fin_cont`,`f_vto`,`estado`,`observacion_estado`,`periodicidad`,`tipo_servicio`,`fianza`,`prorroga`,`fichero`,`duracion_contrato`,`fianza_prov`,`fecha_fianza`,`fecha_adj`,`fecha_form_contrato`,`cuota`,`NContrato`,`fecha_firma`,`fecha_alta_bd`,`fecha_solicitud`  FROM `contratos`  WHERE `cod_presupuesto` = '55'
--<cut>--
070819 19:39:12	      2 Query       SET AUTOCOMMIT=0
		      2 Query       UPDATE `contratos` SET `area`='15'  WHERE `cod_presupuesto` = '55' AND `area` = '2' AND `proveedor` IS NULL AND `descripcion` IS NULL AND `inicio_cont` IS NULL AND `fin_cont` IS NULL AND `f_vto` IS NULL AND `estado` IS NULL AND `observacion_estado` IS NULL AND `periodicidad` IS NULL AND `tipo_servicio` IS NULL AND `fianza` IS NULL AND `prorroga` IS NULL AND `fichero` IS NULL AND `duracion_contrato` IS NULL AND `fianza_prov` IS NULL AND `fecha_fianza` IS NULL AND `fecha_adj` IS NULL AND `fecha_form_contrato` IS NULL AND `cuota` IS NULL AND `NContrato` IS NULL AND `fecha_firma` IS NULL AND `fecha_alta_bd` IS NULL AND `fecha_solicitud` IS NULL
		      2 Query       COMMIT
		      2 Query       SET AUTOCOMMIT=1
070819 19:39:47	      1 Query       select * from contratos

mysql> select * from contratos\G
*************************** 1. row ***************************
    cod_presupuesto: 55
               area: 15
          proveedor: NULL
        descripcion: NULL
        inicio_cont: NULL
           fin_cont: NULL
              f_vto: NULL
             estado: NULL
 observacion_estado: NULL
       periodicidad: NULL
      tipo_servicio: NULL
             fianza: NULL
           prorroga: NULL
            fichero: NULL
  duracion_contrato: NULL
        fianza_prov: NULL
       fecha_fianza: NULL
          fecha_adj: NULL
fecha_form_contrato: NULL
              cuota: NULL
          NContrato: NULL
        fecha_firma: NULL
      fecha_alta_bd: NULL
    fecha_solicitud: 0000-00-00 00:00:00
1 row in set (0.00 sec)

mysql>
[17 Oct 2007 11:07] Susanne Ebrecht
The bug #17213 is a duplicate of this bug.