DSOFile Active X control for Word and Excel problem

D

Do

I keep getting this error message when I hit refresh in the browser when I
run this code.

"The file is currently open and cannot be read."

I usually kill the objects after I've read through them.
Is there something I'm missing?

Try

'Run document security check

Dim objDocUser As New user

Dim objFileProps As New PropertyReaderClass

Dim objPropReader As DocumentProperties

Dim strFolder As String

strFolder = Server.MapPath("../files/")

objPropReader = objFileProps.GetDocumentProperties(strFolder &
Request.QueryString("filename"))

Response.Write(objPropReader.Title())

objPropReader = Nothing

objFileProps = Nothing

'*********************

'Document security check should only be run against the forms authentication
ticket

'Remove the querystring, this is not for security

If objDocUser.isfoldermember(Request.QueryString("folderid"), objUser.Name)
Then

lblDownload.Text = "<a href='../files/" & Request.QueryString("filename") &
"'>Download Now &gt;&gt;</a>"

Else

lblDownload.Text = "<B>You do not have rights to download this
document.</B>"

End If

objDocUser = Nothing

Catch ex As Exception

lblMessage.Text = ex.message

End Try
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top