dsoFile Summary Updates in ASP.Net

G

Guest

I'm having trouble with updating general fields (Title, Autor Suject, etc.)
in the summary of documents located on our Intranet. I've downloaded the
FilePropDemoVB7 example (http://support.microsoft.com/?kbid=224351) and even
tried modifing it to make the changes to my local files and I get the same
error on both the original and the ASP.net version. Here is an example of my
code that's tring to make a change:

Private Sub btnAccept_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnAccept.Click
Dim oSummProps As DSOFile.SummaryProperties
Dim fi As New FileInfo(Session("sFile"))

m_oDocument = New DSOFile.OleDocumentPropertiesClass

Try
m_oDocument.Open(fi.FullName, False,
DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess)
oSummProps = m_oDocument.SummaryProperties
oSummProps.Title = CType(mpHoriz.FindControl("txtTitle"),
TextBox).Text
oSummProps.Author = CType(mpHoriz.FindControl("txtAuthor"),
TextBox).Text
oSummProps.Subject = CType(mpHoriz.FindControl("txtSubject"),
TextBox).Text
oSummProps.Company = CType(mpHoriz.FindControl("txtCompany"),
TextBox).Text
oSummProps.Comments = CType(mpHoriz.FindControl("txtComments"),
TextBox).Text
m_oDocument.Save()
Catch ex As SystemException
Response.Write(ex.ToString)
Response.End()
Finally
m_oDocument.Close()
m_oDocument = Nothing
End Try
OpenDocumentProperties(fi)
End Sub

I've given Full Access rights to the folder where the changes are to be made
but that hasn't made a difference. But what's strange is that when I use the
modified demo application it should work for my local files but it also comes
up with the "Access Denied" error.

Is there something I'm missing?
 
P

Paul Clement

¤ I'm having trouble with updating general fields (Title, Autor Suject, etc.)
¤ in the summary of documents located on our Intranet. I've downloaded the
¤ FilePropDemoVB7 example (http://support.microsoft.com/?kbid=224351) and even
¤ tried modifing it to make the changes to my local files and I get the same
¤ error on both the original and the ASP.net version. Here is an example of my
¤ code that's tring to make a change:
¤
¤ Private Sub btnAccept_Click(ByVal sender As Object, ByVal e As
¤ System.EventArgs) Handles btnAccept.Click
¤ Dim oSummProps As DSOFile.SummaryProperties
¤ Dim fi As New FileInfo(Session("sFile"))
¤
¤ m_oDocument = New DSOFile.OleDocumentPropertiesClass
¤
¤ Try
¤ m_oDocument.Open(fi.FullName, False,
¤ DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess)
¤ oSummProps = m_oDocument.SummaryProperties
¤ oSummProps.Title = CType(mpHoriz.FindControl("txtTitle"),
¤ TextBox).Text
¤ oSummProps.Author = CType(mpHoriz.FindControl("txtAuthor"),
¤ TextBox).Text
¤ oSummProps.Subject = CType(mpHoriz.FindControl("txtSubject"),
¤ TextBox).Text
¤ oSummProps.Company = CType(mpHoriz.FindControl("txtCompany"),
¤ TextBox).Text
¤ oSummProps.Comments = CType(mpHoriz.FindControl("txtComments"),
¤ TextBox).Text
¤ m_oDocument.Save()
¤ Catch ex As SystemException
¤ Response.Write(ex.ToString)
¤ Response.End()
¤ Finally
¤ m_oDocument.Close()
¤ m_oDocument = Nothing
¤ End Try
¤ OpenDocumentProperties(fi)
¤ End Sub
¤
¤ I've given Full Access rights to the folder where the changes are to be made
¤ but that hasn't made a difference. But what's strange is that when I use the
¤ modified demo application it should work for my local files but it also comes
¤ up with the "Access Denied" error.
¤
¤ Is there something I'm missing?

What type of authentication are you using for your Web app? Are you implementing impersonation?

If you are not implementing impersonation have you provided sufficient permissions to the ASPNET
account?


Paul
~~~~
Microsoft MVP (Visual Basic)
 
G

Guest

Paul Clement said:
¤ I'm having trouble with updating general fields (Title, Autor Suject, etc.)
¤ in the summary of documents located on our Intranet. I've downloaded the
¤ FilePropDemoVB7 example (http://support.microsoft.com/?kbid=224351) and even
¤ tried modifing it to make the changes to my local files and I get the same
¤ error on both the original and the ASP.net version. Here is an example of my
¤ code that's tring to make a change:
¤
¤ Private Sub btnAccept_Click(ByVal sender As Object, ByVal e As
¤ System.EventArgs) Handles btnAccept.Click
¤ Dim oSummProps As DSOFile.SummaryProperties
¤ Dim fi As New FileInfo(Session("sFile"))
¤
¤ m_oDocument = New DSOFile.OleDocumentPropertiesClass
¤
¤ Try
¤ m_oDocument.Open(fi.FullName, False,
¤ DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess)
¤ oSummProps = m_oDocument.SummaryProperties
¤ oSummProps.Title = CType(mpHoriz.FindControl("txtTitle"),
¤ TextBox).Text
¤ oSummProps.Author = CType(mpHoriz.FindControl("txtAuthor"),
¤ TextBox).Text
¤ oSummProps.Subject = CType(mpHoriz.FindControl("txtSubject"),
¤ TextBox).Text
¤ oSummProps.Company = CType(mpHoriz.FindControl("txtCompany"),
¤ TextBox).Text
¤ oSummProps.Comments = CType(mpHoriz.FindControl("txtComments"),
¤ TextBox).Text
¤ m_oDocument.Save()
¤ Catch ex As SystemException
¤ Response.Write(ex.ToString)
¤ Response.End()
¤ Finally
¤ m_oDocument.Close()
¤ m_oDocument = Nothing
¤ End Try
¤ OpenDocumentProperties(fi)
¤ End Sub
¤
¤ I've given Full Access rights to the folder where the changes are to be made
¤ but that hasn't made a difference. But what's strange is that when I use the
¤ modified demo application it should work for my local files but it also comes
¤ up with the "Access Denied" error.
¤
¤ Is there something I'm missing?

What type of authentication are you using for your Web app? Are you implementing impersonation?

If you are not implementing impersonation have you provided sufficient permissions to the ASPNET
account?


Paul
~~~~
Microsoft MVP (Visual Basic)
Yes, I am implementing impersonation as shown in my web.config file:
<authentication mode="Windows" />
<identity impersonate="true" />

I have also set the IIS Service to Authenticate using only Basic
Authentication because it's going to a DFS virtual directory with NTFS
permissions set on each folder. But this is only accessing a directory on the
Web Server itself (as a testing are) that I have given Full Access to all
users.

Thanks,
Bill Alexander
 
P

Paul Clement

¤ > ¤ I'm having trouble with updating general fields (Title, Autor Suject, etc.)
¤ > ¤ in the summary of documents located on our Intranet. I've downloaded the
¤ > ¤ FilePropDemoVB7 example (http://support.microsoft.com/?kbid=224351) and even
¤ > ¤ tried modifing it to make the changes to my local files and I get the same
¤ > ¤ error on both the original and the ASP.net version. Here is an example of my
¤ > ¤ code that's tring to make a change:
¤ > ¤
¤ > ¤ Private Sub btnAccept_Click(ByVal sender As Object, ByVal e As
¤ > ¤ System.EventArgs) Handles btnAccept.Click
¤ > ¤ Dim oSummProps As DSOFile.SummaryProperties
¤ > ¤ Dim fi As New FileInfo(Session("sFile"))
¤ > ¤
¤ > ¤ m_oDocument = New DSOFile.OleDocumentPropertiesClass
¤ > ¤
¤ > ¤ Try
¤ > ¤ m_oDocument.Open(fi.FullName, False,
¤ > ¤ DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess)
¤ > ¤ oSummProps = m_oDocument.SummaryProperties
¤ > ¤ oSummProps.Title = CType(mpHoriz.FindControl("txtTitle"),
¤ > ¤ TextBox).Text
¤ > ¤ oSummProps.Author = CType(mpHoriz.FindControl("txtAuthor"),
¤ > ¤ TextBox).Text
¤ > ¤ oSummProps.Subject = CType(mpHoriz.FindControl("txtSubject"),
¤ > ¤ TextBox).Text
¤ > ¤ oSummProps.Company = CType(mpHoriz.FindControl("txtCompany"),
¤ > ¤ TextBox).Text
¤ > ¤ oSummProps.Comments = CType(mpHoriz.FindControl("txtComments"),
¤ > ¤ TextBox).Text
¤ > ¤ m_oDocument.Save()
¤ > ¤ Catch ex As SystemException
¤ > ¤ Response.Write(ex.ToString)
¤ > ¤ Response.End()
¤ > ¤ Finally
¤ > ¤ m_oDocument.Close()
¤ > ¤ m_oDocument = Nothing
¤ > ¤ End Try
¤ > ¤ OpenDocumentProperties(fi)
¤ > ¤ End Sub
¤ > ¤
¤ > ¤ I've given Full Access rights to the folder where the changes are to be made
¤ > ¤ but that hasn't made a difference. But what's strange is that when I use the
¤ > ¤ modified demo application it should work for my local files but it also comes
¤ > ¤ up with the "Access Denied" error.
¤ > ¤
¤ > ¤ Is there something I'm missing?
¤ >
¤ > What type of authentication are you using for your Web app? Are you implementing impersonation?
¤ >
¤ > If you are not implementing impersonation have you provided sufficient permissions to the ASPNET
¤ > account?
¤ >
¤ >
¤ > Paul
¤ > ~~~~
¤ > Microsoft MVP (Visual Basic)
¤ >
¤ Yes, I am implementing impersonation as shown in my web.config file:
¤ <authentication mode="Windows" />
¤ <identity impersonate="true" />
¤
¤ I have also set the IIS Service to Authenticate using only Basic
¤ Authentication because it's going to a DFS virtual directory with NTFS
¤ permissions set on each folder. But this is only accessing a directory on the
¤ Web Server itself (as a testing are) that I have given Full Access to all
¤ users.
¤
¤ Thanks,
¤ Bill Alexander


I haven't used DFS before, so I'm not sure what kind of security issues there might be. Are you
specifying a physical path to the file when using the DSOFile component?


Paul
~~~~
Microsoft MVP (Visual Basic)
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top