Results 1 to 3 of 3

Thread: SQL-ASP session question.

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    51
    I have the following code, within the same ASP session, I can't seem to get the InvID after I add it into the SQLServer. Is there Anyway I can get the value of InvID without futher coding?

    Thanks

    Set rsContact = CreateObject("ADODB.Recordset")
    Set rsContact.ActiveConnection = objConn
    rsContact.Locktype = 2
    rsContact.AddNew
    rsContact.Update

    InvID = rsContact("InvID")

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    According to that code, you connect to the database add a new blank record and try to retrieve a value from that existing record. Are you using default's for the fields ot am I completly missing the plot.

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    51
    Lanpbaker,

    All the fields are default, except for InvID, which default to automumber in SQL DB when add new record. What I'm trying to do is to retrieve this InvID after the record is add with-in the same session to enter all the fields. I have no problem with MS-Access DB, but can't get this to wokr on SQL DB.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width