Results 1 to 4 of 4

Thread: .addnew with ASP

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    South Africa
    Posts
    113

    .addnew with ASP

    how do I insert data to me db using .addnew and .update

    how must I define my recordset etc.
    You are living a pacifist dream, and if you dreaming it means you sleeping and you should damn well wake up!

  2. #2
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    Ooops!!
    Code:
    <%
    Dim objConn, rsRec
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath ("Database.mdb")
    Set rsRec = Server.CreateObject("ADODB.Recordset")
    rsRec.Open "Table1", objConn, 1, 3
    rsRec.AddNew
    rsRec("Field1") = Request.Form("txtBox1")
    rsRec("Field2") = Request.Form("txtBox2")
    rsRec.Update
    rsRec.Close
    objConn.Close
    Set rsRec = Nothing
    Set objConn = Nothing
    %>
    Hope this helps!!
    Last edited by davidgottlieb; Oct 8th, 2001 at 12:10 PM.
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  3. #3
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    You can also specify a DSN in the ODBC icon of the Control Panel. It sometimes is easier but sometimes slower as well.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    IT is also a real *****. I would stick with ADO.
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

Posting Permissions

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



Click Here to Expand Forum to Full Width