recordset

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • poopsy
    New Member
    • Nov 2006
    • 50

    recordset

    hi.. i wud like to know how to open the recordset if i hav no select statement in my codes, i have only an insert and an update query
    do i have to put
    oRs.open con (con is the variable for the connection)
    or
    oRs.open con, sInsert, and sUpdate (sInsert and Supdate are my queries)

    thx
  • CroCrew
    Recognized Expert Contributor
    • Jan 2008
    • 564

    #2
    Hello poopsy,

    I believe only in Access and FoxPro do you have to first select a recode before you can update that record or add a new one. Other databases like Microsoft SQL server you don’t have too.

    So all you really need to do is this:
    [code=asp]
    <%
    Set Conn = Server.CreateOb ject("ADODB.Con nection")
    Conn.Open Application("My ConnectionStrin g")

    Conn.Execute("I NSERT INTO MyTable (FirstName, LastName) VALUES ('Billy', 'Smith')")
    Conn.Execute("U PDATE MyTable SET FirstName = 'Bob' WHERE LastName = 'Smith'")
    %>
    [/code]

    Hope that helps~

    Comment

    Working...