Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Storing Word documents in SQL Server
Message
 
 
To
05/11/2004 07:17:24
Jon Neale
Bond International Software
Wootton Bassett, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
00958440
Message ID:
00958626
Views:
21
Jim,

Exactly how are you pushing/pulling the data from SQL? We use SQL as a store for our client EXEs to make sure each machine has the latest version and it works quite flawlessly and some of these EXEs are quite huge > 32mb.

Make sure your backend column is TEXT and not NTEXT.

I'd also recommend you just use filetostr() and strtofile() to read/write the data out to disk.

>In our application we have a document database which is used to store documents.
>
>The document database basically holds the file in a Memo field, we achieve this by reading the file into a memvar using low level file functions.
>
>Like this:
>
> w_retval = ""
> w_fh = FOPEN(p_fn, 0)
> IF w_fh >= 0
> w_flen = FSEEK(w_fh, 0,2)
> =FSEEK(w_fh, 0,0)
> w_retval = FREAD(w_fh, w_flen)
> =FCLOSE(w_fh)
> ENDIF
>
>This works perfectly under FoxPro but under SQL we keep getting corruptions. In this case we have specifically seen the problem against Word documents where they get uploaded and then when we try to open them through the system they cannot open because they are corrupt.
>
>Even if we download the file outside of our application the file it creates is still corrupt.
>
>However, I have done some work on this and by using ADO to bypass the view I can load the same data into sql and retrieve it without corruption.
>
>In SQL we map Foxpro memo fields to Text fields, I have read somewhere that when saving data to a Text field in SQL Server that characters are modified and that its better to use the Image type to store this sort of information.
>
>Is this reliable information?
>
>I am currently thinking the only way around this is to use ADO, but this is going to require quite alot of work and was looking for a little inspiration.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform