problem passing ID# to URL while record is open!

Results 1 to 3 of 3

Thread: problem passing ID# to URL while record is open!

  1. #1
    Hadi Guest

    Default problem passing ID# to URL while record is open!

    I have an ASP page that updates a database based on the information obtained from URL.<BR>Each time a record is created an ID#(automatic number) is assigned to that record. I&#039m trying to<BR>pass that ID# to the URL while I have the same record open, but seems like there is no ID# <BR>assigned until the record is closed. Is there any way to do that while having the record open?<BR>

  2. #2
    Joel M Guest

    Default info not clear

    If you&#039re running an INSERT SQL statement...then you wont have a recordset (unless you&#039re using another technique). This is the way that I would perform this action:<BR>-----------------------<BR>username = request.querystring("username")<BR>password = request.querystring("password")<BR><BR>set conn = Server.CreateObject("ADODB.Connection")<BR><BR>sql = "INSERT INTO users (username, password) VALUES (&#039"& username &"&#039,&#039"& password &"&#039)"<BR><BR>Conn.Execute(sql)<BR><BR>sql = "SELECT userID, username, password FROM users WHERE username LIKE &#039"& username &"&#039"<BR><BR>set rs = Conn.Execute(sql)<BR><BR>response.write("USER ID: "& rs("userID") &"<BR>")<BR>response.write("Username: "& rs("username") &"<BR>")<BR>response.write("Password: "& rs("password"))<BR><BR>-------------------------------<BR><BR>hope it helps<BR>Joel M

  3. #3
    Hadi Guest

    Default found the answer!

    Well, I got the answer to my question. Below is a link to it:<BR><BR>

Posting Permissions

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