Dear All

Can anyone tell me how to insert a WORD DOCUMENT using TEXTCOPY?

I'm able to insert jpegs / bmps etc. but I get an error when trying to inser a WORD DOCUMENT

This is my code

Thanks for your help


spTextcopy @srvname = 'SERVERNAME',
@login = 'sa',
@password = 'PASSWORD',
@dbname = 'DBNAME',
@tbname = 'tblTest',
@colname = 'myTextCol', -- this is a text col.
@filename = 'c:\MYTEST.DOC,
@whereclause = " WHERE myid = 1 ",
@direction = 'I'

CREATE PROCEDURE spTextcopy
(
@srvname varchar (30),
@login varchar (30),
@password varchar (30),
@dbname varchar (30),
@tbname varchar (30),
@colname varchar (30),
@filename varchar (30),
@whereclause varchar (40),
@direction char(1)
)

AS

DECLARE @exec_str varchar (255)

SELECT @exec_str =
'textcopy /S ' + @srvname +
' /U ' + @login +
' /P ' + @password +
' /D ' + @dbname +
' /T ' + @tbname +
' /C ' + @colname +
' /W "' + @whereclause +
'" /F ' + @filename +
' /' + @direction