Update databse frx

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marin

    #1

    Update databse frx

    I have problems with updating access database from asp.net 2.0 application.
    I use this code:
    SQL = "UPDATE Tabela Set Polje1=" & CInt(Text) & " WHERE ID=" &
    CLng(Session("I D"))
    cmd = New OleDbCommand(SQ L, odbConn)
    cmd.ExecuteNonQ uery()

    No compile error, no run-time error but database is not updated!! How to
    update record in access database?


  • Alexey Smirnov

    #2
    Re: Update databse frx

    On Mar 23, 1:40 pm, "Marin" <marinov...@gma il.comwrote:
    I have problems with updating access database from asp.net 2.0 application.
    I use this code:
    SQL = "UPDATE Tabela Set Polje1=" & CInt(Text) & " WHERE ID=" &
    CLng(Session("I D"))
    cmd = New OleDbCommand(SQ L, odbConn)
    cmd.ExecuteNonQ uery()
    >
    No compile error, no run-time error but database is not updated!! How to
    update record in access database?
    It probably means that either Tabela has now records where
    ID=Session("ID" ), or Polje1=Text

    Before you do an update, try to check what the values have Text and
    Session("ID")

    Response.Write( "Text=" & Text)
    Response.Write( "ID=" & Session("ID"))

    Comment

    • Patrice

      #3
      Re: Update databse frx

      Print out the SQL statement so that you can see (or even better run it
      yourself) in the DB to see if it works as expected (especially does the
      criteria match)

      Also if a file base db, make sure you are looking into the right db (in
      vs.net you can have a copy option that always copy the file to the build
      directory but if you works on this db keep in mind that the original db is
      left unchanged).

      "Marin" <marinovica@gma il.coma écrit dans le message de news:
      eu0h0n$q3p$1@ma gcargo.vodatel. hr...
      >I have problems with updating access database from asp.net 2.0 application.
      >I use this code:
      SQL = "UPDATE Tabela Set Polje1=" & CInt(Text) & " WHERE ID=" &
      CLng(Session("I D"))
      cmd = New OleDbCommand(SQ L, odbConn)
      cmd.ExecuteNonQ uery()
      >
      No compile error, no run-time error but database is not updated!! How to
      update record in access database?
      >

      Comment

      • William \(Bill\) Vaughn

        #4
        Re: Update databse frx

        Good suggestions all and make sure that JET has time to flush his cache. It
        does not write to the database at first--just to the RAM cache. It only
        flushes when the database connection is closed or it senses idle time.

        --
        _______________ _______________ ______
        William (Bill) Vaughn
        Author, Mentor, Consultant
        Microsoft MVP
        INETA Speaker
        Welcome to the home of William Vaughn's Imagination, creations, and advice.

        Welcome to the home of William Vaughn's Imagination, creations, and advice.

        Please reply only to the newsgroup so that others can benefit.
        This posting is provided "AS IS" with no warranties, and confers no rights.
        _______________ _______________ ____
        Visit www.hitchhikerguides.net to get more information on my latest book:
        Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
        and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
        -----------------------------------------------------------------------------------------------------------------------

        "Patrice" <http://www.chez.com/scribe/wrote in message
        news:uDoUlsUbHH A.4012@TK2MSFTN GP03.phx.gbl...
        Print out the SQL statement so that you can see (or even better run it
        yourself) in the DB to see if it works as expected (especially does the
        criteria match)
        >
        Also if a file base db, make sure you are looking into the right db (in
        vs.net you can have a copy option that always copy the file to the build
        directory but if you works on this db keep in mind that the original db is
        left unchanged).
        >
        "Marin" <marinovica@gma il.coma écrit dans le message de news:
        eu0h0n$q3p$1@ma gcargo.vodatel. hr...
        >>I have problems with updating access database from asp.net 2.0
        >>application . I use this code:
        >SQL = "UPDATE Tabela Set Polje1=" & CInt(Text) & " WHERE ID=" &
        >CLng(Session(" ID"))
        >cmd = New OleDbCommand(SQ L, odbConn)
        >cmd.ExecuteNon Query()
        >>
        >No compile error, no run-time error but database is not updated!! How to
        >update record in access database?
        >>
        >
        >

        Comment

        Working...