Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert a Word file in SQL Server
Message
From
27/08/2004 20:43:46
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
 
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00936777
Message ID:
00937234
Views:
22
Thanks Fred,
I't Works Fine, I simply forgot to try the simple way.

[ ],s
Peter

>Looks like you need some spaces and other ways to reference the fields:
>
csql = "INSERT INTO teste1 (texto) Values (?Y)"
>
>>I making some test to insert a DOC file into a SQL Server Table, but havent success in doing it!
>>Any Idea or advice how to do it ?
>>I tried with Image, Ntext, text field in SQL Server, and it didnt work also.
>>What Im missing ?
>>Thanks in Advance
>>
>>Peter
>>
>>* On SQL Server:
>>
>>CREATE TABLE [dbo].[teste1] (
>>	[codigo] [int] IDENTITY (1, 1) NOT NULL ,
>>	[texto] [image] NULL
>>) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
>>GO
>>
>>
>>*ON VFP
>>
>>CLEAR
>>=SQLDISCONNECT(0)
>>x = GETFILE("Doc","Word File")
>>Y = FILETOSTR(x)
>>
>>cStringConnect =("DRIVER={SQL Server};SERVER=BOSS700;UID=xxx;PWD=xxx;DATABASE=Atuante2")
>>nID = SQLSTRINGCONNECT(cStringConnect)
>>
>>csql = "INSERT INTO teste1(texto)Values("  + Y + ")"
>>a = SQLEXEC(nID,csql)
>>?a
>>IF a < 1
>>	=AERROR(my_erro)
>>	DISPLAY MEMORY LIKE my_erro
>>ELSE
>>	WAIT WINDOW "OK" TIMEOUT 1.5
>>ENDIF
>>
>>* ERROR message:
>>
>>my_erro(1,1) = 1526
>>my_erro(1,2) = "Connectivity error: [Microsoft] [ODBC SQL Server] [SQL Server] "
>>			   "The name 'ÐÏ'is not permitted in this context. Only constants, "
>>			   "expressionas, or variables allowed here. Column names are not permitted."
>>my_erro(1,4) = "37000"
>>
Previous
Reply
Map
View

Click here to load this message in the networking platform