Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How will I ever get my app ported to SQL Server?
Message
 
 
À
27/08/2008 14:50:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01338696
Message ID:
01342303
Vues:
16
>OUCH!!! I just killed about 5-7 hours over the past 2 days troubleshooting a JOIN Select in a CA and without knowing the REQUIREMENT that the CursorSchema *MUST* match the Select statement *EXACTLY*!!!
>
>In my research I found this helpful (confirming) post that Mark McCasland had with someone in 2005:
>
>http://groups.google.com/group/microsoft.public.fox.programmer.exchange/browse_frm/thread/95046ced0745c297/f06f7f5dfcc29f55?lnk=st&q=vfp+cursorschema+match#f06f7f5dfcc29f55
>
>Here is my Select clause. Notice the use of ISNULL to decide whether to pull from one table or the other.
>(this is a custom “getSelectCmd” I added to my class to to be called from init() to set the cBaseSelectCmd)
>
>
>LOCAL lcSelectCmd
>lcSelectCmd = []
>TEXT TO lcSelectCmd NOSHOW PRETEXT 10
> Select qty,
> job_item.part_no,
> job_item.dwg_no,
> isnull(parts.description, job_item.description) as Description,
> job_item.price,
> job_item.price*job_item.qty as total,
> job_item.job_num,
> job_item.ipkey,
> job_item.item,
> job_item.taxable,
> job_item.qty_ship,
> job_item.qty_billed
> from job_item
> Left Join parts On job_item.part_no=parts.part_no
>ENDTEXT
>
>RETURN lcSelectCmd
>
>
>Anyway, I just had to be very careful to make the GetCurorSchema return the same exact structure, then it began to work.
>
>
>During my internet search on the problems I was having, I founf this *MISLEADING* post:
>http://www.vfpconversion.com/Article.aspx?quickid=0301112
>
>where the author tries to show in Listing 1 that you can create a schema any way you want, even adding fields that are not even in the Select. Am I missing something, or is this just wrong?

In this listing we have less fields in the schema than in Select. Did you try to run it?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform