Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remote view against Access questions
Message
De
21/10/2001 10:01:18
 
 
À
19/10/2001 16:10:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00570428
Message ID:
00571427
Vues:
25
Charles,

I used SPT in my tests. FALSE/TRUE in Access is equivalent to .F. and .T. in VFP. Therefore, the following line in Access
SELECT TRUE, FALSE, * FROM products WHERE discontinued=TRUE
corresponds to the following line in VFP
SELECT .t., .f., * FROM products WHERE discontinued=.t.
This was just an attempt to see what happens if you add a logical value to a SELECT statement in Access. As I mentioned in my previous message, neither TRUE nor FALSE create a logical field type in the remote cursor. Rather, the return value is -1(TRUE) and 0(FALSE).

If I understand you correctly, you just want an additional field in your remote cursor in order to bind a checkbox to. If this is the case, you can simply use SELECT 0 AS nExclude. This works because a checkbox in VFP accepts both logical values (.T./.F.) and integers (1, 0).

HTH

>Thanks, Daniel
>
>Using IS NULL solved the problem with parameterizing against an empty Processed text field.
>
>I used 1=2 AS lExclude to get an integer field. I'll try binding my checkbox to that.
>
>Didn't understand this phrase in your answer, though
>
>SELECT TRUE, FALSE, * FROM products WHERE discontinued=TRUE
>
>Aren't TRUE and FALSE values and wouldn't you have to name them? Would this result in two fields named TRUE and FALSE (sorry, no sQL server on this machine to test it)
>
>If I try this as part of my remote view I get an error that colum TRUE is not found
>
>
>>I don't know how to add a logical field to a view. The following samples are against the northwind.mdb. In the WHERE clause you can use TRUE/FALSE as shown below. However, when using TRUE AS MyField or FALSE AS MyField2, then for some strange reason VFP doesn't convert this to a logical field. Rather TRUE is -1 and FALSE is 0. I guess in your case you could simply use 0 or 1 AS nFlag and bind your checkbox to this field.
>>
>>
>>SQLEXEC(nAccess, "SELECT TRUE, FALSE, * FROM products WHERE discontinued=TRUE")
>>
>>
>>In order to select empty field values you could use the following:
>>
>>SQLEXEC(nAccess, "SELECT * FROM customers WHERE ISNULL(fax)")
>>
>>
>>With SQL Server, you could use
>>
>>SQLEXEC(nSql, "SELECT * FROM customers WHERE fax IS NULL")
>>
>>
>>HTH
>>>I have a remote view against an Access table and am struggling with data type and syntax issues.
>>>
>>>1. If I wanted to add a logical field to a view against a vfp table I could say " .f. as lexclude " How would I do this when the view is coming from Access? I tried [NO] as lexclude but it won't eat that saying an expected parameter is not found etc. Note that this logical field which is just there so I can have a checkbox in my grid that displays the view which will be used in later processing - once the data comes from Access it has nothing to do with the back end. (no, i don't want to use a listbox activex control < g > )
>>>
>>>2. I have a character or 'text' field in the access table. I want to parameterize the view such that I will only get records where that field is empty. My registered parameter variable is vp_processed. I have tried ?vp_processed=" " and ?vp_processed=NULL and ?vp_processed=.NULL. to no good effect
>>>
>>>Guidance much appreciated (and for future reference if one could tell me if the same solutions would apply against SQL data that would be a bonus)
>>>
>>>TIA
Daniel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform