adodc issue
am 29.09.2004 11:33:36 von Mark Mchugh
hi,
I am getting the following error when trying to update
a record using adodc
"the microsoft database engine stopped the process
because you and another user are attempting to change
the same data at the same time"
is there a way to quicky see which field is causing
the problem?
thanks
Mark
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
Re: adodc issue
am 29.09.2004 12:22:32 von Bernard LEFEUVRE
Hello,
I am searching a solution for the same problem.
We have recently migrate our database from MySql 4.0.15 Win 32 version
to MySql 4.0.21 Linux and now we encouter this error when we try to
update a record.
I develop the applications with Access 2000 and attach MySql tables with
My ODBC 3.51. I don't have any problem on my development configuration
which use MySql 4.0.21 on a Windows XP machine.
Thanks
Bernard
Mark Mchugh wrote:
>hi,
>I am getting the following error when trying to update
>a record using adodc
>
>"the microsoft database engine stopped the process
>because you and another user are attempting to change
>the same data at the same time"
>
>
>is there a way to quicky see which field is causing
>the problem?
>
>
>thanks
>
>Mark
>
>
>
>
>__________________________________
>Do you Yahoo!?
>Read only the mail you want - Yahoo! Mail SpamGuard.
>http://promotions.yahoo.com/new_mail
>
>
>
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
Re: adodc issue
am 29.09.2004 12:40:35 von Mark Mchugh
this is a very unusual issue. I am running 2 databases
on my server, and have 2 development projects. Both
projects use a similar code base. This error only
happens with one of the projects. When i chane the
project with the error to point at the other database,
it works fine. I am completely stumpted!!!!!
anybody else seen this?
thanks
MArk
--- Bernard LEFEUVRE
wrote:
> Hello,
> I am searching a solution for the same problem.
>
> We have recently migrate our database from MySql
> 4.0.15 Win 32 version
> to MySql 4.0.21 Linux and now we encouter this error
> when we try to
> update a record.
> I develop the applications with Access 2000 and
> attach MySql tables with
> My ODBC 3.51. I don't have any problem on my
> development configuration
> which use MySql 4.0.21 on a Windows XP machine.
>
> Thanks
>
> Bernard
>
> Mark Mchugh wrote:
>
> >hi,
> >I am getting the following error when trying to
> update
> >a record using adodc
> >
> >"the microsoft database engine stopped the process
> >because you and another user are attempting to
> change
> >the same data at the same time"
> >
> >
> >is there a way to quicky see which field is causing
> >the problem?
> >
> >
> >thanks
> >
> >Mark
> >
> >
> >
> >
> >__________________________________
> >Do you Yahoo!?
> >Read only the mail you want - Yahoo! Mail
> SpamGuard.
> >http://promotions.yahoo.com/new_mail
> >
> >
> >
>
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
RE: adodc issue
am 29.09.2004 13:35:37 von Bob Ingram
My experience with this error, using MySQL 4.0.17 and ODBC 3.51.06 with Win
XP and Delphi 6, has been that it occurs for date fields when the have a
default value. Removing the default value eliminated the error.
-----Original Message-----
From: Mark Mchugh [mailto:mark_mch@yahoo.com]
Sent: Wednesday, September 29, 2004 6:41 AM
To: bernard.lefeuvre@nantes.fr
Cc: mysql list
Subject: Re: adodc issue
this is a very unusual issue. I am running 2 databases
on my server, and have 2 development projects. Both
projects use a similar code base. This error only
happens with one of the projects. When i chane the
project with the error to point at the other database,
it works fine. I am completely stumpted!!!!!
anybody else seen this?
thanks
MArk
--- Bernard LEFEUVRE
wrote:
> Hello,
> I am searching a solution for the same problem.
>
> We have recently migrate our database from MySql
> 4.0.15 Win 32 version
> to MySql 4.0.21 Linux and now we encouter this error
> when we try to
> update a record.
> I develop the applications with Access 2000 and
> attach MySql tables with
> My ODBC 3.51. I don't have any problem on my
> development configuration
> which use MySql 4.0.21 on a Windows XP machine.
>
> Thanks
>
> Bernard
>
> Mark Mchugh wrote:
>
> >hi,
> >I am getting the following error when trying to
> update
> >a record using adodc
> >
> >"the microsoft database engine stopped the process
> >because you and another user are attempting to
> change
> >the same data at the same time"
> >
> >
> >is there a way to quicky see which field is causing
> >the problem?
> >
> >
> >thanks
> >
> >Mark
> >
> >
> >
> >
> >__________________________________
> >Do you Yahoo!?
> >Read only the mail you want - Yahoo! Mail
> SpamGuard.
> >http://promotions.yahoo.com/new_mail
> >
> >
> >
>
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=bobingra@bellsouth.net
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
Re: adodc issue
am 29.09.2004 23:11:08 von Bernard LEFEUVRE
Thanks for your help, but in my case i don't have any date.
I have the error when i want to update this table.
# tables des adresses
create table ADRESSES (
NUMADRESSE integer not null,
ADR1 varchar(50),
ADR2 varchar(50),
ADR3 varchar(50),
CODE_POSTAL varchar(5) not null,
VILLE varchar(50) not null,
TEL varchar(15),
MOBILE varchar(15),
FAX varchar(15),
MEL varchar(50),
SITE_WEB varchar(50),
NPAI smallint);
create unique index X1_ADRESSES on ADRESSES (
NUMADRESSE);
alter table ADRESSES
add primary key (NUMADRESSE);
Bernard
Bob Ingram wrote:
>My experience with this error, using MySQL 4.0.17 and ODBC 3.51.06 with Win
>XP and Delphi 6, has been that it occurs for date fields when the have a
>default value. Removing the default value eliminated the error.
>
>
>-----Original Message-----
>From: Mark Mchugh [mailto:mark_mch@yahoo.com]
>Sent: Wednesday, September 29, 2004 6:41 AM
>To: bernard.lefeuvre@nantes.fr
>Cc: mysql list
>Subject: Re: adodc issue
>
>this is a very unusual issue. I am running 2 databases
>on my server, and have 2 development projects. Both
>projects use a similar code base. This error only
>happens with one of the projects. When i chane the
>project with the error to point at the other database,
>it works fine. I am completely stumpted!!!!!
>
>anybody else seen this?
>
>thanks
>
>MArk
>--- Bernard LEFEUVRE
>wrote:
>
>
>
>>Hello,
>>I am searching a solution for the same problem.
>>
>>We have recently migrate our database from MySql
>>4.0.15 Win 32 version
>>to MySql 4.0.21 Linux and now we encouter this error
>>when we try to
>>update a record.
>>I develop the applications with Access 2000 and
>>attach MySql tables with
>>My ODBC 3.51. I don't have any problem on my
>>development configuration
>>which use MySql 4.0.21 on a Windows XP machine.
>>
>>Thanks
>>
>>Bernard
>>
>>Mark Mchugh wrote:
>>
>>
>>
>>>hi,
>>>I am getting the following error when trying to
>>>
>>>
>>update
>>
>>
>>>a record using adodc
>>>
>>>"the microsoft database engine stopped the process
>>>because you and another user are attempting to
>>>
>>>
>>change
>>
>>
>>>the same data at the same time"
>>>
>>>
>>>is there a way to quicky see which field is causing
>>>the problem?
>>>
>>>
>>>thanks
>>>
>>>Mark
>>>
>>>
>>>
>>>
>>>__________________________________
>>>Do you Yahoo!?
>>>Read only the mail you want - Yahoo! Mail
>>>
>>>
>>SpamGuard.
>>
>>
>>>http://promotions.yahoo.com/new_mail
>>>
>>>
>>>
>>>
>>>
>
>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Mail is new and improved - Check it out!
>http://promotions.yahoo.com/new_mail
>
>--
>MySQL Windows Mailing List
>For list archives: http://lists.mysql.com/win32
>To unsubscribe: http://lists.mysql.com/win32?unsub=bobingra@bellsouth.net
>
>
>
>
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
Re: adodc issue
am 05.10.2004 19:12:18 von Bernard LEFEUVRE
Hi,
I found the solution, i have upgraded the Jet 4.0 Engine with Service
Pack 8.
Bernard
Bernard LEFEUVRE wrote:
> Thanks for your help, but in my case i don't have any date.
>
> I have the error when i want to update this table.
>
> # tables des adresses
>
> create table ADRESSES (
> NUMADRESSE integer not null,
> ADR1 varchar(50),
> ADR2 varchar(50),
> ADR3 varchar(50),
> CODE_POSTAL varchar(5) not null,
> VILLE varchar(50) not null,
> TEL varchar(15),
> MOBILE varchar(15),
> FAX varchar(15),
> MEL varchar(50),
> SITE_WEB varchar(50),
> NPAI smallint);
>
> create unique index X1_ADRESSES on ADRESSES (
> NUMADRESSE);
>
> alter table ADRESSES
> add primary key (NUMADRESSE);
>
> Bernard
>
> Bob Ingram wrote:
>
>> My experience with this error, using MySQL 4.0.17 and ODBC 3.51.06
>> with Win
>> XP and Delphi 6, has been that it occurs for date fields when the have a
>> default value. Removing the default value eliminated the error.
>>
>>
>> -----Original Message-----
>> From: Mark Mchugh [mailto:mark_mch@yahoo.com]
>> Sent: Wednesday, September 29, 2004 6:41 AM
>> To: bernard.lefeuvre@nantes.fr
>> Cc: mysql list
>> Subject: Re: adodc issue
>>
>> this is a very unusual issue. I am running 2 databases
>> on my server, and have 2 development projects. Both
>> projects use a similar code base. This error only
>> happens with one of the projects. When i chane the
>> project with the error to point at the other database,
>> it works fine. I am completely stumpted!!!!!
>>
>> anybody else seen this?
>>
>> thanks
>>
>> MArk
>> --- Bernard LEFEUVRE
>> wrote:
>>
>>
>>
>>> Hello,
>>> I am searching a solution for the same problem.
>>>
>>> We have recently migrate our database from MySql
>>> 4.0.15 Win 32 version
>>> to MySql 4.0.21 Linux and now we encouter this error
>>> when we try to
>>> update a record.
>>> I develop the applications with Access 2000 and
>>> attach MySql tables with
>>> My ODBC 3.51. I don't have any problem on my
>>> development configuration
>>> which use MySql 4.0.21 on a Windows XP machine.
>>>
>>> Thanks
>>>
>>> Bernard
>>>
>>> Mark Mchugh wrote:
>>>
>>>
>>>
>>>> hi,
>>>> I am getting the following error when trying to
>>>>
>>>
>>> update
>>>
>>>
>>>> a record using adodc
>>>>
>>>> "the microsoft database engine stopped the process
>>>> because you and another user are attempting to
>>>>
>>>
>>> change
>>>
>>>
>>>> the same data at the same time"
>>>>
>>>>
>>>> is there a way to quicky see which field is causing
>>>> the problem?
>>>>
>>>>
>>>> thanks
>>>>
>>>> Mark
>>>>
>>>>
>>>>
>>>>
>>>> __________________________________
>>>> Do you Yahoo!?
>>>> Read only the mail you want - Yahoo! Mail
>>>>
>>>
>>> SpamGuard.
>>>
>>>
>>>> http://promotions.yahoo.com/new_mail
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>>
>> __________________________________
>> Do you Yahoo!?
>> Yahoo! Mail is new and improved - Check it out!
>> http://promotions.yahoo.com/new_mail
>>
>> --
>> MySQL Windows Mailing List
>> For list archives: http://lists.mysql.com/win32
>> To unsubscribe:
>> http://lists.mysql.com/win32?unsub=bobingra@bellsouth.net
>>
>>
>>
>>
>
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
Inserting but getting the returned ID?
am 05.10.2004 22:30:33 von Danny Willis
Ok,
I'm inserting a new row into a table, but I want to get the auto-generated
ID for that row in return. Is there a nice simple way to do this without
having to query the database a second time trying to find the new row you
just inserted?
Thanks,
Dan
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
RE: Inserting but getting the returned ID?
am 05.10.2004 22:41:12 von paulo.urcid
If you're using java you can do something like this:
PreparedStatement insertAccess;
...
int rows = insertAccess.executeUpdate();
ResultSet rs = insertAccess.getGeneratedKeys();
If you want to check the javadocs see the java.sql.PreparedStatement /
java.sql.Statement packages
-----Original Message-----
From: Danny Willis [mailto:danny.willis@project-wildfire.com]
Sent: Martes, 05 de Octubre de 2004 03:31 p.m.
To: 'mysql list'
Subject: Inserting but getting the returned ID?
Ok,
I'm inserting a new row into a table, but I want to get the auto-generated
ID for that row in return. Is there a nice simple way to do this without
having to query the database a second time trying to find the new row you
just inserted?
Thanks,
Dan
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=urcid@vw.com.mx
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
RE: Inserting but getting the returned ID?
am 06.10.2004 09:23:22 von Puneet Bhasin
It works in MySQL Another way is to send 2 queries in batch
Like
INSERT ..... ; SELECT @@IDENTITY;
The SELECT @@IDENTITY will give the auto-generated PK of the last
inserted record.as well as SQL Server.
Cheers !!
-----Original Message-----
From: Urcid Pliego, Paulo [mailto:paulo.urcid@vw.com.mx]
Sent: Wednesday, October 06, 2004 2:11 AM
To: 'Danny Willis'; 'mysql list'
Subject: RE: Inserting but getting the returned ID?
If you're using java you can do something like this:
PreparedStatement insertAccess;
...
int rows = insertAccess.executeUpdate();
ResultSet rs = insertAccess.getGeneratedKeys();
If you want to check the javadocs see the java.sql.PreparedStatement /
java.sql.Statement packages
-----Original Message-----
From: Danny Willis [mailto:danny.willis@project-wildfire.com]
Sent: Martes, 05 de Octubre de 2004 03:31 p.m.
To: 'mysql list'
Subject: Inserting but getting the returned ID?
Ok,
I'm inserting a new row into a table, but I want to get the
auto-generated
ID for that row in return. Is there a nice simple way to do this
without
having to query the database a second time trying to find the new row
you
just inserted?
Thanks,
Dan
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=urcid@vw.com.mx
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe:
http://lists.mysql.com/win32?unsub=pbhasin@dreamingcode.com
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
RE: Inserting but getting the returned ID?
am 06.10.2004 14:53:13 von hernando.patino
Since you did not say how you want to accomplish this, another way to do it
if you use mySQL C API is to check the structure MYSQL which contains the
last id generated.
Hernando
-----Original Message-----
From: Urcid Pliego, Paulo [mailto:paulo.urcid@vw.com.mx]
Sent: Tuesday, October 05, 2004 4:41 PM
To: 'Danny Willis'; 'mysql list'
Subject: RE: Inserting but getting the returned ID?
If you're using java you can do something like this:
PreparedStatement insertAccess;
...
int rows = insertAccess.executeUpdate();
ResultSet rs = insertAccess.getGeneratedKeys();
If you want to check the javadocs see the java.sql.PreparedStatement /
java.sql.Statement packages
-----Original Message-----
From: Danny Willis [mailto:danny.willis@project-wildfire.com]
Sent: Martes, 05 de Octubre de 2004 03:31 p.m.
To: 'mysql list'
Subject: Inserting but getting the returned ID?
Ok,
I'm inserting a new row into a table, but I want to get the auto-generated
ID for that row in return. Is there a nice simple way to do this without
having to query the database a second time trying to find the new row you
just inserted?
Thanks,
Dan
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=urcid@vw.com.mx
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe:
http://lists.mysql.com/win32?unsub=hernando.patino@spcorp.co m
************************************************************ *********
This message and any attachments are solely for the intended recipient. If you are not the intended recipient, disclosure, copying, use or distribution of the information included in this message is prohibited -- Please immediately and permanently delete.
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
RE: Inserting but getting the returned ID?
am 06.10.2004 15:38:33 von Danny Willis
Thanks for the help! As it turned out I found the SELECT LAST_INSERT_ID()
which returns what I'm looking for.
Thanks!
-----Original Message-----
From: Puneet [mailto:pbhasin@dreamingcode.com]
Sent: Wednesday, October 06, 2004 3:23 AM
To: 'Urcid Pliego, Paulo'; 'Danny Willis'; 'mysql list'
Subject: RE: Inserting but getting the returned ID?
It works in MySQL Another way is to send 2 queries in batch
Like
INSERT ..... ; SELECT @@IDENTITY;
The SELECT @@IDENTITY will give the auto-generated PK of the last
inserted record.as well as SQL Server.
Cheers !!
-----Original Message-----
From: Urcid Pliego, Paulo [mailto:paulo.urcid@vw.com.mx]
Sent: Wednesday, October 06, 2004 2:11 AM
To: 'Danny Willis'; 'mysql list'
Subject: RE: Inserting but getting the returned ID?
If you're using java you can do something like this:
PreparedStatement insertAccess;
...
int rows = insertAccess.executeUpdate();
ResultSet rs = insertAccess.getGeneratedKeys();
If you want to check the javadocs see the java.sql.PreparedStatement /
java.sql.Statement packages
-----Original Message-----
From: Danny Willis [mailto:danny.willis@project-wildfire.com]
Sent: Martes, 05 de Octubre de 2004 03:31 p.m.
To: 'mysql list'
Subject: Inserting but getting the returned ID?
Ok,
I'm inserting a new row into a table, but I want to get the
auto-generated
ID for that row in return. Is there a nice simple way to do this
without
having to query the database a second time trying to find the new row
you
just inserted?
Thanks,
Dan
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=urcid@vw.com.mx
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe:
http://lists.mysql.com/win32?unsub=pbhasin@dreamingcode.com
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
RE: Inserting but getting the returned ID?
am 06.10.2004 15:42:02 von hernando.patino
But you stated initially you wanted to do this:
>>without having to query the database a second time
-----Original Message-----
From: Danny Willis [mailto:danny.willis@project-wildfire.com]
Sent: Wednesday, October 06, 2004 9:39 AM
To: 'Puneet'; 'Urcid Pliego, Paulo'; 'mysql list'
Subject: RE: Inserting but getting the returned ID?
Thanks for the help! As it turned out I found the SELECT LAST_INSERT_ID()
which returns what I'm looking for.
Thanks!
-----Original Message-----
From: Puneet [mailto:pbhasin@dreamingcode.com]
Sent: Wednesday, October 06, 2004 3:23 AM
To: 'Urcid Pliego, Paulo'; 'Danny Willis'; 'mysql list'
Subject: RE: Inserting but getting the returned ID?
It works in MySQL Another way is to send 2 queries in batch Like
INSERT ..... ; SELECT @@IDENTITY;
The SELECT @@IDENTITY will give the auto-generated PK of the last inserted
record.as well as SQL Server.
Cheers !!
-----Original Message-----
From: Urcid Pliego, Paulo [mailto:paulo.urcid@vw.com.mx]
Sent: Wednesday, October 06, 2004 2:11 AM
To: 'Danny Willis'; 'mysql list'
Subject: RE: Inserting but getting the returned ID?
If you're using java you can do something like this:
PreparedStatement insertAccess;
...
int rows = insertAccess.executeUpdate();
ResultSet rs = insertAccess.getGeneratedKeys();
If you want to check the javadocs see the java.sql.PreparedStatement /
java.sql.Statement packages
-----Original Message-----
From: Danny Willis [mailto:danny.willis@project-wildfire.com]
Sent: Martes, 05 de Octubre de 2004 03:31 p.m.
To: 'mysql list'
Subject: Inserting but getting the returned ID?
Ok,
I'm inserting a new row into a table, but I want to get the auto-generated
ID for that row in return. Is there a nice simple way to do this without
having to query the database a second time trying to find the new row you
just inserted?
Thanks,
Dan
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=urcid@vw.com.mx
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=pbhasin@dreamingcode.com
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe:
http://lists.mysql.com/win32?unsub=hernando.patino@spcorp.co m
************************************************************ *********
This message and any attachments are solely for the intended recipient. If you are not the intended recipient, disclosure, copying, use or distribution of the information included in this message is prohibited -- Please immediately and permanently delete.
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
RE: Inserting but getting the returned ID?
am 06.10.2004 15:48:52 von Danny Willis
True,
But even using the INSERT ... SELECT the db class I'm using interprets it as
2 separate queries, which I was not aware of until I went into further
detail. Limitation of the software package I'm using. :(
This is all still very new to me and I appreciate the prompt assistance from
everyone. I'm going to experiment with the SELECT @@IDENTITY query today
just so I can add more to by repertoire. Learning more everyday.
-----Original Message-----
From: Patino, Hernando [mailto:hernando.patino@spcorp.com]
Sent: Wednesday, October 06, 2004 9:42 AM
To: 'Danny Willis'; 'Puneet'; 'Urcid Pliego, Paulo'; 'mysql list'
Subject: RE: Inserting but getting the returned ID?
But you stated initially you wanted to do this:
>>without having to query the database a second time
-----Original Message-----
From: Danny Willis [mailto:danny.willis@project-wildfire.com]
Sent: Wednesday, October 06, 2004 9:39 AM
To: 'Puneet'; 'Urcid Pliego, Paulo'; 'mysql list'
Subject: RE: Inserting but getting the returned ID?
Thanks for the help! As it turned out I found the SELECT LAST_INSERT_ID()
which returns what I'm looking for.
Thanks!
-----Original Message-----
From: Puneet [mailto:pbhasin@dreamingcode.com]
Sent: Wednesday, October 06, 2004 3:23 AM
To: 'Urcid Pliego, Paulo'; 'Danny Willis'; 'mysql list'
Subject: RE: Inserting but getting the returned ID?
It works in MySQL Another way is to send 2 queries in batch Like
INSERT ..... ; SELECT @@IDENTITY;
The SELECT @@IDENTITY will give the auto-generated PK of the last inserted
record.as well as SQL Server.
Cheers !!
-----Original Message-----
From: Urcid Pliego, Paulo [mailto:paulo.urcid@vw.com.mx]
Sent: Wednesday, October 06, 2004 2:11 AM
To: 'Danny Willis'; 'mysql list'
Subject: RE: Inserting but getting the returned ID?
If you're using java you can do something like this:
PreparedStatement insertAccess;
...
int rows = insertAccess.executeUpdate();
ResultSet rs = insertAccess.getGeneratedKeys();
If you want to check the javadocs see the java.sql.PreparedStatement /
java.sql.Statement packages
-----Original Message-----
From: Danny Willis [mailto:danny.willis@project-wildfire.com]
Sent: Martes, 05 de Octubre de 2004 03:31 p.m.
To: 'mysql list'
Subject: Inserting but getting the returned ID?
Ok,
I'm inserting a new row into a table, but I want to get the auto-generated
ID for that row in return. Is there a nice simple way to do this without
having to query the database a second time trying to find the new row you
just inserted?
Thanks,
Dan
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=urcid@vw.com.mx
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=pbhasin@dreamingcode.com
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe:
http://lists.mysql.com/win32?unsub=hernando.patino@spcorp.co m
************************************************************ *********
This message and any attachments are solely for the intended recipient. If
you are not the intended recipient, disclosure, copying, use or distribution
of the information included in this message is prohibited -- Please
immediately and permanently delete.
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe:
http://lists.mysql.com/win32?unsub=danny.willis@project-wild fire.com
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
Re: adodc issue
am 10.12.2004 16:37:29 von SGreen
--=_alternative 00560B1B85256F66_=
Content-Type: text/plain; charset="US-ASCII"
Thank you! (BTW, it's proper to CC: the list on all responses. That way
everyone gets to help)
The key phrase here is " you and another user are attempting to change the
same data at the same time". Normally we see that error phrase appear in
the list from developers using M$ Access's linked tables (through ODBC).
However, I suspect that your ADODC control is written similarly enough
that it inherited this problem too.
The easiest workaround is to:
1) Make sure there is a primary key on the table you are attempting to
update
2) Make sure there is a TIMESTAMP column on the table you are attempting
to update. If you have to add one make sure it's a TIMESTAMP column not a
DATETIME. Whenever I have to link Access to MySQL I call those superfluous
columns "lastmodified".
If doing those two things doesn't work, you might try attempt to RTFM for
some other known issues:
http://dev.mysql.com/doc/mysql/en/Programs_Known_to_Work_Wit h_MyODBC.html
http://dev.mysql.com/doc/mysql/en/MSAccess.html
Sorry I can't be more specific but as I mentioned earlier, I never data
bind anytime I can avoid it (just to dodge the "house of cards" you just
ran into). Maybe others on the list can offer more helpful advice
(anyone?). FWIW - I even go so far as to avoid using the ".update"
method of an "ADODB.recordset", I always write my UPDATE statement into a
variable and send it in using the ".execute" method of a
"ADODB.Connection".
Yours,
Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine
Mark Mchugh wrote on 12/10/2004 09:59:19 AM:
> lol, i think my teeth are almost grinded out, the data
> base i am using is mysql, vb6.0 with all the service
> packs, the i am now logging in as root, so all
> permissions should be fine. from the app, i can
> connect to the database, and read from it, and
> navigate up and down using the adodc control. the
> issue is when i change one of the fields on the form,
> and then hit the adodc contol to move up, i get the
> message "The Mircosoft jet database engine stopped the
> process becasue you and another user are attempting to
> change the same data at the same time"
>
> this is wierd, cos when i used the folling vb vode on
> the form
>
> On Error Resume Next
> For Each cnt In Me
> If cnt.DataField <> "" Then
> Debug.Print cnt.DataField & " " & cnt.Name
> Next
>
>
> i get a list of all the dataitems, and they are all
> unique, i dont know if i am being silly?
>
>
> thanks
>
>
>
> --- SGreen@unimin.com wrote:
>
> > Are you doing this from within Access or as a
> > stand-alone VB application?
> > What version are you using (Access 2.0, VS.NET, ...
> > )? What are you doing
> > when you get the error? What kind of visual control
> > are you binding your
> > datasource to? Does the account you are using in
> > your DSN have sufficient
> > privileges to change data in the table you are
> > connecting to? If you turn
> > on ODBC logging, do you see any errors in the trace?
> > I know you can test
> > the ability to *connect* from the Control Panel but
> > have you actually
> > retrieved or updated any data through that DSN by
> > some method?
> >
> > Have you heard the old saying "The Devil is in the
> > details" ? That goes
> > double for OLE (ActiveX) automation controls from
> > M$. If your ducks aren't
> > in a row and marching in step, their controls can do
> > some crazy things.
> > Have you searched http://msdn.microsoft.com for
> > other examples of using
> > an ODBC DSN with datasource controls?
> >
> > Let me know what you find out. Don't make me come
> > over there and start
> > pulling teeth ;-)
> >
> > Shawn Green
> > Database Administrator
> > Unimin Corporation - Spruce Pine
> >
> > Mark Mchugh wrote on 12/10/2004
> > 09:29:51 AM:
> >
> > > Hi Shawn,
> > > here's how i set-up the control,
> > >
> > > adodc1.Connect = "odbc;DSN=myodbc3-test"
> > >
> > > the i use adodc1.recordsource = "Select * from
> > table;"
> > >
> > > i use the standard Microsoft datasource etc for
> > each
> > > item on the form, i.e. the datasource is ADODC1,
> > and
> > > the datafield is the name in the table i want. The
> > DSN
> > > i am using works fine when i rest from the control
> > > panel, any ideas? it seems very wierd to me?
> > >
> > > many thanks for your time
> > >
> > > MArk
> > >
> > > --- SGreen@unimin.com wrote:
> > >
> > > > OK, I can tell by your code that you are using a
> > > > Basic variant (Visual
> > > > Basic or VBA) but I don't see a reference to
> > your
> > > > control (are you using a
> > > > control? Which one?) I see nothing wrong with
> > what
> > > > you posted so far.
> > > > Also your example shows you using an
> > > > ADODB.Connection not an ADODC
> > > > control. Which is it? Are you using a data bound
> > > > control or are you using
> > > > the ADODB objects directly?
> > > >
> > > > Please answer my other questions (from my first
> > > > response), too, as I am
> > > > still under-informed of what you are attempting
> > to
> > > > do. I have loads of
> > > > experience using the ADODB library directly, I
> > just
> > > > need more details
> > > > about what you are wanting to do, how you are
> > doing
> > > > it, and what you hope
> > > > to achieve.
> > > >
> > > > Thanks!
> > > >
> > > > Shawn Green
> > > > Database Administrator
> > > > Unimin Corporation - Spruce Pine
> > > >
> > > >
> > > > Daniel da Veiga wrote
> > on
> > > > 12/10/2004 08:34:16 AM:
> > > >
> > > > > I used ADODB objects with VBA to connect to
> > MySQL
> > > > and it worked, did
> > > > > you include the right references for your
> > project?
> > > > You may try
> > > > > installing the most recent MDAC for Windows.
> > You
> > > > may have a problem
> > > > > with ADO, by the time I worked with this I was
> > > > using 2.7 recordset
> > > > > library.
> > > > >
> > > > > Thats it, hope that helps,
> > > > >
> > > > > (by the way, someone really hates me on this
> > list,
> > > > I got a unsubscribe
> > > > > request from 217.91.105.119) :P *LOL*
> > > > >
> > > > > On Fri, 10 Dec 2004 03:41:39 -0800 (PST), Mark
> > > > Mchugh
> > > > > wrote:
> > > > > > hi,
> > > > > > my connection string is
> > > > > >
> > > > > > Set connMySQL = New ADODB.Connection
> > > > > > connMySQL.ConnectionString =
> > "DRIVER={mySQL
> > > > ODBC
> > > > > > 3.51 Driver};" _
> > > > > > & "SERVER=192.168.0.55;" _
> > > > > > & "DATABASE=adjust;" _
> > > > > > & "UID=*****;" _
> > > > > > & "PWD=*****;" _
> > > > > > & "OPTION=" & 1 + 2 + 8 + 32 + 2048
> > +
> > > > 16384
> > > > > >
> > > > > > i'm completely lost!!!!
> > > > > >
> > > > > >
> > > > > >
> > > > > > --- SGreen@unimin.com wrote:
> > > > > >
> > > > > > > You could stop confusing apples with
> > oranges
> > > > to
> > > > > > > start with. I can tell
> > > > > > > from your post that you are developing
> > > > something
> > > > > > > form-based (but I have no
> > > > > > > clue in which language) and are attempting
> > to
> > > > use a
> > > > > > > data-bound ADO-based
> > > > > > > control. Unfortunately, I am one of those
> > > > > > > loggerheads who prefer to do
> > > > > > > everything by hand (no binding, ever) so I
> > > > have no
> > > > > > > experience with that
> > > > > > > particular OCX. What I can tell you is
> > that if
> > > > your
> > > > > > > control thinks that
> > > > > > > your MySQL server is a Jet-type database,
> > you
> > > > have
> > > > > > > something seriously
> > > > > > > messed up.
> > > > > > >
> > > > > > > What does your connection string look
> > like?
> > > > > > > (obfuscate your login,
> > > > > > > servername, and password, of course). How
> > are
> > > > you
> > > > > > > trying to bind that
> > > > > > > control to something in the database? Are
> > you
> > > > going
> > > > > > > through an ODBC driver
> > > > > > > or Connector/Net or trying a direct
> > connection
> > > > from
> > > > > > > the control? Please
> > > > > > > provide whatever details you can.
> > > > > > >
> > > > > > > Shawn Green
> > > > > > > Database Administrator
> > > > > > > Unimin Corporation - Spruce Pine
> > > > > > >
> > > > > > > Mark Mchugh wrote on
> > > > 12/09/2004
> > > > > > > 12:06:14 PM:
> > > > > > >
> > > > > > > > hi,
> > > > > > > > I am using databinding with the above
> > named
> > > > > > > control,
> > > > > > > > but every time i make a change , i get
> > the
> >
> === message truncated ===
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Jazz up your holiday email with celebrity designs. Learn more.
> http://celebrity.mail.yahoo.com
--=_alternative 00560B1B85256F66_=--