I’ve been trying to get the Image(LONGVARBINARY) file from a resultset so I could use it to update another row from another table to no avail. Please help.
Context = CreateUnoService("com.sun.star.sdb.DatabaseContext")
Db = Context.getByName("samplesystem")
Conn = Db.getConnection("","")
strSQL = "SELECT * FROM [User] WHERE [ID] ='"+sampleid+"';"
Stmt = Conn.createStatement()
UserDataQuery = Stmt.executeQuery(strSQL)
UserDataQuery.next()
Dim CurrentUserID as integer
Dim CurrentUserProfilePicture as Object
Dim CurrentUserName as string
Dim CurrentUserRole as String
CurrentUserID = LoggedInUserID
'CurrentUserProfilePicture =
CurrentUserName = UserDataQuery.GetString(4)
CurrentUserRole = UserDataQuery.GetString(12)
msgBox UserDataQuery.GetBytes(13)+"" 'BASIC runtime error. Object variable not set.
'I get an error here.
streSQL = "Update [CurrentUser] SET [ProfilePicture] = '"+CurrentUserProfilePicture+"', [Name] = '"+CurrentUserName+"', [UserID]= '"+CurrentUserID+"',[UserRole]= '"+CurrentUserRole+"' WHERE [ID] = 0;"
Stmt = Conn.createStatement()
UserDataQuery = Stmt.executeQuery(streSQL)
===========================================
Version: 7.3.5.2 (x86) / LibreOffice Community
Build ID: 184fe81b8c8c30d8b5082578aee2fed2ea847c01
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_PH); UI: en-US
Calc: CL