Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Creating temporary database on user's PC.

Reply
Thread Tools

Creating temporary database on user's PC.

 
 
Jerry Spence1
Guest
Posts: n/a
 
      12-28-2004
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


 
Reply With Quote
 
 
 
 
Dimitri Glazkov
Guest
Posts: n/a
 
      12-28-2004
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?

G<

"Jerry Spence1" <(E-Mail Removed)> wrote in message
news:41d160f2$0$14591$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Jerry Spence1
Guest
Posts: n/a
 
      12-28-2004

"Dimitri Glazkov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
Dimitri Glazkov
Guest
Posts: n/a
 
      12-28-2004
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.

G<


"Jerry Spence1" <(E-Mail Removed)> wrote in message
news:41d17b42$0$74239$(E-Mail Removed)...
>
> "Dimitri Glazkov" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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
>
>
>



 
Reply With Quote
 
Jerry Spence1
Guest
Posts: n/a
 
      12-28-2004
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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.
>
> G<
>
>
> "Jerry Spence1" <(E-Mail Removed)> wrote in message
> news:41d17b42$0$74239$(E-Mail Removed)...
>>
>> "Dimitri Glazkov" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> 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
>>
>>
>>

>
>



 
Reply With Quote
 
Dimitri Glazkov
Guest
Posts: n/a
 
      12-28-2004
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.

G<

"Jerry Spence1" <(E-Mail Removed)> wrote in message
news:41d18968$0$73821$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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.
>>
>> G<
>>
>>
>> "Jerry Spence1" <(E-Mail Removed)> wrote in message
>> news:41d17b42$0$74239$(E-Mail Removed)...
>>>
>>> "Dimitri Glazkov" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> 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
>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Jerry Spence1
Guest
Posts: n/a
 
      12-28-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
> G<
>
> "Jerry Spence1" <(E-Mail Removed)> wrote in message
> news:41d18968$0$73821$(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> 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.
>>>
>>> G<
>>>
>>>
>>> "Jerry Spence1" <(E-Mail Removed)> wrote in message
>>> news:41d17b42$0$74239$(E-Mail Removed)...
>>>>
>>>> "Dimitri Glazkov" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> 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
>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
anonymous array of strings // ("taking address of temporary"- how long is temporary valid?) anon.asdf@gmail.com C++ 7 02-12-2008 10:58 AM
Style (or otherwise?) question: creating temporary to invoke function Denis Remezov C++ 23 04-17-2004 10:46 AM
creating a temporary file in clustered web farm sudha ASP .Net 1 07-08-2003 12:00 AM



Advertisments