Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.<br />
<br />
?strsql<br />
insert into TABLE1(PICS)values(-251326960 ) where ID = 1<br />
<br />
2.type mismatch<br />
<br />
Picture1.Picture = RES!PICS


Please help.............
Posted
Updated 25-Jan-13 3:16am
v2

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.
 
Share this answer
 
Comments
surkhi 27-Jan-13 23:38pm    
Of course it is BLOB data type in oracle table.....
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
 
Share this answer
 
v2
Comments
surkhi 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900