Unix Technical Forum

Select BLOB problem using ODBC in IBM Informix client SDK 2.81

This is a discussion on Select BLOB problem using ODBC in IBM Informix client SDK 2.81 within the Informix forums, part of the Database Server Software category; --> Hi I can't select BLOB field from an Informix database using VBScript in an ASP-page. We used to have ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 08:20 AM
Mattias
 
Posts: n/a
Default Select BLOB problem using ODBC in IBM Informix client SDK 2.81

Hi

I can't select BLOB field from an Informix database using VBScript in
an ASP-page. We used to have the merant ODBC-driver, but after
switching to the ODBC driver in IBM Informix client SDK 2.81 our code
does not work anymore. The database is Informix 9.3 on HP-UX.

Testexample:

--Create a test-table using dbaccess:
create table blobtst(id integer, img blob)


--insert an test image using dbaccess:
INSERT INTO blobtst (id, img)
VALUES (1, FILETOBLOB('spaceshuttle.jpg', 'client'))


--verify that the image is in the database using dbaccess:
select LOTOFILE(img, 'spaceout.jpg' , 'client') from blobtst where
id=1

So far so good. Everything works perfectly well.

Example ASP code run on IIS 9.6 showing the images in a web browser:

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.open **DSN**, ***USERNAME***, ***PASSWORD****
Set oRs = oConn.Execute("select img from blobtst where id = 1")
PicSize = oRs("img").ActualSize
Pic = oRs("img").GetChunk(PicSize)
Response.Buffer = TRUE
Response.AddHeader "Content-type", "image/jpeg"
Response.BinaryWrite Pic
Response.End
oConn.close



This is the error message we recive:
Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB
status value, if available. No work was done.
select_blob_tst.asp, line 5

The value of PicSize is 72, but the image I used in test was 62581
bytes

Any ideas???

// Mattias Malmgren
(remove spaces)
Mattias _ at _ freefarm _ se @ yahoo . com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008, 08:22 AM
Mattias
 
Posts: n/a
Default Re: Select BLOB problem using ODBC in IBM Informix client SDK 2.81

Just want to inform about that if the oledb driver of infomix client
sdk is used instead of the odbc driver the same code works.
//Mattias
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:01 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com