Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Campos Image
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00927252
Message ID:
00927317
Vues:
24
This message has been marked as a message which has helped to the initial question of the thread.
Ola Paulo,

Usando o ADO vc pode fazer assim:

Para Salvar uma Imagem no SQL-SERVER:
Local lcSql
Local strStream As ADODB.Stream
lcSql = "select IMAGEM from TABELA"

oRs.open(lcSql,oConn)

If !Empty(oRs.Fields("IMAGEM").Value)
  oRs.Fields("filialLogo").Value = Null
  oRs.Update()
Endif

sFileName = "c:\minha_imagem.jpg"
oPict = LoadPicture(sFileName)

strStream = Createobject("ADODB.Stream")
strStream.Type = 1  && adTypeBinary
strStream.Open
strStream.LoadFromFile(sFileName)
oRs.Fields("filialLogo").Value = strStream.Read
oRs.Update()
strStream.Close
oRs.close
Para ler a Imagem do SQL-SERVER
Local lcSql
Local strStream As ADODB.Stream

lcSql = "select IMAGEM from TABELA"

oRs.open(lcSql,oConn)

If Type("oRs.Fields('IMAGEM').Value") <> "U"
	strStream = Createobject("ADODB.Stream")
	strStream.Type = 1  && adTypeBinary
	strStream.Open
	strStream.Write(oRs.Fields("IMAGEM").Value)
	If File("temp\Temp.jpg")
		Delete File "temp\Temp.jpg"
	Endif
	strStream.SaveToFile("temp\Temp.jpg",1)
	oRs.Close
	strStream.Cancel
	strStream.Close
Endif
Espero que te ajude ...
Ate+
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform