Click here to Skip to main content
12,070,942 members (64,130 online)
Rate this:
 
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 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 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web04 | 2.8.160208.1 | Last Updated 27 Jan 2013
Copyright © CodeProject, 1999-2016
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