Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB6 Oracle
Private Sub Combo_Click()                       //display picture on combo click
sql="select ID,PICS from table1 where ID="& val(Combo) &"
Set RES = CON.Execute(sql)
Picture1.Picture = RES!PICS
End Sub
 
Private Sub Command_Click()                    //insert picture in table
strSQL = "insert into TABLE1(PICS)"
strSQL = strSQL + "values(" & Picture1.Picture & " ) "
strSQL = strSQL + "where ID="& val(Combo) &""
Set RES = Cn.Execute(strSQL)
Rs.Close
End Sub
 

Now Error is that:
1.sql command is not properly ended.
 
?strsql
insert into TABLE1(PICS)values(-251326960 ) where ID = 1
 
2.type mismatch
 
Picture1.Picture = RES!PICS

 
Please help.............
Posted 25-Jan-13 1:28am
surkhi623
Edited 25-Jan-13 4:16am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

What is the type of the PICS column?
 
I'm guessing the -251326960 is the picture handle. You have to extract the image data itself and store in a blob data field.
  Permalink  
Comments
cool_sari at 27-Jan-13 23:38pm
   
Of course it is BLOB data type in oracle table.....
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You've printed strSQL but it's sql that is not correct
sql="select ID,PICS from table1 where ID="& val(Combo ) &"
the bit I've underlined should not be there
 
For the 2nd part of your problem see micke.andersson's solution above - there are plenty of examples around
  Permalink  
v2
Comments
cool_sari at 27-Jan-13 23:40pm
   
how to extract the image data itself and store in a blob data field?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 BillWoodruff 360
1 Mathew Soji 309
2 DamithSL 225
3 Afzaal Ahmad Zeeshan 202
4 Maciej Los 190
0 OriginalGriff 6,249
1 Sergey Alexandrovich Kryukov 5,853
2 DamithSL 5,183
3 Manas Bhardwaj 4,673
4 Maciej Los 3,865


Advertise | Privacy | Mobile
Web03 | 2.8.1411019.1 | Last Updated 27 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100