BernieBeattie
Fri Mar 25 10:31:09 CST 2005
I like the words "acceptable manner" - a bit vague. I have to use the
cursorschema as I need SQL datetimes to become date fields for our
application to save a lot of rewriting. I'm not sure whether your post is
saying that the problem may go away if I use VFP9 instead. I'll give that a
try before going down the conversion route. It's just a bit odd that even
with a native VFP cursoradapter with the all the same fields and sizes but
just in a slightly different order, fails in cursorfill(.T.). I would have
thought this would be "acceptable".
Bernie
"Anders Altberg" wrote:
> The Help for CursorSchema in VFP9 says
> <<
> Note:
> In Visual FoxPro 9.0, DEFAULT values and table and field level CHECK
> constraints are supported for XML, Native, ADO and ODBC data sources. In
> Visual FoxPro 8.0, DEFAULT values and table and field level CHECK
> constraints are only supported for an XML data source. For the DEFAULT
> values and CHECK constraints to be applied to a cursor, call the CursorFill
> method with the lUseSchema parameter set to True (.T.).
>
>
>
> Visual FoxPro uses the CursorSchema property at design time to determine the
> structure of the cursor to place on the surface of the Data Environment
> Designer. Visual FoxPro uses CursorSchema at run time if specified by the
> CursorFill method.
>
> Note:
> You must make sure that CursorSchema matches and maps to the data
> source columns in an acceptable manner.
>
> <<
> -Anders
>
> "Bernie Beattie" <BernieBeattie@discussions.microsoft.com> wrote in message
> news:585549AF-9C89-45F3-A069-51A3310FA25C@microsoft.com...
> > Thanks for that Mark. I did use your cabuilder (and very useful it was
> too)
> > to help create all the namelist, fieldlist and cursorschema statements for
> > our 200 or so tables originally, but this was of course based on our data
> > structures here. I store these statements in a data dictionary but I need
> to
> > use the same statements for all clients. I hadn't appreciated the
> importance
> > at the time that the cursorschema had to be in exactly the same order as
> the
> > field order. It's a bit of a problem to get round this. I'm going to
> have
> > to go down the conversion route of appending client data on to correctly
> > ordered structures unless anyone knows of a command that allows you to
> move
> > fields around in the structure. You can do this by dragging fields during
> > MODI STRU so I was hoping there was a way to do this programmatically.
> >
> > Thanks for your help,
> > Bernie
> >
> > "Mark McCasland" wrote:
> >
> > > If you use SELECT * in the SelectCmd then the CursorSchema needs to be
> in
> > > the field order as found in the table. Otherwise, you have to list the
> > > fields in the SELECT statement. The other alternative is to build your
> > > SelectCmd via code in the init of the CA which you could write a builder
> to
> > > create this code for you, then call the WriteMethod of the CA to place
> your
> > > generated code into the init.
> > >
> > > For an example of this, you can get my free CA Builder by clicking the
> > > FoxPro Tools link at
http://www.mctweedle.com Be sure the read through
> the
> > > comments near the top of the CABuilder PRG file. My builder will not do
> what
> > > I suggested, but you can certainly get significant help in creating your
> CA
> > > classes, etc., from this.
> > >
> > > "Bernie Beattie" <BernieBeattie@discussions.microsoft.com> wrote in
> message
> > > news:76F9A901-FF2D-4BF9-969B-EBE6C55CE3AE@microsoft.com...
> > > > I am having problems with file structure field order and cursorschema
> > > > definitions. I want to be able to issue select statements without
> naming
> > > all
> > > > the fields e.g. select * from table1, but the cursorfill gets an error
> if
> > > the
> > > > field order in the table structure doesn't exactly match the order of
> the
> > > > fields in the cursorschema. We have written the cursorschema
> statements
> > > > based on the order of the fields in our test data but some of the
> client
> > > > sites have the fields in a slightly different order due to problems
> with
> > > > converting yonks ago so the system crashes. Why is VFP8 so particular
> > > about
> > > > the field order anyway?
> > > > Is there any way of programmatically changing the order of fields in
> the
> > > > table structure or do I have to go down the route of appending their
> data
> > > > into correctly ordered table structures?
> > > >
> > > > Thanks for any help.
> > > > Bernie
> > >
> > >
> > >
>