ASP automatic Insert

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nkoriginal
    New Member
    • Nov 2006
    • 23

    #16
    Originally posted by nkoriginal
    Yes I tried with Cursotype = 2 But nothing.
    I will try another way if I found something I will post a new message.

    thank you Jared
    NIKO
    Jared:

    I found the solution to my problem.
    Thank you for your help.

    Here is the complete code for insert X fields from HTML form in SQL table.


    Dim rs, data_source
    Set rs = Server.CreateOb ject("ADODB.Rec ordset")

    rs.ActiveConnec tion = MM_mm_STRING
    rs.CursorType = 2
    rs.CursorLocati on = 2
    rs.LockType = 3
    rs.source = "select * from t1"
    response.Write (rs.source)
    rs.open

    rs.addNew
    for each X in request.Form
    if ucase(X) <> "SUBMIT" AND ucase(X) <> "UNIQUEID" and left(ucase(X),4 ) <> "DROP" and ucase(X) <> "OVERRIDE" then

    Response.Write "<BR>"
    Response.Write X & " = " & Request.Form( X ) & "<BR>"
    rs(x) = request.form(x)
    end if
    next
    rs.update

    rs.close
    set rs = nothing

    If somebody has any problem with this code, please let me know

    Thank you again Jared

    NIKO

    Comment

    • jhardman
      Recognized Expert Specialist
      • Jan 2007
      • 3405

      #17
      Doh! Was the entire problem that the script was trying to update an autonumber? I should have seen that. I think I've even answered that question in the past. Anyway, I'm glad you found the sol'n.

      Jared

      Comment

      Working...