Results 1 to 5 of 5

Thread: *RESOLVED* Getting ID from SQL server

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Posts
    90

    *RESOLVED* Getting ID from SQL server

    Hi All,

    I'm trying to do some CGI and register people by issuing them a booking number (autonumber ID).

    When I run the code locally it's fine.

    When I rn it on a different PC , the one that actually holds the DB

    It tells me : Identity cannot be determined for newly inserted rows.

    My code is as following....


    gb.Open "Provider=sqloledb;Data Source=" & servername & ";Initial Catalog=" & DatabaseName & ";User id=" & username & ";Password=" & password
    visitor.Open "select * from demographics where id<=1", gb, adOpenKeyset, adLockOptimistic

    With visitor
    .AddNew
    !Title = tle
    !GivenName = giv
    !Surname = sur
    !Position = pos
    !Organisation = org
    !Address1 = add1
    !Address2 = add2
    !Address3 = add3
    !Suburb = UCase(srb)
    !State = UCase(ste)
    !Pcode = UCase(pcde)
    !Country = UCase(cty)
    !Phone = ph
    !Fax = fx
    !Mobile = mb
    !Email = eml
    .Update

    BID = !ID
    !Comment = Cmt & !ID
    .Update

    End With

    visitor.Close
    gb.Close

    Please help, as this is the only thing stopping me from launching my app.

    Regards

    Chris
    Last edited by cboffsite; Nov 4th, 2002 at 03:36 AM.

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