Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting file in image field
Message
De
27/09/2005 05:06:03
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8
Database:
MS SQL Server
Divers
Thread ID:
01053321
Message ID:
01053325
Vues:
13
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform