Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Silly ASP DB bug ...

Options
  • 09-11-2007 1:02pm
    #1
    Users Awaiting Email Confirmation Posts: 351 ✭✭


    Hi guys,

    I'm testing a new version of my site on a sub folder of the main directory. It has a login (very same login as in the main site and uses the same db to verify login details as the main site) but when I run the script it gives me back an error saying that the file blah cannot be found. Now that would be fine except the path it gives for cannot be found is the correct path and by using that path I can access the db. So any ideas what the problem is? Is it because it's a sub-directory (I have done this before without problems). The only other difference is that I'm componentising the code (using SSI to store the database connection strings etc so that I can make changes in one place instead of in each of the many ASP pages this site has). The other connection strings work perfectly so don't really think that is the problem. Is it just one of those things??

    RD


Comments

  • Registered Users Posts: 413 ✭✭ianhobo


    Hey,
    Is it a local web server your running on, or is it a hosted enviroment?

    I've often had similar problems in the past that were usually related to the permission on the sub folder, it would be worth checking them


  • Registered Users Posts: 706 ✭✭✭DJB


    Are you using virtual paths or relative paths to find your include file?


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    Can you post your connection string? Are you using Server.MapPath()?

    You can use the FileSystem object to check that the file exists using the path. If it does, and you still have problems, then it could be a permissions problem.


  • Users Awaiting Email Confirmation Posts: 351 ✭✭ron_darrell


    
    loginStr = Server.MapPath("/component/db/login.mdb")
    loginStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & loginStr & ";"
    
    

    The folder the site is stored in is also a sub-folder of component. The connection string is stored in a includes subfolder of this folder. There are four different databases connecting to the site (don't ask but good reasons for doing so) and the other 3 work with no problems. I've checked the file exists using fs.FileExists where fs is a Scripting.FileSystemObject. The environment is a hosted environment. The permissions on both the folder holding the asp and the folder holding the databases is the same as all other similar folders on the site.

    I'm scratching my head. I tried using a login page in a higher folder (in the component folder actually) and it works perfectly (using the same code). I'm starting to think it's the subfolder but then why are the other 3 connection strings working??


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    
    loginStr = Server.MapPath("/component/db/login.asp")
    loginStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & loginStr & ";"
    
    

    The folder the site is stored in is also a sub-folder of component. The connection string is stored in a includes subfolder of this folder. There are four different databases connecting to the site (don't ask but good reasons for doing so) and the other 3 work with no problems. I've checked the file exists using fs.FileExists where fs is a Scripting.FileSystemObject. The environment is a hosted environment. The permissions on both the folder holding the asp and the folder holding the databases is the same as all other similar folders on the site.

    I'm scratching my head. I tried using a login page in a higher folder (in the component folder actually) and it works perfectly (using the same code). I'm starting to think it's the subfolder but then why are the other 3 connection strings working??

    why is your ASP page in the datasource?


  • Advertisement
  • Users Awaiting Email Confirmation Posts: 351 ✭✭ron_darrell


    Typo while posting the code - should be login.mdb.


  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    You realise you're overwriting loginStr with the second call. Perhaps you mean +=?


  • Moderators, Politics Moderators Posts: 39,899 Mod ✭✭✭✭Seth Brundle


    Not with classic ASP Aidan - his code is OK.


  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    kbannon wrote: »
    Not with classic ASP Aidan - his code is OK.
    Fair enough. Never really got into classic ASP :) Thought the same applied.


Advertisement