connection.execute = asynchronous process ??

Discussion in 'ASP General' started by Jill Graham, Oct 3, 2003.

  1. Jill Graham

    Jill Graham Guest

    Hi,


    I'm using an access database and found following problem :

    I have a table X with 2 records : record 1 & record 2. I execute following
    procedure with 2 steps :
    1. The procedure deletes records 1 : connection.execute "delete from X
    record 1"
    2. The procedure adds record 1 again using the recordset object.

    Result : nothing happens !
    I have the feeling that the "delete" statement is executed AFTER the "add
    record" statement. Or the "delete" statement did not finish before the
    start of the "add record" statement (= asyncrhonous processing).

    Can somebody explain me this behavior ?
    I have this problem only when using a MS Access database and not with an MS
    SQL database.

    Jill
    Jill Graham, Oct 3, 2003
    #1
    1. Advertising

  2. Jill Graham

    Ray at Guest

    Can you show your code?

    Ray at work

    "Jill Graham" <> wrote in message
    news:ew$...
    > Hi,
    >
    >
    > I'm using an access database and found following problem :
    >
    > I have a table X with 2 records : record 1 & record 2. I execute

    following
    > procedure with 2 steps :
    > 1. The procedure deletes records 1 : connection.execute "delete from X
    > record 1"
    > 2. The procedure adds record 1 again using the recordset object.
    >
    > Result : nothing happens !
    > I have the feeling that the "delete" statement is executed AFTER the "add
    > record" statement. Or the "delete" statement did not finish before the
    > start of the "add record" statement (= asyncrhonous processing).
    >
    > Can somebody explain me this behavior ?
    > I have this problem only when using a MS Access database and not with an

    MS
    > SQL database.
    >
    > Jill
    >
    >
    Ray at, Oct 3, 2003
    #2
    1. Advertising

  3. Jill Graham

    Dan Brussee Guest

    On Fri, 3 Oct 2003 17:15:36 +0200, "Jill Graham"
    <> wrote:

    >Hi,
    >
    >
    >I'm using an access database and found following problem :
    >
    >I have a table X with 2 records : record 1 & record 2. I execute following
    >procedure with 2 steps :
    >1. The procedure deletes records 1 : connection.execute "delete from X
    >record 1"
    >2. The procedure adds record 1 again using the recordset object.
    >
    >Result : nothing happens !
    >I have the feeling that the "delete" statement is executed AFTER the "add
    >record" statement. Or the "delete" statement did not finish before the
    >start of the "add record" statement (= asyncrhonous processing).
    >
    >Can somebody explain me this behavior ?
    >I have this problem only when using a MS Access database and not with an MS
    >SQL database.
    >
    >Jill
    >


    I think your going to have to explain this a little better. You say
    you use Access, but also refer to a procedure. Is the Procedure
    something in ASP?

    Step 1: conn.execute "DELETE FROM X Where ID = 1"
    Step 2: conn.execute "INSERT INTO X (a,b,c) VALUES (1,2,3)"

    This kind of thing should work. The normal action of the connection
    object is NOT asynchronous, so I doubt that is your problem.

    When you say nothing happens, does the first record get deleted? Does
    the new record not get added?
    Dan Brussee, Oct 3, 2003
    #3
  4. Jill Graham

    Jill Graham Guest

    Hi Dan,

    Correct, this is a procedure in ASP

    Table X has two records : ID = 1 and ID = 2

    The procedure is as follows :
    Step 1: conn.execute "DELETE FROM X Where ID = 1"
    Step 2: rs.open "table X", <options>
    rs.addNew
    rs("ID") = 1
    rs.update
    rs.close

    Result of the procedure : the record is deleted (step 1) but step 2 has no effect.

    When I replace step 2 with following statement : conn.execute "INSERT INTO X (ID) VALUES (1)", then everything works fine.

    Why doesn't the recordset work ?



    "Dan Brussee" <> wrote in message news:...
    > On Fri, 3 Oct 2003 17:15:36 +0200, "Jill Graham"
    > <> wrote:
    >
    > >Hi,
    > >
    > >
    > >I'm using an access database and found following problem :
    > >
    > >I have a table X with 2 records : record 1 & record 2. I execute following
    > >procedure with 2 steps :
    > >1. The procedure deletes records 1 : connection.execute "delete from X
    > >record 1"
    > >2. The procedure adds record 1 again using the recordset object.
    > >
    > >Result : nothing happens !
    > >I have the feeling that the "delete" statement is executed AFTER the "add
    > >record" statement. Or the "delete" statement did not finish before the
    > >start of the "add record" statement (= asyncrhonous processing).
    > >
    > >Can somebody explain me this behavior ?
    > >I have this problem only when using a MS Access database and not with an MS
    > >SQL database.
    > >
    > >Jill
    > >

    >
    > I think your going to have to explain this a little better. You say
    > you use Access, but also refer to a procedure. Is the Procedure
    > something in ASP?
    >
    > Step 1: conn.execute "DELETE FROM X Where ID = 1"
    > Step 2: conn.execute "INSERT INTO X (a,b,c) VALUES (1,2,3)"
    >
    > This kind of thing should work. The normal action of the connection
    > object is NOT asynchronous, so I doubt that is your problem.
    >
    > When you say nothing happens, does the first record get deleted? Does
    > the new record not get added?
    >
    >
    Jill Graham, Oct 3, 2003
    #4
  5. Jill Graham

    Ray at Guest

    Is there an On Error Resume Next in your code? If not, what does your real
    code look like?

    Ray at work

    "Jill Graham" <> wrote in message
    news:...
    Hi Dan,
    Correct, this is a procedure in ASP
    Table X has two records : ID = 1 and ID = 2
    The procedure is as follows :
    Step 1: conn.execute "DELETE FROM X Where ID = 1"
    Step 2: rs.open "table X", <options>
    rs.addNew
    rs("ID") = 1
    rs.update
    rs.close
    Result of the procedure : the record is deleted (step 1) but step 2 has no
    effect.
    When I replace step 2 with following statement : conn.execute "INSERT INTO X
    (ID) VALUES (1)", then everything works fine.
    Why doesn't the recordset work ?
    Ray at, Oct 4, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kai
    Replies:
    4
    Views:
    4,442
    Kevin Spencer
    Feb 11, 2006
  2. kai
    Replies:
    1
    Views:
    826
    Kevin Spencer
    Feb 11, 2006
  3. Bruce Lee
    Replies:
    1
    Views:
    429
    Lee Fesperman
    May 11, 2005
  4. empriser
    Replies:
    1
    Views:
    637
    Ian Collins
    Mar 6, 2007
  5. Pito Salas
    Replies:
    11
    Views:
    239
    Robert Klemme
    Aug 26, 2009
Loading...

Share This Page