db connection

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

    db connection

    I wrote a program in c# and oledb for my access database. After each run i
    see there's a locked db file in my database folder, it means that my
    connection is not closed properly. I did check my code everything seemed
    fine. Is there a script or a program that can help me check this? I think I
    might have missed something.

    Thanks

    Aaron


  • Karl

    #2
    Re: db connection

    My guess, since you didn't show us any code, is that what you are seeing is
    connection pooling, add "OLE DB Services=-4" to the connection string to
    disable it and see if its that...'tis better to leave it on though when in
    production.

    Karl

    --
    MY ASP.Net tutorials
    Programming blog exploring Zig, Elixir, Go, Testing, Design and Performance



    "Aaron" <kuya789@yahoo. com> wrote in message
    news:O7VhVwDlEH A.3988@TK2MSFTN GP14.phx.gbl...[color=blue]
    > I wrote a program in c# and oledb for my access database. After each run i
    > see there's a locked db file in my database folder, it means that my
    > connection is not closed properly. I did check my code everything seemed
    > fine. Is there a script or a program that can help me check this? I think[/color]
    I[color=blue]
    > might have missed something.
    >
    > Thanks
    >
    > Aaron
    >
    >[/color]


    Comment

    • Greg Burns

      #3
      Re: db connection

      I am not sure that just because there is *.ldb file still in your folder
      doesn't mean Access didn't close properly.

      BTW, is this a webapp or winform?

      Greg


      "Aaron" <kuya789@yahoo. com> wrote in message
      news:O7VhVwDlEH A.3988@TK2MSFTN GP14.phx.gbl...[color=blue]
      >I wrote a program in c# and oledb for my access database. After each run i
      >see there's a locked db file in my database folder, it means that my
      >connection is not closed properly. I did check my code everything seemed
      >fine. Is there a script or a program that can help me check this? I think I
      >might have missed something.
      >
      > Thanks
      >
      > Aaron
      >[/color]


      Comment

      • Aaron

        #4
        Re: db connection

        It's a webapp. The reason I know this is because when I tried to access the
        same db from another server(B) it tells me that the db is locked but it's
        already closed on the other server(A).


        "Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
        news:eqmHJIElEH A.3340@TK2MSFTN GP14.phx.gbl...[color=blue]
        >I am not sure that just because there is *.ldb file still in your folder
        >doesn't mean Access didn't close properly.
        >
        > BTW, is this a webapp or winform?
        >
        > Greg
        >
        >
        > "Aaron" <kuya789@yahoo. com> wrote in message
        > news:O7VhVwDlEH A.3988@TK2MSFTN GP14.phx.gbl...[color=green]
        >>I wrote a program in c# and oledb for my access database. After each run i
        >>see there's a locked db file in my database folder, it means that my
        >>connection is not closed properly. I did check my code everything seemed
        >>fine. Is there a script or a program that can help me check this? I think
        >>I might have missed something.
        >>
        >> Thanks
        >>
        >> Aaron
        >>[/color]
        >
        >[/color]


        Comment

        • Greg Burns

          #5
          Re: db connection

          Since it is a webapp then there could be something else going on. Make sure
          the ASPNET user has read/write rights to the FOLDER that the Access *.mdb
          file is sitting in. It needs read/write rights to the folder in order to
          properly create (and update) the *.ldb file.

          Greg

          "Aaron" <kuya789@yahoo. com> wrote in message
          news:umQYrJFlEH A.3476@tk2msftn gp13.phx.gbl...[color=blue]
          > It's a webapp. The reason I know this is because when I tried to access
          > the same db from another server(B) it tells me that the db is locked but
          > it's already closed on the other server(A).
          >
          >
          > "Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
          > news:eqmHJIElEH A.3340@TK2MSFTN GP14.phx.gbl...[color=green]
          >>I am not sure that just because there is *.ldb file still in your folder
          >>doesn't mean Access didn't close properly.
          >>
          >> BTW, is this a webapp or winform?
          >>
          >> Greg
          >>
          >>
          >> "Aaron" <kuya789@yahoo. com> wrote in message
          >> news:O7VhVwDlEH A.3988@TK2MSFTN GP14.phx.gbl...[color=darkred]
          >>>I wrote a program in c# and oledb for my access database. After each run
          >>>i see there's a locked db file in my database folder, it means that my
          >>>connection is not closed properly. I did check my code everything seemed
          >>>fine. Is there a script or a program that can help me check this? I think
          >>>I might have missed something.
          >>>
          >>> Thanks
          >>>
          >>> Aaron
          >>>[/color]
          >>
          >>[/color]
          >
          >[/color]


          Comment

          • Aaron

            #6
            Re: db connection

            All the permission is correct. I still think there's a db connection left
            open in my code somewhere. What is the best way to locate it?

            "Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
            news:uaZUAQFlEH A.3988@TK2MSFTN GP14.phx.gbl...[color=blue]
            > Since it is a webapp then there could be something else going on. Make
            > sure the ASPNET user has read/write rights to the FOLDER that the Access
            > *.mdb file is sitting in. It needs read/write rights to the folder in
            > order to properly create (and update) the *.ldb file.
            >
            > Greg
            >
            > "Aaron" <kuya789@yahoo. com> wrote in message
            > news:umQYrJFlEH A.3476@tk2msftn gp13.phx.gbl...[color=green]
            >> It's a webapp. The reason I know this is because when I tried to access
            >> the same db from another server(B) it tells me that the db is locked but
            >> it's already closed on the other server(A).
            >>
            >>
            >> "Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
            >> news:eqmHJIElEH A.3340@TK2MSFTN GP14.phx.gbl...[color=darkred]
            >>>I am not sure that just because there is *.ldb file still in your folder
            >>>doesn't mean Access didn't close properly.
            >>>
            >>> BTW, is this a webapp or winform?
            >>>
            >>> Greg
            >>>
            >>>
            >>> "Aaron" <kuya789@yahoo. com> wrote in message
            >>> news:O7VhVwDlEH A.3988@TK2MSFTN GP14.phx.gbl...
            >>>>I wrote a program in c# and oledb for my access database. After each run
            >>>>i see there's a locked db file in my database folder, it means that my
            >>>>connectio n is not closed properly. I did check my code everything seemed
            >>>>fine. Is there a script or a program that can help me check this? I
            >>>>think I might have missed something.
            >>>>
            >>>> Thanks
            >>>>
            >>>> Aaron
            >>>>
            >>>
            >>>[/color]
            >>
            >>[/color]
            >
            >[/color]


            Comment

            • Frank Mamone

              #7
              Re: db connection

              I used to have this problem all the time when I was using Access and Cold
              Fusion. I don't know if the same solution will work for you but it's worth a
              try.

              What we used to do to unlock it is send a bad query like Select * from
              non-existent table.

              Of course, if the database is on a live server and being used then the
              unlocked state would not last long. Since Access is file-based, it locks it
              while it's in use. It's just the way it works.

              Let us know if it works,

              Frank


              "Aaron" <kuya789@yahoo. com> wrote in message
              news:O7VhVwDlEH A.3988@TK2MSFTN GP14.phx.gbl...[color=blue]
              > I wrote a program in c# and oledb for my access database. After each run i
              > see there's a locked db file in my database folder, it means that my
              > connection is not closed properly. I did check my code everything seemed
              > fine. Is there a script or a program that can help me check this? I think[/color]
              I[color=blue]
              > might have missed something.
              >
              > Thanks
              >
              > Aaron
              >
              >[/color]


              Comment

              • Cor Ligthert

                #8
                Re: db connection

                Aaron,

                Mostly when I have seen your question was the problem that was used a
                static(C#)/shared(VBNet) class for the connection, is that what you are
                doing as well?

                Cor.


                "Aaron" <kuya789@yahoo. com> schreef in bericht
                news:O7VhVwDlEH A.3988@TK2MSFTN GP14.phx.gbl...[color=blue]
                > I wrote a program in c# and oledb for my access database. After each run i
                > see there's a locked db file in my database folder, it means that my
                > connection is not closed properly. I did check my code everything seemed
                > fine. Is there a script or a program that can help me check this? I think[/color]
                I[color=blue]
                > might have missed something.
                >
                > Thanks
                >
                > Aaron
                >
                >[/color]


                Comment

                Working...