473,416 Members | 1,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Creating temporary database on user's PC.

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
6 2595
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

"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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bryan Meyer | last post by:
Hello Everyone: I have a PHP script that attempts to create a temporary file to be used during processing. The script is owned by my username (bryanrme) on the server. When the script attempts...
0
by: Didier ROS | last post by:
Hi, I am a newbie I want to create a temporary table and I get the following error message : mysql> CREATE TEMPORARY TABLE tempemp AS SELECT * FROM emp; ERROR 1044: Access denied for user:...
11
by: randi_clausen | last post by:
Using SQL against a DB2 table the 'with' key word is used to dynamically create a temporary table with an SQL statement that is retained for the duration of that SQL statement. What is the...
7
by: John Baker | last post by:
Hi: I would like to know how to create a temp DB to store the data in a table while I do something else with the table. Specifically, how do I create the temp remove the temp I want to be...
4
by: Coleen | last post by:
Hi All :-) Can anyone give me a URL where I can find a good example of code on how to create a temporary SQL table using VB.net? I've checked the Microsoft site at: ...
13
by: Nagib Abi Fadel | last post by:
Is it possible to create a session variable for each user in Postresql ?? Thx
7
by: Gladiator | last post by:
Hai all, I have Db2 installed in a partition environment . There are 4 partitons on which i created the instance. can any one tell me if i can create a database on the required partitons .........
3
by: Chris | last post by:
All I am cross-posting, as I'm not sure if this is an issue for the data layer or the application layer. If this is unacceptable, can someone let me know so that I don't do this in future. ...
1
by: jenson | last post by:
<?php /* * Created on Apr 13, 2007 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ require_once 'init.php'; ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.