Vtable.FieldCount problem was: Illegal Cast Exception

Barry G. Sumpter BarrySum at BigPond.Net.AU
Sat Oct 17 16:06:28 CDT 2009


Hi Steve,

I enjoy reading the issues and the solutions.
So please feel free to post as you see fit.

Any chance of you posting the code snippet before and after the fix?
As I too went thru conversion issues.

Looking forward to any further posts.

baz


-----Original Message-----
From: valentina-bounces at lists.macserve.net
[mailto:valentina-bounces at lists.macserve.net] On Behalf Of Steve Albin
Sent: Sunday, 18 October 2009 5:53 AM
To: Valentina Developers
Subject: Re: Vtable.FieldCount problem was: Illegal Cast Exception 

On 10/17/09 at 11:08 AM, steve at steve-albin.com (Steve Albin) wrote:

>Unfortunately, my app is a mixed bag of techniques that has 
>changed as I learned more.  I've been working on it since the 
>days of Valentina 1.  I use SQL to create my cursors and then 
>use VCursor classes to access the data.  It's worked fine for 
>me up to now.
>
>I'm using the vTable.FieldCount property when I need to access 
>fields from a SELECT statement that combines two tables.  I 
>generally do this:
>
>cursor.SqlExecute("SELECT tableA.*, tableB.fld1, tableB.fld2")
>
>Then I get the FieldCount of TableA so I can do this:
>
>return cursor.Field(DB.TableA.FieldCount+1).GetString
>
>to get tableB.fld1 without having to worry about changing that 
>code if I ever add fields to TableA.
>
>I've submitted a project and DB to Mantis that demonstrates the 
>problem.  ID = 0004590.


Just for the record, this turned out to be a problem in my code 
and not with Valentina.

In the release notes, there is an item mentioning a fix to a 
VTable constructor issue.  I was not calling the 
Super.constructor in my VTable classes.  In version 4.1, this 
was not necessary.  Evidently, in version 4.3, it is necessary.

Without calling the super, when creating a DB you get a DB with 
no tables.  But, when opening an existing DB, everything works 
except any method calls to the class.  I was only using the 
classes to open the DB and a few other minor things.  All my SQL 
and other API calls were fine.

Sorry for any confusion I may have caused.

Steve

-- 
Steve Albin - Montclair, NJ
http://www.jazzdiscography.com/
http://www.steve-albin.com/

_______________________________________________
Valentina mailing list
Valentina at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list