best way of using INESRT statement ??

Discussion in 'ASP General' started by David, Jan 5, 2004.

  1. David

    David Guest

    Hi,

    I have a form which submits fields to add a new record to my table.

    I have the following code:

    __________________________________

    vUser = request.form("user") 'PK in table (not autonumber)
    vPass = request.form("pass")
    vEmail = request.form("email")

    uSQL = "INSERT into OrderStatusAccess (UserID, Password, Email,
    CustomerID) values ('" & vUser & "', '" & vPass & "', '" & vEmail &
    "', '" & session("customer") & "');"

    adoDataConn.Execute (uSQL)

    ______________________________________

    The problem:

    This code just inserts a blank record at the top of my table, so that
    when I go to view all the records listed for that table, nothing
    shows, because the first record is blank.

    UserID is the PK for the table OrderStatusAccess.

    Any ideas ?

    David
    David, Jan 5, 2004
    #1
    1. Advertising

  2. "David" wrote:
    >
    > uSQL = "INSERT into OrderStatusAccess (UserID, Password,
    > Email, CustomerID) values ('" & vUser & "', '" & vPass &
    > "', '" & vEmail & "', '" & session("customer") & "');"
    >
    > The problem:
    >
    > This code just inserts a blank record at the top of my
    > table, so that when I go to view all the records listed
    > for that table, nothing shows, because the first record
    > is blank.


    What results from this?

    Response.Write(uSQL)


    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
    Dave Anderson, Jan 5, 2004
    #2
    1. Advertising

  3. David

    David Gordon Guest

    Thanks Dave,

    I fixed my code by reading what was printed....my fault.


    David


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    David Gordon, Jan 5, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Diego Martins
    Replies:
    5
    Views:
    5,268
    Diego Martins
    Jun 19, 2007
  2. Phillip B Oldham
    Replies:
    2
    Views:
    243
    Bruno Desthuilliers
    Jun 16, 2008
  3. bwgoudey
    Replies:
    5
    Views:
    301
    Paul McGuire
    Apr 4, 2009
  4. Joy Beeson

    Best "Best when viewed" statement

    Joy Beeson, Mar 23, 2011, in forum: HTML
    Replies:
    5
    Views:
    498
    Tim Streater
    Mar 25, 2011
  5. oldyork90
    Replies:
    1
    Views:
    154
    Jeremy J Starcher
    Sep 10, 2008
Loading...

Share This Page