Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Campos Image
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00927252
Message ID:
00927459
Views:
18
Tentei marcar como solução, mas como já havia marcado como ajuda, não consegui. Por erro meu vc ficou com uma estrela so.

Abraços

Paulo



>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+
Paulo Cesar Carneiro
desenvolvimento@controplan.com.br


"My God, what have we done?"
-- Capt. Robert Lewis, co-pilot of the Enola Gay, recalling the moment the atomic bomb exploded over Hiroshima

At 8:15 a.m. on August 6 1945
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform