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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jun 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ASP Overflow Error Help!!!

    Hi there, can someone please help me with this, I keep getting an overflow error and don't know what it means. It is in line 90 which I have highlighted. Any help would be appreciated

    <%
    FUNCTION fixQuotes( theString )
    fixQuotes = REPLACE( theString, "'", "''" )
    END FUNCTION
    DIM cost
    cust_name = TRIM( Request.Form( "cust_name" ) )
    address1 = TRIM( Request.Form( "address1" ) )
    address2 = TRIM( Request.Form( "address2" ) )
    address3 = TRIM( Request.Form( "address3" ) )
    postcode = TRIM( Request.Form( "postcode" ) )
    email = TRIM( Request.Form( "email" ) )
    c_card = TRIM( Request.Form( "c_card" ) )
    expiry = TRIM( Request.Form( "expiry" ) )
    productid = TRIM( Request.Form( "ProductID" ) )
    Dim con, location
    Set con = Server.CreateObject("ADODB.Connection")
    location = Server.MapPath("db/db.mdb")
    con.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & location
    sqlString = "INSERT into OrderForms (CustomerName, CustomerAddress1, CustomerAddress2, CustomerAddress3, CustomerPostcode, email, c_card, expiry, ProductID) values ('" &cust_name& "', '" &address1& "','" &address2& "', '" &address3& "', '"&postcode&"', '"&email&"', '"&c_card&"', '"&expiry&"', '" & productid & "')"
    Con.Execute sqlString
    %>
    <%
    con.close
    %>
    <% response.write "The form information was inserted successfully." %>

    Thanks

  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,065
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Pointing to that line says there is an error in your insert statement. Are you trying to add a record where the primary key field already has a record with that value? That will generate this error. What is the structure of the database table? Can you tell us what the datatype is for each column as well as which field(s) are primary key?

  • #3
    New to the CF scene
    Join Date
    Jun 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The table looks like this

    CustomerName - Text
    CustomerAddress1 - Text
    CustomerAddress2 - Text
    CustomerAddress3 - Text
    CustomerPostcode - Text
    email - text
    c_card - number
    expiry - text
    OrderNumber - autonumber (Primary Key)
    OrderDate - Date/Time (default value = todays date)
    Status - text (default value = pre design)
    ProductID - number

    thanks

  • #4
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,065
    Thanks
    4
    Thanked 8 Times in 8 Posts
    are any of the fields indexed Yes (No Duplicates)?
    Try adding Response.Write(sqlString) 1 line below the sql string and before Con.Execute sqlString

    This will show you if there are any errors in the SQL statement and also show the values of the variables.

    Another thing to look for is spaces or dashes in the credit card. Because this is a number field either will cause your error. You would be better off to use a TEXT field there and for security sake you really should Encrypt the credit card number in case the system is hacked.

  • #5
    New to the CF scene
    Join Date
    Jun 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks miranda, got everything workin now!

  • #6
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,065
    Thanks
    4
    Thanked 8 Times in 8 Posts
    You are welcome


  •  

    Posting Permissions

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