Click here to Skip to main content
13,046,375 members (120,853 online)
Rate this:
Please Sign up or sign in to vote.
See more:
<br />
Private Sub save_Click()<br />
Set Picture1.DataSource = Rs<br />
Picture1.DataField = "DOC"<br />
<br />
strSQL = "insert into LOB_TABLE(DOC)"<br />
strSQL = strSQL + "values(" & Picture1.Picture & " ) "<br />
strSQL = strSQL + "where ID = 1"<br />
Set Rs = Cn.Execute(strSQL)<br />
    MsgBox ("picture saved in table")<br />
Rs.Close<br />
End Sub<br />

Run-time error :
SQL command not properly ended......
In Watch Window:

insert into LOB_TABLE(DOC)values( & Picture1.Picture ) where ID = 1
insert into LOB_TABLE(DOC)values(-184217824) where ID = 1

Please help.........
Posted 28-Jan-13 0:15am

1 solution

Rate this: bad
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

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
Web01 | 2.8.170713.1 | Last Updated 28 Jan 2013
Copyright © CodeProject, 1999-2017
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