Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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:

?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

1 solution

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
 
Share this answer
 

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