I have an Access 2010 database that contains a table with a field ("notes") that has a data type = OLE Object. This field contains a single or multipage MS Word document and it opens Word outside of Access. I can make changes to the document and the table
saves all the changes in the Access database. The other fields are ID, Lastname, Firstname. In Access I have no problem in opening the table and making changes to the document, but with ASP all I get is "byte.system". I would appreciate any help in being
able to open MS Word and display the document.
If you want to do this in ASP.NET, you need to write the document to the Response, which you can do using Response.BinaryWrite(). You also need to provide a way for the user to return the updated document to the web server so that the database can be updated.
Here's an article that discusses the basics revolving around storing files in Access with ASP.NET:
http://www.mikesdotnetting.com/Article/123/Storing-Files-and-Images-in-Access-with-ASP.NET
Thanks Mike. However, I encountered a problem: CodeFile="AccessUpload.aspx.cs"
Inherits="AccessUpload. I do not know where to find the AccessUpload.aspx.cs. Also "Stream" has a problem: The type or namespace name 'Stream' could not be found (are you missing a using
directive or an assembly reference?)
Code behind files are a most basic concept in ASP.NET Web Forms. If you don't want to start with a book, try the introductory tutorials here:
http://www.asp.net/web-forms
gattabria
Member
6 Points
7 Posts
Access 2010 database with table containing field that contains Word 2010 documents
Dec 01, 2011 11:30 PM|LINK
I have an Access 2010 database that contains a table with a field ("notes") that has a data type = OLE Object. This field contains a single or multipage MS Word document and it opens Word outside of Access. I can make changes to the document and the table saves all the changes in the Access database. The other fields are ID, Lastname, Firstname. In Access I have no problem in opening the table and making changes to the document, but with ASP all I get is "byte.system". I would appreciate any help in being able to open MS Word and display the document.
Mikesdotnett...
All-Star
155593 Points
19979 Posts
Moderator
MVP
Re: Access 2010 database with table containing field that contains Word 2010 documents
Dec 02, 2011 06:28 AM|LINK
If you want to do this in ASP.NET, you need to write the document to the Response, which you can do using Response.BinaryWrite(). You also need to provide a way for the user to return the updated document to the web server so that the database can be updated. Here's an article that discusses the basics revolving around storing files in Access with ASP.NET: http://www.mikesdotnetting.com/Article/123/Storing-Files-and-Images-in-Access-with-ASP.NET
Web Pages CMS | My Site | Twitter
gattabria
Member
6 Points
7 Posts
Re: Access 2010 database with table containing field that contains Word 2010 documents
Dec 02, 2011 08:55 PM|LINK
Thanks Mike. However, I encountered a problem: CodeFile="AccessUpload.aspx.cs" Inherits="AccessUpload. I do not know where to find the AccessUpload.aspx.cs. Also "Stream" has a problem: The type or namespace name 'Stream' could not be found (are you missing a using
directive or an assembly reference?)
Thank you for your help
Mikesdotnett...
All-Star
155593 Points
19979 Posts
Moderator
MVP
Re: Access 2010 database with table containing field that contains Word 2010 documents
Dec 02, 2011 09:31 PM|LINK
That was the code behind. Create a page with a code behind file.
Add using System.IO; to the top of your code behind.
Web Pages CMS | My Site | Twitter
gattabria
Member
6 Points
7 Posts
Re: Access 2010 database with table containing field that contains Word 2010 documents
Dec 03, 2011 12:00 AM|LINK
I created a page to put the code behind file but I do not know what code to use? Is it listed? I am new to C#.
Mikesdotnett...
All-Star
155593 Points
19979 Posts
Moderator
MVP
Re: Access 2010 database with table containing field that contains Word 2010 documents
Dec 03, 2011 07:51 AM|LINK
I wrote an article about how to do it. If you are having trouble nderstanding that article, I suggest you start at the beginning: http://www.amazon.co.uk/Beginning-ASP-NET-Vb-Wrox-Programmer/dp/0470502215/ref=pd_cp_b_1
Web Pages CMS | My Site | Twitter
gattabria
Member
6 Points
7 Posts
Re: Access 2010 database with table containing field that contains Word 2010 documents
Dec 03, 2011 08:16 PM|LINK
That is a book in the UK. Could you please tell me where to put the code behind file? I would really appreciate it. Thank you.
Mikesdotnett...
All-Star
155593 Points
19979 Posts
Moderator
MVP
Re: Access 2010 database with table containing field that contains Word 2010 documents
Dec 03, 2011 09:09 PM|LINK
Code behind files are a most basic concept in ASP.NET Web Forms. If you don't want to start with a book, try the introductory tutorials here: http://www.asp.net/web-forms
Web Pages CMS | My Site | Twitter
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Access 2010 database with table containing field that contains Word 2010 documents
Dec 03, 2011 11:53 PM|LINK
Hello:)
In fact you can drag and drop a button onto the aspx page,and you can double click the button and do what Mikesdotnetting's suggestions。
Best reguards!