[Gambas-user] "Result is not available" error with ODBC connection and DataSource

Markus Schatten markus.schatten at ...2005...
Wed Mar 2 22:02:17 CET 2016


Dear Charlie,

no the one in question does not...  After dropping all tables without
keys, only leaving tables with keys, sadly still the same error...

All the best,

M.
--
Markus Schatten, PhD
Assistant professor and head of Artificial Intelligence Lab
University of Zagreb
Faculty of Organization and Informatics
Pavlinska 2, 42000 Varazdin, Croatia
http://www.foi.hr/nastavnici/schatten.markus/index.html
http://www.researchgate.net/profile/Markus_Schatten1
http://ai.foi.hr


On Wed, Mar 2, 2016 at 9:38 PM, Charlie Reinl <Karl.Reinl at ...9...> wrote:
> Am Mittwoch, den 02.03.2016, 21:03 +0100 schrieb Markus Schatten:
>> Dear friends,
>>
>> I'm trying to do a simple thing, connect a DataSource to a ODBC
>> connection (unixODBC). The DSN points to a simple sqlite3 database
>> which has a table test(a integer, b varchar(10)) in it. The unixODBC
>> seems to be working fine, since I can connect to the database using
>> isql and see all defined tables and data. The problem is when I try to
>> do it with Gambas, when setting the Table attribute of DataSource I
>> get the error:
>>
>> Result is not available
>>
>> The connection seems to load the schema of the table (I can see a and
>> b in the header of the DataBrowser) but not the data.
>>
>> Here is what I do:
>>
>> ' Gambas class file
>>
>> Public $con As New Connection
>>
>> Public Sub _new()
>>   $con.type = "odbc"
>>   $con.Host = "sqlite" 'name of the DSN
>>   $con.Login = "mylogin"
>>   $con.Password = "mypass"
>>   $con.port = ""
>>   $con.name = ""
>>   $con.Open
>>   DataSource1.Connection = $con
>>   Try DataSource1.Table = "test"
>>   If Error Then
>>     Print Error.Text
>>     Print Error.Where
>>     Print Error.Backtrace
>>     Print Error.Class
>>     Print Error.Code
>>   Endif
>>
>> End
>>
>> The fun part is that the same code works fine with a PostgreSQL
>> database over the ODBC connection (no error is risen, both schema and
>> data are loaded fine into the DataBrowser). I'm using the following
>> entry in /etc/odbc.ini :
>>
>> [sqlite]
>> Description=My SQLite database
>> Driver=SQLite3
>> Database=/home/markus/test.sqlite3
>> UserName = mylogin
>> Password = mypass
>>
>> What am I doing wrong?
>>
>> All the best,
>>
>> M.
>
> Salut Markus,
>
> does your sqlite3 tables have primary keys ?
> --
> Amicalement
> Charlie
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user




More information about the User mailing list