CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Retrieve Auto-Number After Insert

Print topic Send  topic

Author Message
Chris Moore
Posted: 07/22/2003, 2:56 PM

After I add a record to my Access table, I need to return the Auto Number
field just created so I can use it in another page. How can I do that?

Thanks

Chris
Robert Rodgers
Posted: 07/22/2003, 4:07 PM

In the
Grid AfterExecuteInsert event.



Dim intIdent, rsIdent

Set rsIdent = DBConnectionName.Execute("SELECT @@IDENTITY As intIdent")
If Not rsIdent.EOF Then
NewIdent = CCGetValue(rsIdent,"intIdent")
End IF
Set rsIdent = Nothing
--
"Every absurdity has a champion to defend it"
Oliver Goldsmith
++++++++++++++++++++++++++++++

"Chris Moore" <chris@dblayout.com> wrote in message
news:Xns93C0ACAC11B8cabubba@66.180.229.147...
After I add a record to my Access table, I need to return the Auto Number
field just created so I can use it in another page. How can I do that?

Thanks

Chris

DonB
Posted: 07/22/2003, 6:40 PM

Nope, not with Access - that's a SQL Server feature, also available if you
are using MSDE.

DonB

"Robert Rodgers" <rrodgers@sylvancomputing.com> wrote in message
news:bfkg3q$533$1@news.codecharge.com...
SELECT @@IDENTITY As intIdent")


Robert Rodgers
Posted: 07/23/2003, 3:57 AM

Ron,

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=U...com%26rnum%3D48

It appears Access 2k and 2002 should allow you to use @@Identity, but I have
not tested.

rob

--
"Every absurdity has a champion to defend it"
Oliver Goldsmith
++++++++++++++++++++++++++++++

"DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
news:bfkp1j$gcj$1@news.codecharge.com...
Nope, not with Access - that's a SQL Server feature, also available if you
are using MSDE.

DonB

"Robert Rodgers" <rrodgers@sylvancomputing.com> wrote in message
news:bfkg3q$533$1@news.codecharge.com...
SELECT @@IDENTITY As intIdent")



DonB
Posted: 07/23/2003, 6:32 AM

Doing some experimentation (after wiping egg from face)...

http://www.gotodon.com/ccbth/Features/Knowledgebase.asp?find=identity

This shows how to retrieve the value in the AfterExecuteInsert event
handler. The database has to be Access2000, it has to be connected using
"Microsoft.Jet.OLEDB.4.0" and it should include some error
checking/handling. It should continue to work if you migrate to SQL Server,
too.

DonB

http://www.GoToDon.com/ccbth


"Robert Rodgers" <rrodgers@sylvancomputing.com> wrote in message
news:bflpmp$q9j$1@news.codecharge.com...
> Ron,
>
>
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=U...com%26rnum%3D48
>
> It appears Access 2k and 2002 should allow you to use @@Identity, but I
have
> not tested.
>
> rob
>
> --
> "Every absurdity has a champion to defend it"
> Oliver Goldsmith
> ++++++++++++++++++++++++++++++
>
> "DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
>news:bfkp1j$gcj$1@news.codecharge.com...
> Nope, not with Access - that's a SQL Server feature, also available if you
> are using MSDE.
>
> DonB
>
> "Robert Rodgers" <rrodgers@sylvancomputing.com> wrote in message
>news:bfkg3q$533$1@news.codecharge.com...
> SELECT @@IDENTITY As intIdent")
>
>
>
>

Robert Rodgers
Posted: 07/23/2003, 7:38 AM

That is good to know. Thanks for spending your time finding out.

I like your site and think it is a great resource. Keep up the good work.

rob

--
"Every absurdity has a champion to defend it"
Oliver Goldsmith
++++++++++++++++++++++++++++++

"DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
news:bfm2pf$6jl$1@news.codecharge.com...
Doing some experimentation (after wiping egg from face)...

http://www.gotodon.com/ccbth/Features/Knowledgebase.asp?find=identity

This shows how to retrieve the value in the AfterExecuteInsert event
handler. The database has to be Access2000, it has to be connected using
"Microsoft.Jet.OLEDB.4.0" and it should include some error
checking/handling. It should continue to work if you migrate to SQL Server,
too.

DonB

http://www.GoToDon.com/ccbth


"Robert Rodgers" <rrodgers@sylvancomputing.com> wrote in message
news:bflpmp$q9j$1@news.codecharge.com...
> Ron,
>
>
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=U...com%26rnum%3D48
>
> It appears Access 2k and 2002 should allow you to use @@Identity, but I
have
> not tested.
>
> rob
>
> --
> "Every absurdity has a champion to defend it"
> Oliver Goldsmith
> ++++++++++++++++++++++++++++++
>
> "DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
>news:bfkp1j$gcj$1@news.codecharge.com...
> Nope, not with Access - that's a SQL Server feature, also available if you
> are using MSDE.
>
> DonB
>
> "Robert Rodgers" <rrodgers@sylvancomputing.com> wrote in message
>news:bfkg3q$533$1@news.codecharge.com...
> SELECT @@IDENTITY As intIdent")
>
>
>
>


Chris Moore
Posted: 07/23/2003, 8:35 AM

Thank you Rob & Don for helping me out on this.

Chris



"Robert Rodgers" <rrodgers@sylvancomputing.com> wrote in
news:bfm6kn$bns$1@news.codecharge.com:

> That is good to know. Thanks for spending your time finding out.
>
> I like your site and think it is a great resource. Keep up the good
> work.
>
> rob
>
floydans
Posted: 07/23/2003, 9:24 AM

Anyone knows how to do this on MySql (using ASP) ?

Thanks
Daniel


"Chris Moore" <chris@dblayout.com> ha scritto nel messaggio
news:Xns93C0ACAC11B8cabubba@66.180.229.147...
> After I add a record to my Access table, I need to return the Auto Number
> field just created so I can use it in another page. How can I do that?
>
> Thanks
>
> Chris

Philou ^_^
Posted: 07/24/2003, 2:17 AM

Hi

> Anyone knows how to do this on MySql (using ASP) ?

well I know php as the mysql_insert_id() method to get the generated value
but don't know if asp as something like that ...

Bonne journée
ICQ : 44116813
AIM & IRC & YAHOO : Philou255
MSN :philou255@hotmail.com
HL : AnimeParadise.mine.nu
My software never has bugs, it just develops random features.


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.