Creating temporary database on user's PC.

Discussion in 'ASP .Net' started by Jerry Spence1, Dec 28, 2004.

  1. 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
     
    Jerry Spence1, Dec 28, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:41d160f2$0$14591$...
    > 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
    >
    >
     
    Dimitri Glazkov, Dec 28, 2004
    #2
    1. Advertising

  3. "Dimitri Glazkov" <> wrote in message
    news:...
    > 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
     
    Jerry Spence1, Dec 28, 2004
    #3
  4. 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" <> wrote in message
    news:41d17b42$0$74239$...
    >
    > "Dimitri Glazkov" <> wrote in message
    > news:...
    >> 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
    >
    >
    >
     
    Dimitri Glazkov, Dec 28, 2004
    #4
  5. 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" <> wrote in message
    news:%...
    > 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" <> wrote in message
    > news:41d17b42$0$74239$...
    >>
    >> "Dimitri Glazkov" <> wrote in message
    >> news:...
    >>> 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
    >>
    >>
    >>

    >
    >
     
    Jerry Spence1, Dec 28, 2004
    #5
  6. 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" <> wrote in message
    news:41d18968$0$73821$...
    > 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" <> wrote in message
    > news:%...
    >> 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" <> wrote in message
    >> news:41d17b42$0$74239$...
    >>>
    >>> "Dimitri Glazkov" <> wrote in message
    >>> news:...
    >>>> 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
    >>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Dimitri Glazkov, Dec 28, 2004
    #6
  7. 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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:41d18968$0$73821$...
    >> 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" <> wrote in message
    >> news:%...
    >>> 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" <> wrote in message
    >>> news:41d17b42$0$74239$...
    >>>>
    >>>> "Dimitri Glazkov" <> wrote in message
    >>>> news:...
    >>>>> 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
    >>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Jerry Spence1, Dec 28, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sudha
    Replies:
    1
    Views:
    315
  2. Denis Remezov
    Replies:
    23
    Views:
    675
    Benoit Mathieu
    Apr 17, 2004
  3. Jess
    Replies:
    10
    Views:
    510
    James Kanze
    May 18, 2007
  4. Replies:
    3
    Views:
    577
    Bo Persson
    Aug 15, 2007
  5. Replies:
    7
    Views:
    3,261
    James Kanze
    Feb 12, 2008
Loading...

Share This Page