Vtable.FieldCount problem was: Illegal Cast Exception
Steve Albin
steve at steve-albin.com
Sat Oct 17 14:52:43 CDT 2009
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/
More information about the Valentina
mailing list