How to get a field value after and AddNew command SQL 7.0 and VB 6 
Author Message
 How to get a field value after and AddNew command SQL 7.0 and VB 6

I would like to get the value from the "id" field (SQL 7 generated "identity") once the new record is added, but the message box show it blank.

SQL = "Select * from contact "
DE.rsSQLAccountPopUpContact.Open SQL, DE.SalesPro
DE.rsSQLAccountPopUpContact.AddNew
DE.rsSQLAccountPopUpContact!address = "321 Address"
DE.rsSQLAccountPopUpContact.Update

mContactId = DE.rsSQLAccountPopUpContact!id

But the mContactId shows blank, I know that SQL 7 created the unique Id, but I can't figure out why I cannot get the value?

Any Ideas

_________________________________
God Bless
Marco Napoli
Little Helpers of Our Loving Mother
Official Web Site for Nancy Fowler (visionary) in Conyers, GA USA
http://www.*-*-*.com/



Fri, 09 Aug 2002 03:00:00 GMT  
 How to get a field value after and AddNew command SQL 7.0 and VB 6
Have you tried Refresh?
Or MoveNext then MovePrevious to come back to the same record?

--
Posted via CNET Help.com
http://www.help.com/



Fri, 09 Aug 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ADO AddNew command with VB 6.0 and SQL 7.0

2. Getting the counter value after an addnew-SQL SERVER 2000/ADO

3. How to ADO AddNew command with VB 6 and SQL 7

4. Getting the value of an autoincrement or identity field during an sql insert

5. Getting back an identity field value after an insert SQL statement

6. Getting the value of an autoincrement or identity field during an sql insert

7. ADO 2.0, SQL Server 7.0, ServerSide cursors, IDENTITY columns after rs.AddNew

8. Access counter field value during AddNew

9. How do I gett the value of autoincrement field after an .AddNew/.Update

10. Getting a return value from a SQL Server stored procedure through VB

11. AddNew/Update command & field searches

12. Access counter field value during AddNew

 

 
Powered by phpBB® Forum Software