Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accsessing Images Stored in a SQL Server database

Status
Not open for further replies.

Maheshkshirsagar

Programmer
Nov 5, 2000
11
0
0
GB
I have stored images in SQl database with their datatype as binary using "insert" statement.This works fine.
Problem comes whenever i tries to accsess that images
I use
"Imag1" control to do so
Whenever I calls .filename property
I am shown Error messege saying "path/file accsess error"
I am using recordset to get Images like
Image1.pictire=rsImage("Photo") where photo is my field name
can anybody help me?
Project deadline is 10/11/00
 
Yuou have to use the GetChunk method of the field Object. Blob data such as Image or Text datatypes if using SQl Server can not be read conventionally because of the way it is stored on the database in linked pages. Look up GetChunk in the help and follow the instructions.....


Fizz
 
That's all well and good, but after you use GetChunk to read your image into a variable, how do you use it? I have:

lngLogoSize = rs("logo").ActualSize
lngOffset = 0
Do While lngOffset < lngLogoSize
varChunk = rs(&quot;logo&quot;).GetChunk(conChunkSize)
varLogo = varLogo & varChunk
lngOffset = lngOffset + conChunkSize
Loop
picImage.Picture = varLogo

I am getting an &quot;object required&quot; error on the last line & know I'm missing something, but I can't figure out what. Help Please ....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top