TableA of field: ProductKeyID (an Autonumber, PrimaryKey), ProductName.
TableB: ProductKeyID (only existing KeyID in TableA is allowed), ProductManager, etc
I am asked to created an aspx file with input ProductName and ProductManager to insert into both TableA and TableB
My problem is, when I insert ProductName into TableA I have no problem but upon insert into TableB,
I have to know the ProductKeyID but I do not know how to find it. And I tried to select from TableA after insert into TableA but it is
not so fast to be available for me to insert into TableB.
What can I do ?
Thanks
Thanks. I will try to credit the ones who helped but most important is we really do sincerely thanks to all who have helped.
hkbeer
Member
707 Points
1447 Posts
How can my aspx page update 2 tables in mdb which has ID that is linked
Dec 30, 2012 10:22 AM|LINK
I am given a mdb file with
TableA of field: ProductKeyID (an Autonumber, PrimaryKey), ProductName.
TableB: ProductKeyID (only existing KeyID in TableA is allowed), ProductManager, etc
I am asked to created an aspx file with input ProductName and ProductManager to insert into both TableA and TableB
My problem is, when I insert ProductName into TableA I have no problem but upon insert into TableB,
I have to know the ProductKeyID but I do not know how to find it. And I tried to select from TableA after insert into TableA but it is
not so fast to be available for me to insert into TableB.
What can I do ?
Thanks
www.developerfusion.com/tools/convert/csharp-to-vb/
adeelehsan
All-Star
18223 Points
2725 Posts
Re: How can my aspx page update 2 tables in mdb which has ID that is linked
Dec 30, 2012 11:06 AM|LINK
See the following links:
http://stackoverflow.com/questions/8258102/get-autonumber-value-from-database
http://msdn.microsoft.com/en-us/library/ks9f57t0%28v=VS.80%29.aspx
See the following section in it:
Retrieving Microsoft Access Autonumber Values
MCPD ASP.NET 4.0 and 3.5, MCTS WSS, MOSS, SharePoint 2010, MCT
Microsoft Community Contributor Award 2011
hans_v
All-Star
35986 Points
6550 Posts
Re: How can my aspx page update 2 tables in mdb which has ID that is linked
Dec 30, 2012 06:51 PM|LINK
I don't see how this would help?
I don't think this is the best method
Read this:
http://www.mikesdotnetting.com/Article/54/Getting-the-identity-of-the-most-recently-added-record