By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,709 Members | 2,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,709 IT Pros & Developers. It's quick & easy.

Creating temporary database on user's PC.

P: n/a
Why doesn't the following work in my ASP program? I have imported ADOX

I am trying to create a temporary database on the user's PC. The example is
taken from Microsoft.

Dim cat As Catalog = New Catalog

cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=C:\NewMDB.mdb;" & _

"Jet OLEDB:Engine Type=5")

It comes up with the error

"The Microsoft Jet database engine cannot open the file 'C:\NewMDB.mdb'. It
is already opened exclusively by another user, or you need permission to
view its data."

This is all on my PC
Nov 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Could you explain the architecture of your program a little better? Why are
you creating this database? What will it be used for? By whom?

:DG<

"Jerry Spence1" <je**********@somewhere.com> wrote in message
news:41***********************@ptn-nntp-reader01.plus.net...
Why doesn't the following work in my ASP program? I have imported ADOX

I am trying to create a temporary database on the user's PC. The example
is taken from Microsoft.

Dim cat As Catalog = New Catalog

cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=C:\NewMDB.mdb;" & _

"Jet OLEDB:Engine Type=5")

It comes up with the error

"The Microsoft Jet database engine cannot open the file 'C:\NewMDB.mdb'.
It is already opened exclusively by another user, or you need permission
to view its data."

This is all on my PC

Nov 19 '05 #2

P: n/a

"Dimitri Glazkov" <di*************@gmail.com> wrote in message
news:OJ**************@TK2MSFTNGP14.phx.gbl...
Could you explain the architecture of your program a little better? Why
are you creating this database? What will it be used for? By whom?


Thanks Dimitri

My company produces its own IP Based security solution for surveillance and
access control (Software and hardware). What I am trying to do is to create
an interactive web site that will allow a prospective customer to select the
card readers he needs (RFID, Card swipe etc), select the camera models
(Infrared, Internal, Dome etc) and this will give him a list of parts with
prices (including Power over Ethernet, Video over Ethernet components, video
server etc). I was thinking of creating, on the fly, a database on his PC
for temporarily storing his selected information (a bit like a relational
'basket' so that when he presses a button, he will get a complete list of
parts, with quanities and total price for the whole project.

I am sure there are probably other ways (and better) for doing this but I
have no experience of Internet programming and don't know how it all
normally fits together. I am an experienced VB.Net programmer though.

I can't work out why I can't seem to create the database on the local PC
drive and why I am getting that strange error message.

Thanks

-Jerry

Nov 19 '05 #3

P: n/a
Jerry,

You will not (and should not) be able to create a database on user's
computer. This goes against all principles of secure computing -- imagine
what would happen if other Web sites were be able to create files on your
hard drive at will.

There is a fundamental architectural difference in the way you approach Web
programming vs. Desktop. On the Web, the browser is a stateless serialized
view of the application.You can use things like cookies to simulate state,
but basically, the rule of thumb is that you store actual user data on the
server and only leave the identifying cookie with the user. When the user
logs in, your server reads the cookie and is able of retrieving user data
that corresponds with that cookie.

To implement authentication/authorization, I recommend looking into ASP.NET
Forms or Windows authentication.

From there, you can develop a database, where user data is stored using user
Id as a key.

It's not a simple task, and I would highly recommend studying ASP.NET
architecture patterns before doing anything.

This is where MSDN library becomes your best friend.

:DG<
"Jerry Spence1" <je**********@somewhere.com> wrote in message
news:41***********************@ptn-nntp-reader03.plus.net...

"Dimitri Glazkov" <di*************@gmail.com> wrote in message
news:OJ**************@TK2MSFTNGP14.phx.gbl...
Could you explain the architecture of your program a little better? Why
are you creating this database? What will it be used for? By whom?


Thanks Dimitri

My company produces its own IP Based security solution for surveillance
and access control (Software and hardware). What I am trying to do is to
create an interactive web site that will allow a prospective customer to
select the card readers he needs (RFID, Card swipe etc), select the camera
models (Infrared, Internal, Dome etc) and this will give him a list of
parts with prices (including Power over Ethernet, Video over Ethernet
components, video server etc). I was thinking of creating, on the fly, a
database on his PC for temporarily storing his selected information (a bit
like a relational 'basket' so that when he presses a button, he will get a
complete list of parts, with quanities and total price for the whole
project.

I am sure there are probably other ways (and better) for doing this but I
have no experience of Internet programming and don't know how it all
normally fits together. I am an experienced VB.Net programmer though.

I can't work out why I can't seem to create the database on the local PC
drive and why I am getting that strange error message.

Thanks

-Jerry

Nov 19 '05 #4

P: n/a
Hi Dimitri

Many thanks for that excellent explanation. So I will create the database on
the server.

I'm a bit puzzled how it knows where to create it. The default location of
my project is

C:\Inetpub\wwwroot\WebApplication1\

and when I run it, it loads with
http://localhost/WebApplication1/WebForm1.aspx in the explorer bar. But when
it runs in real life for others it will be
http://myexternalIPaddress/Something

so what is the syntax for the connection string? clearly it can't be this:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=//localhost/NewMDB.mdb;Jet
OLEDB:Engine Type=5"

Thanks

-Jerry


"Dimitri Glazkov" <di*************@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Jerry,

You will not (and should not) be able to create a database on user's
computer. This goes against all principles of secure computing -- imagine
what would happen if other Web sites were be able to create files on your
hard drive at will.

There is a fundamental architectural difference in the way you approach
Web programming vs. Desktop. On the Web, the browser is a stateless
serialized view of the application.You can use things like cookies to
simulate state, but basically, the rule of thumb is that you store actual
user data on the server and only leave the identifying cookie with the
user. When the user logs in, your server reads the cookie and is able of
retrieving user data that corresponds with that cookie.

To implement authentication/authorization, I recommend looking into
ASP.NET Forms or Windows authentication.

From there, you can develop a database, where user data is stored using
user Id as a key.

It's not a simple task, and I would highly recommend studying ASP.NET
architecture patterns before doing anything.

This is where MSDN library becomes your best friend.

:DG<
"Jerry Spence1" <je**********@somewhere.com> wrote in message
news:41***********************@ptn-nntp-reader03.plus.net...

"Dimitri Glazkov" <di*************@gmail.com> wrote in message
news:OJ**************@TK2MSFTNGP14.phx.gbl...
Could you explain the architecture of your program a little better? Why
are you creating this database? What will it be used for? By whom?


Thanks Dimitri

My company produces its own IP Based security solution for surveillance
and access control (Software and hardware). What I am trying to do is to
create an interactive web site that will allow a prospective customer to
select the card readers he needs (RFID, Card swipe etc), select the
camera models (Infrared, Internal, Dome etc) and this will give him a
list of parts with prices (including Power over Ethernet, Video over
Ethernet components, video server etc). I was thinking of creating, on
the fly, a database on his PC for temporarily storing his selected
information (a bit like a relational 'basket' so that when he presses a
button, he will get a complete list of parts, with quanities and total
price for the whole project.

I am sure there are probably other ways (and better) for doing this but I
have no experience of Internet programming and don't know how it all
normally fits together. I am an experienced VB.Net programmer though.

I can't work out why I can't seem to create the database on the local PC
drive and why I am getting that strange error message.

Thanks

-Jerry


Nov 19 '05 #5

P: n/a
Jerry,

In the example below, the location should be:
C:\Intetpub\wwwroot\WebApplication1\NewMDB.mdb

However, it really does not matter where you create the database, as long as
the ASP.NET process has read/write permissions to the directory in which the
database is placed. If you run your application with impersonation disabled,
the ASP.NET process will access this database using aspnet account.
Otherwise, it will attempt to use the account with which the user logged in.

One of things to consider is the fact that now you are in fact writing a
multithreaded, concurrent-access application. More than one user at a time
may be accessing your Web site and thus more than one access/modification of
your database may occur simultaneously. MS Access may not be your best
solution, as it was not designed to handle enterprise-strength concurrent
operations. Look into using MS SQL server or at least MSDE engine.

:DG<

"Jerry Spence1" <je**********@somewhere.com> wrote in message
news:41***********************@ptn-nntp-reader03.plus.net...
Hi Dimitri

Many thanks for that excellent explanation. So I will create the database
on the server.

I'm a bit puzzled how it knows where to create it. The default location of
my project is

C:\Inetpub\wwwroot\WebApplication1\

and when I run it, it loads with
http://localhost/WebApplication1/WebForm1.aspx in the explorer bar. But
when it runs in real life for others it will be
http://myexternalIPaddress/Something

so what is the syntax for the connection string? clearly it can't be this:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=//localhost/NewMDB.mdb;Jet
OLEDB:Engine Type=5"

Thanks

-Jerry


"Dimitri Glazkov" <di*************@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Jerry,

You will not (and should not) be able to create a database on user's
computer. This goes against all principles of secure computing -- imagine
what would happen if other Web sites were be able to create files on your
hard drive at will.

There is a fundamental architectural difference in the way you approach
Web programming vs. Desktop. On the Web, the browser is a stateless
serialized view of the application.You can use things like cookies to
simulate state, but basically, the rule of thumb is that you store actual
user data on the server and only leave the identifying cookie with the
user. When the user logs in, your server reads the cookie and is able of
retrieving user data that corresponds with that cookie.

To implement authentication/authorization, I recommend looking into
ASP.NET Forms or Windows authentication.

From there, you can develop a database, where user data is stored using
user Id as a key.

It's not a simple task, and I would highly recommend studying ASP.NET
architecture patterns before doing anything.

This is where MSDN library becomes your best friend.

:DG<
"Jerry Spence1" <je**********@somewhere.com> wrote in message
news:41***********************@ptn-nntp-reader03.plus.net...

"Dimitri Glazkov" <di*************@gmail.com> wrote in message
news:OJ**************@TK2MSFTNGP14.phx.gbl...
Could you explain the architecture of your program a little better? Why
are you creating this database? What will it be used for? By whom?
Thanks Dimitri

My company produces its own IP Based security solution for surveillance
and access control (Software and hardware). What I am trying to do is to
create an interactive web site that will allow a prospective customer to
select the card readers he needs (RFID, Card swipe etc), select the
camera models (Infrared, Internal, Dome etc) and this will give him a
list of parts with prices (including Power over Ethernet, Video over
Ethernet components, video server etc). I was thinking of creating, on
the fly, a database on his PC for temporarily storing his selected
information (a bit like a relational 'basket' so that when he presses a
button, he will get a complete list of parts, with quanities and total
price for the whole project.

I am sure there are probably other ways (and better) for doing this but
I have no experience of Internet programming and don't know how it all
normally fits together. I am an experienced VB.Net programmer though.

I can't work out why I can't seem to create the database on the local PC
drive and why I am getting that strange error message.

Thanks

-Jerry



Nov 19 '05 #6

P: n/a
Thanks. I was thinking of using a separate database per user. In anycase the
volume will be very low due to the specialised subject (I wish it were't!)

I tried the path you suggested and yes it worked! Thanks a lot.

-Jerry



"Dimitri Glazkov" <di*************@gmail.com> wrote in message
news:ee**************@TK2MSFTNGP15.phx.gbl...
Jerry,

In the example below, the location should be:
C:\Intetpub\wwwroot\WebApplication1\NewMDB.mdb

However, it really does not matter where you create the database, as long
as the ASP.NET process has read/write permissions to the directory in
which the database is placed. If you run your application with
impersonation disabled, the ASP.NET process will access this database
using aspnet account. Otherwise, it will attempt to use the account with
which the user logged in.

One of things to consider is the fact that now you are in fact writing a
multithreaded, concurrent-access application. More than one user at a time
may be accessing your Web site and thus more than one access/modification
of your database may occur simultaneously. MS Access may not be your best
solution, as it was not designed to handle enterprise-strength concurrent
operations. Look into using MS SQL server or at least MSDE engine.

:DG<

"Jerry Spence1" <je**********@somewhere.com> wrote in message
news:41***********************@ptn-nntp-reader03.plus.net...
Hi Dimitri

Many thanks for that excellent explanation. So I will create the database
on the server.

I'm a bit puzzled how it knows where to create it. The default location
of my project is

C:\Inetpub\wwwroot\WebApplication1\

and when I run it, it loads with
http://localhost/WebApplication1/WebForm1.aspx in the explorer bar. But
when it runs in real life for others it will be
http://myexternalIPaddress/Something

so what is the syntax for the connection string? clearly it can't be
this:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=//localhost/NewMDB.mdb;Jet
OLEDB:Engine Type=5"

Thanks

-Jerry


"Dimitri Glazkov" <di*************@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Jerry,

You will not (and should not) be able to create a database on user's
computer. This goes against all principles of secure computing --
imagine what would happen if other Web sites were be able to create
files on your hard drive at will.

There is a fundamental architectural difference in the way you approach
Web programming vs. Desktop. On the Web, the browser is a stateless
serialized view of the application.You can use things like cookies to
simulate state, but basically, the rule of thumb is that you store
actual user data on the server and only leave the identifying cookie
with the user. When the user logs in, your server reads the cookie and
is able of retrieving user data that corresponds with that cookie.

To implement authentication/authorization, I recommend looking into
ASP.NET Forms or Windows authentication.

From there, you can develop a database, where user data is stored using
user Id as a key.

It's not a simple task, and I would highly recommend studying ASP.NET
architecture patterns before doing anything.

This is where MSDN library becomes your best friend.

:DG<
"Jerry Spence1" <je**********@somewhere.com> wrote in message
news:41***********************@ptn-nntp-reader03.plus.net...

"Dimitri Glazkov" <di*************@gmail.com> wrote in message
news:OJ**************@TK2MSFTNGP14.phx.gbl...
> Could you explain the architecture of your program a little better?
> Why are you creating this database? What will it be used for? By whom?
>

Thanks Dimitri

My company produces its own IP Based security solution for surveillance
and access control (Software and hardware). What I am trying to do is
to create an interactive web site that will allow a prospective
customer to select the card readers he needs (RFID, Card swipe etc),
select the camera models (Infrared, Internal, Dome etc) and this will
give him a list of parts with prices (including Power over Ethernet,
Video over Ethernet components, video server etc). I was thinking of
creating, on the fly, a database on his PC for temporarily storing his
selected information (a bit like a relational 'basket' so that when he
presses a button, he will get a complete list of parts, with quanities
and total price for the whole project.

I am sure there are probably other ways (and better) for doing this but
I have no experience of Internet programming and don't know how it all
normally fits together. I am an experienced VB.Net programmer though.

I can't work out why I can't seem to create the database on the local
PC drive and why I am getting that strange error message.

Thanks

-Jerry




Nov 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.