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 save_Click()
Set Picture1.DataSource = Rs
Picture1.DataField = "DOC"
 
strSQL = "insert into LOB_TABLE(DOC)"
strSQL = strSQL + "values(" & Picture1.Picture & " ) "
strSQL = strSQL + "where ID = 1"
Set Rs = Cn.Execute(strSQL)
MsgBox ("picture saved in table")
Rs.Close
End Sub

 
Run-time error :
SQL command not properly ended......
In Watch Window:
 
?strsql
insert into LOB_TABLE(DOC)values( & Picture1.Picture ) where ID = 1
or
insert into LOB_TABLE(DOC)values(-184217824) where ID = 1
 
Please help.........
Posted 28-Jan-13 1:15am
surkhi623

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You have been given several alternatives for solutions in the other 4 postings of this same question.
See answers and comments to the following questions...
How to insert picture into oracle[^]
How to code for BLOB ?[^]
How to load and retrieve picture using vb and oracle[^]
How to load Picture in database?[^]
 

Here is yet another article on the subject
Save and Retrieve Image from a SQL Server Database using VB.NET[^]
 
As we've pointed out several times you can't just stick a picture into the SQL and hope for the best. I suggest that you look at the code from one of the links above and compare what you are doing with what they did and track down your errors that way.
 
Don't worry if the solutions are for SQL Server rather than Oracle - the difference in this case is somewhat trival.
 
As to the specific error above "SQL command not properly ended" I don't think you got this issue when you typed into the Immediate window the second time. Again - see comments to previous posts by you
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 390
1 Sergey Alexandrovich Kryukov 329
2 Afzaal Ahmad Zeeshan 244
3 BillWoodruff 210
4 Maciej Los 192
0 OriginalGriff 5,560
1 DamithSL 4,476
2 Maciej Los 3,942
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 28 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