Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Do not Open Exclusively

    How can I rewrite this function to open as shared instead of exclusivly. I am getting an error of file already in use?



    function GetNextOrderID()
    dim Conn
    dim rsMaxOrder

    set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open ConString

    set rsMaxOrder = Server.CreateObject("ADODB.Recordset")
    rsMaxOrder.Open "SELECT MAX(orderID) AS LastID FROM itemsOrdered", Conn, adOpenStatic, adLockReadOnly, adCmdText

    GetNextOrderID = rsMaxOrder("LastID") + 1

    rsMaxOrder.Close
    set rsMaxOrder = Nothing

    Conn.Close
    set Conn = Nothing

    end function
    If you don't do it this year, you will be one year older when you do. "Warren Miller"

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you're using AutoNumber, you can't write it to the database, it does it for you automatically.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

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