SQL Insert statement will not insert integers into

Results 1 to 2 of 2

Thread: SQL Insert statement will not insert integers into

  1. #1
    Timothy Guest

    Default SQL Insert statement will not insert integers into

    I cannot get this SQL Statement to insert numeric values into an Access 97 table:<BR><BR>&#039 -- Build SQL Statement<BR>addSQL = "INSERT INTO Reports (Company, Address, City, State, Zip, Telephone, Fax, Email, Product, Market, Business, Personnel, Readiness, NAICS) VALUES ("&_<BR>"&#039"& Request.Form("COMPANY") + "&#039, "&_<BR>"&#039"& Request.Form("ADDRESS1") + "&#039, "&_<BR>"&#039"& Request.Form("CITY") + "&#039, "&_<BR>"&#039"& Request.Form("STATE") + "&#039, "&_<BR>"&#039"& Request.Form("ZIP") + "&#039, "&_<BR>"&#039"& Request.Form("TELEPHONE") + "&#039, "&_<BR>"&#039"& Request.Form("FAX") + "&#039, "&_<BR>"&#039"& Request.Form("EMAIL") + "&#039, "&_<BR>& product & ", " _<BR>& market & ", " _<BR>& business & ", " _<BR>& personnel & ", " _<BR>& readiness & ", " _<BR>"&#039"& Request.Form("NAICS") + "&#039)"<BR><BR>When I print the integer variables product, market, etc. later in the script, they work fine. Each variable has been created using CInt(). The value is a number submitted by an HTML form.<BR><BR>There are no ADO errors such as type mismatch or syntax.<BR><BR>The access table shows all of the text variables such as, Name, Address, Telephone, etc.<BR><BR>The access table is blank for all the numeric variables. Setting the default values for the fields to "0" results in "0" each time the form is submitted.<BR><BR>

  2. #2
    Leungas Guest

    Default RE: SQL Insert statement will not insert integers

    Make sure in your SQL statement not to have &#039 when you insert Integer, SQL will think it is a string.

Posting Permissions

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