











CompTIA
Exam Vouchers
Save money on CompTIA exams
| Question of the day
Sign up to receive
interactive practice questions
for MCSE, CompTIA
Cisco and other exams
| TestKing
Get MCSE, MCSD, CCNA, CCNP,A+, N+ and many more | * ExamSheets *
Guide for Success!
Actual Questions & Answers
MCSE, MCSD, A+ ,CCNA, CCNP
Oracle 8i, Oracle 9i Online practice tests
Certification sites Online university Online college Online education Distance learning Software forum Server administration forum Programming resources
|
|  |
Pages (2): [1] 2 »
| Author |
Insert Question. URGENT
|
mauro
Junior Member
Registered: Apr 2002 Location: Country: Brazil State: Certifications: MCSE, MCSD, MCDBA Working on:
Total Posts: 6
|
|
Insert Question. URGENT
URGENT !!!
I need to insert a "MS Word File" in a SQL Database field.
An Example:
Table
-----
Name Char 50
Adress Varchar(200)
WordFile Binary (I guess).
In this row (Wordfile) i would like to put a MS Word File, and read it ?
Someone have an example or some reference ???
Thanks

Report this post to a moderator
|
|
04-17-02 05:20 PM
|
|
felafel
Junior Member
Registered: Mar 2002 Location: Country: United States State: Certifications: MCSD Working on: MCDBA
Total Posts: 12
|
|
Why would you want to put a file in a database? Why not just put the name or path and then use a program (Word?) to open it?
Report this post to a moderator
|
|
04-17-02 08:28 PM
|
|
J-Ho
Member
Registered: Mar 2002 Location: Country: Ireland State: Certifications: MCDBA, MCSD, MCSA, MCSE Working on: MCAD
Total Posts: 85
|
|
Re: Insert Question. URGENT
quote: Originally posted by mauro
WordFile Binary (I guess).
Don't use binary. From BOL:
A column assigned the binary data type must have the same fixed length (up to 8 KB) for each row. In a column assigned the varbinary data type, entries can vary in the number of hexadecimal digits (up to 8 KB) they contain. Columns of image data can be used to store variable-length binary data exceeding 8 KB, such as Microsoft Word documents, Microsoft Excel spreadsheets, and images that include bitmaps, Graphics Interchange Format (GIF), and Joint Photographic Experts Group (JPEG) files.
In other words, use Image instead.
quote:
Someone have an example or some reference ???
Sure, BOL and MSDN has plenty.
If you're using ADO 2.x, use the AppendChunk and GetChunk methods. There are samples in MSDN.
Dunno how you do this in ADO.NET, cause I've never had to learn it yet:-) I'm sure that's in MSDN as well tho.
Let me know if you need further help,
J
Report this post to a moderator
|
|
04-17-02 08:49 PM
|
|
J-Ho
Member
Registered: Mar 2002 Location: Country: Ireland State: Certifications: MCDBA, MCSD, MCSA, MCSE Working on: MCAD
Total Posts: 85
|
|
quote: Originally posted by felafel
Why would you want to put a file in a database? Why not just put the name or path and then use a program (Word?) to open it?
I can think of plenty of reasons; e.g. a document collaboration system online; managing what/how data is published on your company website; a source code management system like Visual Source Safe etc.
You're right to ask tho; "Why" is often more interesting than "How"...
Report this post to a moderator
|
|
04-17-02 08:50 PM
|
|
mauro
Junior Member
Registered: Apr 2002 Location: Country: Brazil State: Certifications: MCSE, MCSD, MCDBA Working on:
Total Posts: 6
|
|
Its looks like a great ideia, but in fact the files don't must to be see for other peoples, just the owner of this file.
Image a directory with 1000 files and one file below to me, so i get my file and can see another 999. Isn't a good ideia.
Thanks
quote: Originally posted by felafel
Why would you want to put a file in a database? Why not just put the name or path and then use a program (Word?) to open it?
Report this post to a moderator
|
|
04-18-02 10:48 AM
|
|
mauro
Junior Member
Registered: Apr 2002 Location: Country: Brazil State: Certifications: MCSE, MCSD, MCDBA Working on:
Total Posts: 6
|
|
Thanks 2.
But i dont like to share the files, its looks like simple storage a file in a database (So its looks like), but i cant find any example.
quote: Originally posted by J-Ho
I can think of plenty of reasons; e.g. a document collaboration system online; managing what/how data is published on your company website; a source code management system like Visual Source Safe etc.
You're right to ask tho; "Why" is often more interesting than "How"...
Report this post to a moderator
|
|
04-18-02 10:53 AM
|
|
mauro
Junior Member
Registered: Apr 2002 Location: Country: Brazil State: Certifications: MCSE, MCSD, MCDBA Working on:
Total Posts: 6
|
|
Re: Re: Insert Question. URGENT
Can you show me an example please. Anyone
quote: Originally posted by J-Ho
Don't use binary. From BOL:
A column assigned the binary data type must have the same fixed length (up to 8 KB) for each row. In a column assigned the varbinary data type, entries can vary in the number of hexadecimal digits (up to 8 KB) they contain. Columns of image data can be used to store variable-length binary data exceeding 8 KB, such as Microsoft Word documents, Microsoft Excel spreadsheets, and images that include bitmaps, Graphics Interchange Format (GIF), and Joint Photographic Experts Group (JPEG) files.
In other words, use Image instead.
Sure, BOL and MSDN has plenty.
If you're using ADO 2.x, use the AppendChunk and GetChunk methods. There are samples in MSDN.
Dunno how you do this in ADO.NET, cause I've never had to learn it yet:-) I'm sure that's in MSDN as well tho.
Let me know if you need further help,
J
Report this post to a moderator
|
|
04-18-02 11:05 AM
|
|
J-Ho
Member
Registered: Mar 2002 Location: Country: Ireland State: Certifications: MCDBA, MCSD, MCSA, MCSE Working on: MCAD
Total Posts: 85
|
|
quote: Originally posted by mauro
...the files don't must to be see for other peoples, just the owner of this file.
Image a directory with 1000 files and one file below to me, so i get my file and can see another 999. Isn't a good ideia.
...
Is this your main goal, enforce permissions on files? If so, you'd be better of using NTFS permissions and/or Encryption File System in Windows 2000+.
Also, you should seriously question putting 1000 files together like that. It can turn into a maintenance nightmare.
If you're dealing with fairly few users contributing files, it might be a better idea to give each users their own directory (or create directories based on project, month the documents are created, department or whatever makes sense), create a DFS that abstracts the actual directory structure and assign proper permissions.
Report this post to a moderator
|
|
04-18-02 04:56 PM
|
|
J-Ho
Member
Registered: Mar 2002 Location: Country: Ireland State: Certifications: MCDBA, MCSD, MCSA, MCSE Working on: MCAD
Total Posts: 85
|
|
Re: Re: Re: Insert Question. URGENT
quote: Originally posted by mauro
Can you show me an example please. Anyone
Can you explain the intended architecture? Are you creating a dedicated front end; is this a Win32 app or a web page; what languages and technologies are you using besides SQL Server?
The more info you can give, the better.
Report this post to a moderator
|
|
04-18-02 04:57 PM
|
|
mauro
Junior Member
Registered: Apr 2002 Location: Country: Brazil State: Certifications: MCSE, MCSD, MCDBA Working on:
Total Posts: 6
|
|
Re: Re: Re: Re: Insert Question. URGENT
Windows 2000 Server and ASP (Active Server Pages) and would like to choose a file and put in my SQL Server 2000.
Regards
quote: Originally posted by J-Ho
Can you explain the intended architecture? Are you creating a dedicated front end; is this a Win32 app or a web page; what languages and technologies are you using besides SQL Server?
The more info you can give, the better.
Report this post to a moderator
|
|
04-18-02 06:10 PM
|
|
|
MCSE exam notes
Forum Rules: Who Can Read The Forum? Any registered user or guest.
Who Can Post New Topics? Any registered user.
Who Can Post Replies? Any registered user.
Changes: Messages can be edited by their author.
Posts: HTML code is OFF. Smilies are ON. vB code is ON. [IMG] code is ON. |
|
ExamNotes forum archive
|