[Gambas-user] Problem with TableView & Mysql (strange unknown field error)

Nigel Gerrard nigel at ...38...
Mon Sep 6 17:39:03 CEST 2004


As usual, I believe I have a fix which goes out just after the next release
of gamba :-(

This patch should work against both 0.99 and 0.98a.

Put main.c.diff in gambas-0.99/src/lib/db/mysql

apply: patch main.c main.c.diff

Then make and make install.

Benoit, please include this update for the next distribution.

Kind regards

Nigel

----- Original Message ----- 
From: "Notorious" <notorious at ...606...>
To: <gambas-user at lists.sourceforge.net>
Sent: Thursday, September 02, 2004 9:48 PM
Subject: Re: [Gambas-user] Problem with TableView & Mysql (strange unknown
field error)


> Nigel,
>
> What exactly do you mean by database driver ?
>
> the libraries are -> gambas-mysql 0.98a
> mysql is version -> 4.0.20-11
>
> Is this what you seek?
>
> thx
> Notorious
>
> Nigel Gerrard wrote:
>
> >Notorious,
> >
> >Could you tell me which database driver you are using as alias support
> >is unfortunately different on each.
> >
> >Nigel
> >
> >On Thu, 2004-09-02 at 20:44, Notorious wrote:
> >
> >
> >>Hi
> >>
> >>Thank you for reading this :)
> >>I'm running linux debian (2.6) & gambas 0.98a
> >>I want to read out a query result and put in a tableview.
> >>All goes well but when I use a more advanced query (i.e with
> >>from_unixtime(<column>) ) I get an "unknown field error: .<field>"
error.
> >>
> >>Example:
> >>(from database example)
> >>
> >>PRIVATE $hConn AS Connection
> >>PRIVATE $rdata AS Result
> >>
> >>public sub form_open()
> >><insert establish conn code here :)>
> >>end
> >>
> >>PRIVATE SUB ReadData()
> >>
> >>  DIM htable AS Table
> >>  DIM hfield AS ResultField
> >>  DIM sfield AS String
> >>  DIM iInd AS Integer
> >>
> >>  INC Application.Busy
> >>
> >>  $rdata = $hconn.Exec("SELECT * FROM foo")
> >>
> >>*// With this query all works fine //*
> >>
> >>  $rdata = $hconn.Exec("SELECT id,FROM_UNIXTIME(time) as bar FROM foo")
> >>
> >>*// Using this one I would get the error: "Unknown field: .bar", same
> >>with INET_TOA //*
> >>
> >>  Table1.Rows.Count = 0
> >>
> >>  Table1.Columns.Count = $rdata.Fields.Count
> >>
> >>  FOR EACH hfield IN $rdata.Fields
> >>    WITH hfield
> >>
> >>      Table1.Columns[iInd].Text = .Name
> >>      Table1.Columns[iInd].Width =
WidthFromType(table1,.Type,.Length,.Name)
> >>
> >>    END WITH
> >>  INC iInd
> >>  NEXT
> >>
> >>  Table1.Rows.Count = $rdata.Count
> >>
> >>FINALLY
> >>
> >>  DEC Application.Busy
> >>
> >>CATCH
> >>
> >>  Message.Error("Cannot exec request." & "\n\n" & Error.Text)
> >>
> >>END
> >>
> >>PRIVATE FUNCTION WidthFromType(hCtrl AS control, iType AS Integer,
> >>iLength AS Integer, sTitle AS String) AS Integer
> >> <insert it here :)>
> >>END
> >>
> >>PUBLIC SUB table1_Data(Row AS Integer,column AS Integer)
> >><insert it here :)>
> >>END
> >>
> >>Please help me, what am I doing wrong??
> >>
> >>Thx
> >>
> >>Notorious
> >>
> >>PS:I like what you guys are doing with the program, keep up the good
job!!
> >>
> >>
> >>-------------------------------------------------------
> >>This SF.Net email is sponsored by BEA Weblogic Workshop
> >>FREE Java Enterprise J2EE developer tools!
> >>Get your free copy of BEA WebLogic Workshop 8.1 today.
> >>http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
> >>_______________________________________________
> >>Gambas-user mailing list
> >>Gambas-user at lists.sourceforge.net
> >>https://lists.sourceforge.net/lists/listinfo/gambas-user
> >>
> >>
> >
> >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by BEA Weblogic Workshop
> >FREE Java Enterprise J2EE developer tools!
> >Get your free copy of BEA WebLogic Workshop 8.1 today.
> >http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
> >_______________________________________________
> >Gambas-user mailing list
> >Gambas-user at lists.sourceforge.net
> >https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> >
> >
> >
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c.diff
Type: application/octet-stream
Size: 96 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20040906/7934db80/attachment.obj>


More information about the User mailing list