DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    milan Guest

    INSERT INTO - form and variable in ASP page


    Hi all,
    I have this code:
    <%
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open "data"
    sql = "SELECT * FROM kong"
    Set RS = Conn.Execute(sql)
    Conn.Execute(sql)
    dim i, prod_name,
    prod_name = Request.Form ("prod_name")
    if prod_name = "ALTEA" then
    i = RS("d_al_s")
    elseif prod_name= "AMULET" then
    i = RS("d_al_w")
    end if
    %>
    where prod_name is name of form on previous ASP page and "i" is variable.
    I need put this data (prod_name, i)in database, but I don´t know how write
    this code:

    "INSERT INTO kong (prod_name, discount) VALUES ('"& Request.Form ("prod_name")
    & "','" ....... & "')"

    where ...... is place for variable "i".
    Do you understand me?
    I´m sorry, but my Englis is very bad.
    Thank for your help.
    Milan


  2. #2
    milan Guest

    Re: INSERT INTO - form and variable in ASP page


    I´m stupid - this is OK.

    "INSERT INTO kong (prod_name, discount) VALUES ('"& Request.Form ("prod_name")
    & "',' " & i &"')"



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links