Programmatic OleDB access destroys current Session | | |
Hello all, I am running IIS 5.1 on Windows XP professional.
I am writing a web application in C# with Visual Studio.NET.
I would like to populate various data structures in my web application
from an Access database on the local hard drive. However, the instant
my code touches the Access database, it triggers the asp process thread
to recycle the current session state (calls Session_End), and I lose
all my other data (Session state is InProc).
I can copy and paste the OleDB code to read the Access file into a
console app, and it works fine...What could be going on here?
Thanks for any help,
Dave | | | | re: Programmatic OleDB access destroys current Session
It sounds as if the project/web site/DLL has been created with a dependency
on the Access Database. This would be the case is the database file was
"included in the project at design time". If it is so, then in the Visual
Studio project, right-click the Access DB file and specify "exclude from
project".
Hope this helps.
"daver@csh.rit.edu" wrote:
[color=blue]
> Hello all, I am running IIS 5.1 on Windows XP professional.
> I am writing a web application in C# with Visual Studio.NET.
>
> I would like to populate various data structures in my web application
> from an Access database on the local hard drive. However, the instant
> my code touches the Access database, it triggers the asp process thread
> to recycle the current session state (calls Session_End), and I lose
> all my other data (Session state is InProc).
>
> I can copy and paste the OleDB code to read the Access file into a
> console app, and it works fine...What could be going on here?
>
> Thanks for any help,
>
> Dave
>
>[/color] | | | | re: Programmatic OleDB access destroys current Session
No, the access DB was not included in the project at design time. I did
have some lingering references to the file from an old databound
control, but I removed them and the problem still persists.
One other thing, I cannot open the access DB with my local copy of
Access 2000, since it was created with Access 2003. I assume my version
of MDAC (2.8) is sufficient to handle this. | | | | re: Programmatic OleDB access destroys current Session
How is named the DB and where is it located ?
It looks like some kind of file update is seen by ASP.NET (as if you were
writing web.config or something similar). My first try would be to put the
DB outisde of the web site to see if it still shows the same problem...
--
Patrice
<daver@csh.rit.edu> a écrit dans le message de
news:1119972177.596074.59910@z14g2000cwz.googlegro ups.com...[color=blue]
> Hello all, I am running IIS 5.1 on Windows XP professional.
> I am writing a web application in C# with Visual Studio.NET.
>
> I would like to populate various data structures in my web application
> from an Access database on the local hard drive. However, the instant
> my code touches the Access database, it triggers the asp process thread
> to recycle the current session state (calls Session_End), and I lose
> all my other data (Session state is InProc).
>
> I can copy and paste the OleDB code to read the Access file into a
> console app, and it works fine...What could be going on here?
>
> Thanks for any help,
>
> Dave
>[/color] | | | | re: Programmatic OleDB access destroys current Session
Ah, thank you very much, this was exactly the issue. I moved the .mdb
file out of the web application directory and everything worked
properly.
However, I thought ASP.NET only recycled the web application if the
web.config file changed, and that it didn't care if other files in the
web application changed?? Does this mean that a) ASP.NET checks EVERY
file in a web application directory tree and b) read access to an
Access MDB file also modifies it?
Patrice wrote:[color=blue]
> How is named the DB and where is it located ?
>
> It looks like some kind of file update is seen by ASP.NET (as if you were
> writing web.config or something similar). My first try would be to put the
> DB outisde of the web site to see if it still shows the same problem...
>
> --
> Patrice
>
> <daver@csh.rit.edu> a écrit dans le message de
> news:1119972177.596074.59910@z14g2000cwz.googlegro ups.com...[color=green]
> > Hello all, I am running IIS 5.1 on Windows XP professional.
> > I am writing a web application in C# with Visual Studio.NET.
> >
> > I would like to populate various data structures in my web application
> > from an Access database on the local hard drive. However, the instant
> > my code touches the Access database, it triggers the asp process thread
> > to recycle the current session state (calls Session_End), and I lose
> > all my other data (Session state is InProc).
> >
> > I can copy and paste the OleDB code to read the Access file into a
> > console app, and it works fine...What could be going on here?
> >
> > Thanks for any help,
> >
> > Dave
> >[/color][/color] | | | | re: Programmatic OleDB access destroys current Session
Doesn't look a normal behavior to me but as it was looking "as if" I thought
it would be interesting to give this a try to narrow down the problem.
I don't use MDB files but there is likely something wrong with your install.
Have you done something sepcial either witht he MDB file extension (such as
having this handled by ASP.NET to prevent downloading, or do you put your
MDB file in a file where you have ASPX pages etc...).
Anyway it"s likely better to have the DB outisde of the web site but I would
be curious to know what causes this problem...
--
Patrice
<daver@csh.rit.edu> a écrit dans le message de
news:1120058801.783084.163350@o13g2000cwo.googlegr oups.com...
Ah, thank you very much, this was exactly the issue. I moved the .mdb
file out of the web application directory and everything worked
properly.
However, I thought ASP.NET only recycled the web application if the
web.config file changed, and that it didn't care if other files in the
web application changed?? Does this mean that a) ASP.NET checks EVERY
file in a web application directory tree and b) read access to an
Access MDB file also modifies it?
Patrice wrote:[color=blue]
> How is named the DB and where is it located ?
>
> It looks like some kind of file update is seen by ASP.NET (as if you were
> writing web.config or something similar). My first try would be to put[/color]
the[color=blue]
> DB outisde of the web site to see if it still shows the same problem...
>
> --
> Patrice
>
> <daver@csh.rit.edu> a écrit dans le message de
> news:1119972177.596074.59910@z14g2000cwz.googlegro ups.com...[color=green]
> > Hello all, I am running IIS 5.1 on Windows XP professional.
> > I am writing a web application in C# with Visual Studio.NET.
> >
> > I would like to populate various data structures in my web application
> > from an Access database on the local hard drive. However, the instant
> > my code touches the Access database, it triggers the asp process thread
> > to recycle the current session state (calls Session_End), and I lose
> > all my other data (Session state is InProc).
> >
> > I can copy and paste the OleDB code to read the Access file into a
> > console app, and it works fine...What could be going on here?
> >
> > Thanks for any help,
> >
> > Dave
> >[/color][/color] | | | | re: Programmatic OleDB access destroys current Session
Reading from the MDB would not, as far as I know, cause any modification to
the MDB itself, but it would cause a modification to the LDB (record locking
information file) which the Jet database engine will create in the same
location as the MDB file. So if the MDB file is in the web app folder, the
LDB file will also be created in that folder.
--
Brendan Reynolds (Access MVP)
"Patrice" <nobody@nowhere.com> wrote in message
news:%23jpTE9UfFHA.3904@TK2MSFTNGP14.phx.gbl...[color=blue]
> Doesn't look a normal behavior to me but as it was looking "as if" I
> thought
> it would be interesting to give this a try to narrow down the problem.
>
> I don't use MDB files but there is likely something wrong with your
> install.
> Have you done something sepcial either witht he MDB file extension (such
> as
> having this handled by ASP.NET to prevent downloading, or do you put your
> MDB file in a file where you have ASPX pages etc...).
>
> Anyway it"s likely better to have the DB outisde of the web site but I
> would
> be curious to know what causes this problem...
>
> --
> Patrice
>
>
> <daver@csh.rit.edu> a écrit dans le message de
> news:1120058801.783084.163350@o13g2000cwo.googlegr oups.com...
> Ah, thank you very much, this was exactly the issue. I moved the .mdb
> file out of the web application directory and everything worked
> properly.
>
> However, I thought ASP.NET only recycled the web application if the
> web.config file changed, and that it didn't care if other files in the
> web application changed?? Does this mean that a) ASP.NET checks EVERY
> file in a web application directory tree and b) read access to an
> Access MDB file also modifies it?
>
>
>
> Patrice wrote:[color=green]
>> How is named the DB and where is it located ?
>>
>> It looks like some kind of file update is seen by ASP.NET (as if you were
>> writing web.config or something similar). My first try would be to put[/color]
> the[color=green]
>> DB outisde of the web site to see if it still shows the same problem...
>>
>> --
>> Patrice
>>
>> <daver@csh.rit.edu> a écrit dans le message de
>> news:1119972177.596074.59910@z14g2000cwz.googlegro ups.com...[color=darkred]
>> > Hello all, I am running IIS 5.1 on Windows XP professional.
>> > I am writing a web application in C# with Visual Studio.NET.
>> >
>> > I would like to populate various data structures in my web application
>> > from an Access database on the local hard drive. However, the instant
>> > my code touches the Access database, it triggers the asp process thread
>> > to recycle the current session state (calls Session_End), and I lose
>> > all my other data (Session state is InProc).
>> >
>> > I can copy and paste the OleDB code to read the Access file into a
>> > console app, and it works fine...What could be going on here?
>> >
>> > Thanks for any help,
>> >
>> > Dave
>> >[/color][/color]
>
>[/color] |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,295 network members.
|