Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Readwrite not read/writable at runtime.
Message
From
27/09/2005 11:01:44
 
 
To
26/09/2005 15:14:37
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01053089
Message ID:
01053442
Views:
11
Thank you Borislav! I haven't played with SQL select statements until now. I will try to use your example.

My problem, however, was that when I run the code in my development environment, everything works. The SQL cursor (a_tmpf) is read/writable. The SCAN works fine with the replace/with.

When the program is compiled onto the menu, the SQL cursor (a_tmpf) is read only. So it doesn't allow my SCAN ENDSCAN code to work?

I was thinking that there is some variable within the companies menu/compilation code that didn't read SQL-Select cursor building? I figgured if I could understand what variables control cursor building, I could force a readwrite cursor in the apps' code?


>Chad, You can do this whit one SELECT (I think)
>
>m.ldBeginDate = thisform.ldbdate
>m.ldEndDate   = thisform.ldedate
>
>SELECT (field list here w/o LastCdate), NVL(Table3.InvDte, MAX(NVL(Table4.InvDte,{})) AS LastCdate;
>        FROM Table1 ;
>        LEFT JOIN Table3 ON Table1.Customer + Table1.Ecustomer == Table3.Customer + Table3.Ecustomer;
>        LEFT JOIN Table4 ON Table1.Customer + Table1.Ecustomer == Table4.Customer + Table4.Ecustomer;
>	WHERE Table1.salesrep = thisform.lcsalesrep AND ;
>	BETWEEN(Table1.quotedate, m.ldBeginDate, m.ldEndDate) AND ;
>	EMPTY(current) AND EMPTY(status) ;
>	ORDER BY customer, ecustomer ;
>        GROUP BY (full field list here w/o LastCDate) ;
>	INTO CURSOR a_tmpf READWRITE
>
>
>(not tested I only think that this should work)
>
>About your problem, You SKIP Table 1 twice first in SCAN ENDSCAN loop and second in DO WHILE loop, maybe you want to DO WHILE in Table4 to get the latest date, but current area is Tabel1 thats why you DO WHILing in it and mey in REPLACE you at the EOF() state of table and can't perform the replace.
>
>
>
>>Hello all,
>>
>>I am having a problem at runtime. The following code works well from a development environment. But, when I put the application into the runtime menu, the cursor becomes read only.
>>
>>SELECT * from Table1 ;
>> WHERE Table1.salesrep = thisform.lcsalesrep AND ;
>> BETWEEN(Table1.quotedate, thisform.ldbdate, thisform.ldedate) AND ;
>> EMPTY(current) AND EMPTY(status) ;
>> ORDER BY customer, ecustomer ;
>> INTO CURSOR a_tmpf readwrite
>>
>>
>>I then need to scan through the cursor. I do so with the following code:
>>
>>*-- Establish relation between tmpf cursor and Table2 for reporting
>>SELECT a_tmpf
>>SET RELATION TO ecustomer INTO Table2
>>
>>
>>*-- Locate last rebate
>>GOTO top
>>SCAN
>> IF SEEK(customer + ecustomer, "Table3","invno2")
>> replace a_tmpf.lastcdate WITH Table3.invdte
>> ENDIF
>> IF EMPTY(a_tmpf.lastcdate)
>> *-- set date insertion variable
>> ldmaxdate = {}
>> IF SEEK(customer+ecustomer, "Table4","invno2")
>> DO WHILE a_tmpf.customer + a_tmpf.ecustomer = ;
>> Table4.customer + Table4.ecustomer And !EOF()
>> ldmaxdate = Table4.invdte
>> SKIP
>> ENDDO
>> ENDIF
>> replace a_tmpf.lastcdate WITH ldmaxdate
>> ENDIF
>>ENDSCAN
>>
>>
>>The problem is when the Scan begins. The cursor "a_tmpf" is read only and not updatable.
>>
>>What am I doing wrong? Any ideas?
Thanks,

Chad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform