Problems with ADODB.Open
I am trying to implement what I have learnt from the Beginning ASP book, in a modification to an existing ASP application. I am working on an IIS installation in my own laptop, under Windows Server 2003.
The application that I am modifying presents am HTML table containing a list of files that are in the website, having retrieved them from an index; each table row includes a hyperlink to the file itself, and the user can click this to view the file that is required.
What I am trying to do is to allow for the fact that the different files may be in different places in the virtual folder tree, and that the incoming user may or may not be permitted access to them (limited by folder permissions). I want to exclude from the table those files that will not be accessible.
In order to get this working, I have started by introducing the code to test for the file's accessibility - I have not yet done anything yet to actually restrict access.
So as I loop through the table, I attempt an ADODB Open on each file as I retrieve its URL, with On Error Resume Next in effect so that I can test the State property of the record object to see whether the Open worked.
The problem is that this Open *always* fails, yet if I ignore the failure and build the table row anyway (commenting out my new code), the hyperlink access to the file works OK.
Because this was puzzling me greatly, I went to the Record.asp example from the book, and started modifying that to try to reproduce the problem. But here I get a different problem; if I use the ADODB Open to access a data file in the BEGASP folder or a subfolder of it, this works OK, and it still works OK if I execute the Record.asp page from my own application folder; but if I change Record.asp to try to access a file in my own application folder, the browser hangs indefinitely - and this happens whether I execute record,asp from the BEGASP folder, or from my own application folder.
I would much appreciate any advice & guidance that anyone can offer!!
|