Issue 119313

Summary: SQLite ODBC memo/text as primary key does not read
Product: Base Reporter: Jane Atkinson <jane>
Component: codeAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Normal    
Priority: P3 CC: damjan, issues, jane, oooforum, r4zoli
Version: 3.4.0 Beta (OOo)   
Target Milestone: ---   
Hardware: PC   
OS: Linux, all   
Issue Type: DEFECT Latest Confirmation in: 4.1.7
Developer Difficulty: ---

Description Jane Atkinson 2012-05-06 02:08:41 UTC
I have been using OOo 3.3 successfully as the front end to several SQLite databases.

Since installing 3.4 RC I've noticed that one field in two databases (identical structure - different data) does not display. The field in question is a primary key field and contains membership numbers (but is defined as text).

Oddly enough, I can create a new record and write to that field, but it still doesn't display.

I wanted to test if this would happen in a new database, but on trying to connect to the new one, I got this error message:

Could not load the program library libodbc.so or it is corrupted. The ODBC data source selection is not available.

The OS is Ubuntu 12.04 32-bit and the AOO build is AOO340m1(Build:9590) - Rev. 1327774

Removing AOO 3.4 and reinstalling OOo 3.3 solves the problem.
Comment 1 r4zoli 2012-05-06 19:33:18 UTC
I can confirm it with same version under Ubuntu 12.04 when I try to create new file with ODBC option, and select ODBC-datasource on system, I get same error. 
This is a general ODBC connection problem under linux, same happens under opensuse 12.1.

This function works under Win7 without problem.
Comment 2 r4zoli 2012-05-06 19:35:48 UTC
Change assignee.
Comment 3 damjan 2017-11-20 00:37:15 UTC
Confirming in latest SVN.

It appears that both char and varchar primary key columns have empty fields in the table view window. This happens in both 32 and 64 bit.

Interestingly if the query is done through the following macro, the correct results are returned. So the database driver works. It must be a bug in a higher layer, such as the rowset or the table view window.


	Dim DatabaseContext As Object
	Dim DataSource As Object
	Dim Connection As Object
	Dim InteractionHandler as Object
	Dim Statement As Object
	Dim ResultSet As Object
	 
	DatabaseContext = createUnoService("com.sun.star.sdb.DatabaseContext")
	DataSource = DatabaseContext.getByName("ex1")
	 
	If Not DataSource.IsPasswordRequired Then
	  Connection = DataSource.GetConnection("","")
	Else
	  InteractionHandler = createUnoService("com.sun.star.sdb.InteractionHandler")
	  Connection = DataSource.ConnectWithCompletion(InteractionHandler)
	End If
	 
	Statement = Connection.createStatement()
	ResultSet = Statement.executeQuery("SELECT * FROM ""Table2""") 
	 
	If Not IsNull(ResultSet) Then
	  While ResultSet.next
	    MsgBox ResultSet.getString(1)
	    MsgBox ResultSet.getInt(2)
	  Wend
	End If
Comment 4 oooforum (fr) 2020-07-08 07:32:55 UTC
Same issue with the ODBC driver sqliteodbc_w64.exe provided by: 
http://ch-werner.de/sqliteodbc/
Comment 5 oooforum (fr) 2020-07-08 15:22:19 UTC
Fixed for LibO side: bugs.documentfoundation.org/show_bug.cgi?id=47520

But effort could be raised with a native SDBC driver: see issue #32117