Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting file in image field
Message
From
27/09/2005 05:06:03
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8
Database:
MS SQL Server
Miscellaneous
Thread ID:
01053321
Message ID:
01053325
Views:
12
>Hi
>i want to insert a file in an image field but without ADO Steam object!
>Any way?
** Assuming not specified fields accept null
Local lnHandle
lnHandle=Sqlstringconnect('DRIVER=SQL Server;SERVER=server;Trusted_connection=Yes')
Use employee
SQLPrepare(m.lnHandle,"insert into Northwind.dbo.employees"+;
  " (FirstName, LastName,Title,Photo)"+;
  " values (?employee.First_Name,?employee.Last_Name,?employee.Title,?employee.Photo)")
Scan
  SQLExec(m.lnHandle)
Endscan
* read back
SQLExec(m.lnHandle,'select * from Northwind.dbo.employees', 'SServer')
SQLDISCONNECT(m.lnHandle)
select SServer
browse
Or:
lcContent = "0x"+strconv(FileToStr("somefile.ext"),15)
SQLExec(m.lnHandle,'insert into myTable (myImage) values (?m.lcContent)')
and there are others.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform