Results 1 to 12 of 12
  1. #1
    Join Date
    Mar 2008
    Posts
    19

    Question Unanswered: data access page cannot open database

    My DAP is working on our local file share, but when I move it and the database to our web server (windows server 2003), I get an error that says " ...cannot find database K:\ws\eps\inci.mdb" upon opening the DAP. Both the page and the mdb file are in the same folder, K:\ws\eps\current.htm and K:\ws\eps\inci.mdb.

    If I change the name of the database in the connection string to something non-existent, I get the same error, so it seems like it does not see it at all.

    An added twist -- it did work when I tested it three weeks ago. I have set all permissions to full and shared the folder to anonomous users and stripped the DAP down to bare bones simple table display.

    The administrators say nothing has been changed on the server, so I must be missing some little thing that I am doing differently.

    Any ideas would be greatly appreciated. Thank you in advance, Nina.
    Last edited by n!na; 03-03-08 at 07:06.

  2. #2
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    re

    Hope you know that K: isn't the real name of the network folder
    sertenly not via internet
    Greetz Marvels -^.^-
    Developments : VB4 Through .Net; Basic; DOS ; CNC ; Sinclair
    Databases : SQL Server Through 2005; Access 3 Through 2003 ; Oracle 8 & 9.i ;
    OS : Win 3.11 Through XP ; NortonComander ; DOS

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    what marvels is saying is that K: is a local drive specification. it isn't the 'correct' way to specify a location of the file..

    The ideal way of doing that is to user a URL or UNC

    UNC is usually //servername/path/to/file.extension

    your network trolls should be able to tell you which server and what share the file is located on. It may be that it will be //servername/file.extension.

    If you want to persist in using the K: drive specification, and you shouldn't.. make sure the server is set up to recognise drive K: as the correct location.

    Another wrinkle is that sometimes Access looses the connection between the front end and the server.. so you may need to check the data connection is valid by code, and attempt to repair it, by code, if not

  4. #4
    Join Date
    Mar 2008
    Posts
    19

    Red face Thank you!!!

    Thank you so much for the guidance. Still trying to wrestle the absolute UNC path out of the admin guys, hopefully will get it today and let you know how it goes. I got the server name, but it is unclear what the first folder under that is. Here is what it looks like:
    if you were to look for my file starting at K:, the path is K:\allwebstuff\mywebstuff\myDAP.htm (and also my.mdb in that same folder).

    Going in from the outside it looks like
    http:\\www.mycompany.com\ mywebstuff\myDAP.htm
    (note no allwebstuff folder needed in the path.)

    Given that, I tried,
    \\servername\mywebstuff\my.mdb and
    \\servername\allwebstuff\mywebstuff\my.mdb
    neither of which worked.

    Thank you again, Nina

    ps - I know K: only has meaning internally and only on a particular PC, however I tried it out of desperation, thinking maybe since the referencing DAP was originating in the same folder as the mdb ... but I get how it doesn't make sense and was shocked when it worked, but here I am a few weeks later and it doesn't work so...

  5. #5
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    re

    Given that, your html "myDAP.htm" is in folder \\servername\mywebstuff
    and you want to call to db in folder \mywebstuff\my.mdb

    why not try : "~\my.mdb"
    Last edited by Marvels; 03-05-08 at 05:12.
    Greetz Marvels -^.^-
    Developments : VB4 Through .Net; Basic; DOS ; CNC ; Sinclair
    Databases : SQL Server Through 2005; Access 3 Through 2003 ; Oracle 8 & 9.i ;
    OS : Win 3.11 Through XP ; NortonComander ; DOS

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    lets take a step back.....
    your webserver can find the DAP application, but the DAP application cannot find the data:"K:\ws\eps\inci.mdb" so the problem is that the application cannot find the specified data source

    so
    its one of...
    ...the DAP needs to be told where to find the data on the relevant absolute drive path. and K: isn't going to do that unless you are very very lucky
    ...the specified data source isn't on a drive visible to the webserver.. thats could be because the webserver doesn't know that drive
    ...it could be because the webserver doesn't have appropriate permissions.
    the quick and easy way to test that could be to move the app to the same location as the DAP and see if it finds it there.


    bear in mind you may need to write some code to make sure the DAP links to the correct data source.. see the code bank for details

  7. #7
    Join Date
    Mar 2008
    Posts
    19
    Thank you again for your help.
    I did finally get the absolute path as \\servername\myFolder\inci.mdb, unfortunately I am still getting the "... can not open database \\frisco\myFolder\inci.mdb" message.
    I have the folder permissions and file permissions set to full for all users and anonomous page visitors. Are there any less obvious places I need to set permissions? I also shared "myFolder".
    It finds the DAP at http://www.mycompany.com\myfolder\ge..._from_inci.htm so not sure why it does not see the mdb.

    Both the DAP and the mdb are on the webserver frisco in the same folder. The connection string in my DAP uses \\frisco\myfolder\inci.mdb to reference the mdb.
    Nina

  8. #8
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    does the webserver know the server that has got the mdb on?
    is the server hiding behind a firewall, or is the webserver in a DMZ?
    .you or your network trolls may have to confugure the firewall appropriately

    This whole thing stinks of being a network troll / security problem, not really an application problem. I think you need to get your netwrok trolls to tell you where documents available to the webserver should lurk. Its a business requirement, its up to them to maintain the webserver, and make sure its kept secure. SO they should be able to tell your precisely which disk areas are available to the webserver and DAP application.

    you've proved the DAP is working.....
    So my fiorst stab at it would actaully be to move the MDB to the same directory as the DAP.

    but thinking on is the MDB visible in \\frisco\myfolder\inci.mdb

    ie if you were to go onto another PC/workstation and open a commandline can you see files if you type dir \\frisco\myfolder\*.mdb. or if you must use GUI tools, in file explorer can you connect to the \\frisco server, and does it immediately find myfolder..

    fundamentally the traditional troll of ecxcuse, the equivalent of "we ain't done nuffiink mister is irrelevant".. they hold the keys to the webserver.. so they should be able to tell you where to store the data.

  9. #9
    Join Date
    Mar 2008
    Posts
    19

    Lightbulb Good ones!

    Thank you very much. I will talk to the network guys (in fact will print your response to refer to). I had given up (which was going to mean eating crow bigtime) - but you have given some promising directions for me to go in. btw - yes - when I go to explorer prompt (from a pc connected directly to the webserver) and type in \\webserver\myfolder\, inci.mdb shows right up, as does the DAP. Also, I have both the mdb and the DAP on the web server (in the same folder). But we do have a DMZ and firewall so I will find out where the files are located in relation to them. Would it be possible to open the htm but not the mdb if they are in the DMZ for example?
    Thanks again, Nina

  10. #10
    Join Date
    Mar 2008
    Posts
    19
    .. also, don't know if it's a red herring, but if I delete the mdb file, I get the same error.

  11. #11
    Join Date
    Mar 2008
    Posts
    19
    If I want to use the drive letter rather than UNC, how do I check the data connection is valid by code, and attempt to repair it, by code, if not? (as you mentioned above.)

    Thank you, Nina

  12. #12
    Join Date
    Mar 2008
    Posts
    19

    Lightbulb "cannot open database" problem resolved

    Thank you all again very much for helping me rule out the various culprits. Your expert advice was extremely helpful.

    I thought you might get a chuckle out of what was wrong, or fall of your chair laughing.

    As you know, I used a verified UNC \\servername\.. format to specify the location of the mdb file and continued to get the "cannot open database error. "

    Turns out (from Micrsoft KB), that error can occur if you change the connection string to the UNC format specifying an inaccessible server, and then save the DAP. I do this sometimes prior to moving the DAPs from the development server to the production server. You would think it would work after you move it to the specified destination where the path is valid. But nooooooooooo....

    To correct the problem, you have to reopen the DAP, connect it to a local drive letter that it can see using the C:/ format, and then resave it.

    Then use wordpad or whatever, outside of Access to change the connection string to \\servername\..

    That got me past the "cannot open database" error.

    Naturally there were a couple more hitches after that, including "cannot locate object tablename" (corrected with later version of MDAC) and "... general network error" .. on it goes.



    v/r, Nina

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •