To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=92638 Issue #|92638 Summary|setBinaryStream on prepared statement with stream poin |ter at end crashes application Component|Database access Version|DEV300m28 Platform|All URL| OS/Version|All Status|NEW Status whiteboard| Keywords| Resolution| Issue type|DEFECT Priority|P3 Subcomponent|none Assigned to|dbaneedsconfirm Reported by|atjensen
------- Additional comments from [EMAIL PROTECTED] Sun Aug 10 18:55:30 +0000 2008 ------- This was found actually with OOo300 m_1, XP ( don't see this build listed ) In testing Issue http://www.openoffice.org/issues/show_bug.cgi?id=56643 so as to close it I was able to crash the application a number of times, using the 3.0 code line. The problem is actually in using the example Basic code supplied in the other issue. Specifically if you look at the code you will see that it is not really going to write anything to the database and under 2.4.1 you end up with a new record and no image data in the image field - under OOo300 m_1 however you will crash the application also. Note the crash does not seem to happen each and every time, but it will happen on a fairly regular basis on my machine if you repeat the macro. It seems that using an ODB file created with 2.4 or older helps cause the crash to happen. I have attached a test doc and will add my Basic macro - using these two together I could crash the application on an almost consistent basis. Crash report id's from a couple of the crashes - each was from a crash using a different database and a slight change in the Basic code.. rgdk4uc rc2k4uc rx2k4uc r42k4uc Also, it seems that having an empty table may play into this also, but it is not required to force the crash '------------ Basic code used to get the crash -------------------------- Sub Main oDBCntxt = CreateUnoService("com.sun.star.sdb.DatabaseContext") dim oDS 'if not oDBCntxt.hasByName( "test_insert_image" ) then if not oDBCntxt.hasByName( "test_image_231" ) then print "you must register the db" else dim oCon 'oDS = oDBCntxt.getByName( "test_insert_image" ) oDS = oDBCntxt.getByName( "test_image_231") oCon = oDS.getconnection( "SA", "SA" ) endif oStatement = oCon.PrepareStatement( "insert into ""Images"" (""im"") values (?)" ) oSimpleFileAccess = createUnoService("com.sun.star.ucb.SimpleFileAccess") oStream = oSimpleFileAccess.openFileRead("c:\tmp\chuck1.jpg") Dim oData() Dim lLen As Long lLen = oStream.getLength() ReDim oData(0 To lLen-1) oStream.readBytes(oData(), lLen) oStatement.setBinaryStream(1, oStream, oStream.getLength()) oStatement.executeUpdate oCon.close( True ) oCon.dispose End Sub '--------------------------------------------------------------------------- --------------------------------------------------------------------- Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]