Author: Brian Robichaud, jbr@bretech.com
Posted: 1999-08-31 09:59:35 Link
Hello folks,
I'm feeling particularly thick (dense, stupid.. whatever,) this morning...
can anybody tell me what I'm doing wrong?
USE IN myProjectSearch && <- I thought this closed the table/file.. but:
DELETE FILE 'c: empmyProjectSearch.dbf' && <- this raises a "file in use
error"
myProjectSearch is a free table that is created and populated on init of a
grid control then filtered based on set search criteria that may or may not
be filled in.
How do I properly close this temporary file so that I can delete it when I'm
done with this screen?
TIA
Brian
mailto:jbr@bretech.com
Author: Cindy Winegarden, cindyw@acpub.duke.edu
Posted: 1999-08-31 10:24:43 Link
Brian,
If MyProjectSearch is a temporary table and created, accessed, and deleted
within your app, why not use a cursor?
If you need to you can have an empty structure table kept around permanently
and create a cursor from it using
=AFIELDS(TempArray) and
CREATE CURSOR MyCursor FROM ARRAY Temparray
Since you are getting a file in use, do you have a private data session and
the file is in use somewhere else?
Cindy Winegarden
Duke Children's Information Systems
cindy.winegarden@duke.edu
-----Original Message-----
From: Brian Robichaud <jbr@bretech.com>
To: Multiple recipients of ProFox <profox@leafe.com>
Date: Tuesday, August 31, 1999 10:17
Subject: VFP6 -> delete a table... clarification?
|Hello folks,
|
|I'm feeling particularly thick (dense, stupid.. whatever,) this morning...
|can anybody tell me what I'm doing wrong?
|
|USE IN myProjectSearch && <- I thought this closed the table/file.. but:
|DELETE FILE 'c: empmyProjectSearch.dbf' && <- this raises a "file in use
|error"
|
|myProjectSearch is a free table that is created and populated on init of a
|grid control then filtered based on set search criteria that may or may not
|be filled in.
|How do I properly close this temporary file so that I can delete it when
I'm
|done with this screen?
|
|TIA
|
|Brian
|mailto:jbr@bretech.com
|
|
|
|
Author: Cliff Robinson, CliffR@EASDG.com
Posted: 1999-08-31 10:45:31 Link
This looks ok. Do you have two instances of the app running? Is this a
multi-user situation where another user might have the thing open?
Is there a reason you are using a dbf? Why not use a r/w cursor created
with CREATE CURSOR? If you must use a dbf for some reason, use unique
names created with SYS(2015) or something of your own making, but I
can't think of any reason why a cursor wouldn't suffice.
__________________________________
Cliff Robinson
EASDG
P.O.Box 1121
Carnation, Washington, USA 98014
(425)333-4339
Fax: (425)333-4914
CliffR@EASDG.com
===================================
VFP Code Examples at:
ftp://www.easdg.com/pub/vfpexamples
-----Original Message-----
From: Brian Robichaud [mailto:jbr@bretech.com]
Sent: Tuesday, August 31, 1999 7:00 AM
To: Multiple recipients of ProFox
Subject: VFP6 -> delete a table... clarification?
Hello folks,
I'm feeling particularly thick (dense, stupid.. whatever,) this
morning...
can anybody tell me what I'm doing wrong?
USE IN myProjectSearch && <- I thought this closed the table/file.. but:
DELETE FILE 'c: empmyProjectSearch.dbf' && <- this raises a "file in
use
error"
myProjectSearch is a free table that is created and populated on init of
a
grid control then filtered based on set search criteria that may or may
not
be filled in.
How do I properly close this temporary file so that I can delete it when
I'm
done with this screen?
TIA
Brian
mailto:jbr@bretech.com
Author: Brian Robichaud, jbr@bretech.com
Posted: 1999-08-31 11:17:19 Link
Thanks for the suggestion Cindy and Cliff.
On your advice, I read up on cursors (I'm still an utter newbie when it
comes to VFP & XBase in general, but I have to get the app built ;) ) and
you are right... they are the right tool for this job... my only problem is:
create cursor myProjectSearch ;
(mystatus c (1), myrep L, myjobdate D, myloc c (50), mydesc c (50))
INSERT INTO myProjectSearch (myStatus,myrep,myjobdate,myloc,mydesc) VALUES
('T',.F.,date(),'Here', ;
'Project Management Software Testing')
SELECT myProjectSearch
this.recordsource = myProjectSearch && <- this generates a "variable
MYPROJECTSEARCH is not found" error
If I comment out the recordsource line, the grid gets populated with values
from another table.
How do I let the recordsource know that it is an alias to a cursor?
Author: Cotton Jerry P, CottonJP@2mawcp.usmc.mil
Posted: 1999-08-31 11:38:13 Link
RecordSourceType = 1=Alias vice 0=Table?????
Just guessing.
Mr. Jerry Cotton, MCP
2nd Marine Aircraft Wing Aviation Budget Analyst
MCAS Cherry Point NC
(252)466-2320 (252)466-4806(FAX) (DSN=582)
mailto:cottonjp@2mawcp.usmc.mil
>-----Original Message-----
>From: Brian Robichaud [mailto:jbr@bretech.com]
>Sent: Tuesday, August 31, 1999 11:17 AM
>To: Multiple recipients of ProFox
>Subject: RE: VFP6 -> delete a table... clarification?
>
>
>Thanks for the suggestion Cindy and Cliff.
>
>On your advice, I read up on cursors (I'm still an utter newbie when it
>comes to VFP & XBase in general, but I have to get the app
>built ;) ) and
>you are right... they are the right tool for this job... my
>only problem is:
>
>create cursor myProjectSearch ;
> (mystatus c (1), myrep L, myjobdate D,
>myloc c (50), mydesc c (50))
>
>INSERT INTO myProjectSearch
>(myStatus,myrep,myjobdate,myloc,mydesc) VALUES
>('T',.F.,date(),'Here', ;
> 'Project Management Software Testing')
> SELECT myProjectSearch
>
>this.recordsource = myProjectSearch && <- this generates a "variable
>MYPROJECTSEARCH is not found" error
>
>If I comment out the recordsource line, the grid gets
>populated with values
>from another table.
>
>How do I let the recordsource know that it is an alias to a cursor?
>
>
>
Author: Stuart Dunkeld, Stuart.Dunkeld@eastsussexcc.gov.uk
Posted: 1999-08-31 11:45:52 Link
this.recordsource = "myProjectSearch"
hth?
stuart
> -----Original Message-----
> From: Brian Robichaud [mailto:jbr@bretech.com]
> Sent: 31 August 1999 16:17
> To: Multiple recipients of ProFox
> Subject: RE: VFP6 -> delete a table... clarification?
>
>
> Thanks for the suggestion Cindy and Cliff.
>
> On your advice, I read up on cursors (I'm still an utter
> newbie when it
> comes to VFP & XBase in general, but I have to get the app
> built ;) ) and
> you are right... they are the right tool for this job... my
> only problem is:
>
> create cursor myProjectSearch ;
> (mystatus c (1), myrep L, myjobdate D,
> myloc c (50), mydesc c (50))
>
> INSERT INTO myProjectSearch
> (myStatus,myrep,myjobdate,myloc,mydesc) VALUES
> ('T',.F.,date(),'Here', ;
> 'Project Management Software Testing')
> SELECT myProjectSearch
>
> this.recordsource = myProjectSearch && <- this generates a "variable
> MYPROJECTSEARCH is not found" error
>
> If I comment out the recordsource line, the grid gets
> populated with values
> from another table.
>
> How do I let the recordsource know that it is an alias to a cursor?
>
>
>
Author: Brian Robichaud, jbr@bretech.com
Posted: 1999-08-31 11:50:47 Link
It did! Thanks Stuart.
I had tried it with single ' and it didn't work ('myProjectSearch'), but it
does with "myProjectSearch". I'm baffled, but it works.
Brian.
-----Original Message-----
From: profox@leafe.com [mailto:profox@leafe.com]On Behalf Of Stuart
Dunkeld
Sent: Tuesday, August 31, 1999 12:48 PM
To: Multiple recipients of ProFox
Subject: RE: VFP6 -> delete a table... clarification?
this.recordsource = "myProjectSearch"
hth?
stuart
Author: Allan Lindgren, allan_lindgren@starkey.com
Posted: 1999-08-31 11:56:48 Link
Brian
a Cursor is created in memory only so to refrence any cusror call on the
dbf() function
example
this.recordsource = dbf('myProjectSearch')
if you were to look at the dbf() return value, Fox crates a temporay
table in the temp dir (as default or specified with set temp) with a sys
generated name that will be different each time a cursor is created
create curs mycurs(fld1 c(12))
?dbf('mycurs') yeilds C:WINDOWSTEMPW5C3006I.TMP
HTH
Allan
allan_lindgren@starkey.com
Brian Robichaud wrote:
>
> Thanks for the suggestion Cindy and Cliff.
>
> On your advice, I read up on cursors (I'm still an utter newbie when it
> comes to VFP & XBase in general, but I have to get the app built ;) ) and
> you are right... they are the right tool for this job... my only problem is:
>
> create cursor myProjectSearch ;
> (mystatus c (1), myrep L, myjobdate D, myloc c (50), mydesc c (50))
>
> INSERT INTO myProjectSearch (myStatus,myrep,myjobdate,myloc,mydesc) VALUES
> ('T',.F.,date(),'Here', ;
> 'Project Management Software Testing')
> SELECT myProjectSearch
>
> this.recordsource = myProjectSearch && <- this generates a "variable
[snip]
--
If you offer me a penny for my thoughts,
and I give you my two cents worth,
Who gets the change?
Author: Ed Leafe, ed@leafe.com
Posted: 1999-08-31 12:06:57 Link
On 8/31/99 11:56 AM, Allan Lindgren supposedly said:
>a Cursor is created in memory only so to refrence any cusror call on the
>dbf() function
That's not necessary, unless you need to do file I/O. Cursors were
designed to be referenced by their aliases.
___/
/
__/
/
____/
Ed Leafe
http://buzz.builder.com/cgi-bin/WebX?13@@.ee83e66
David L. Crooks
Senior Programmer/Web Developer
Information Spectrum, Inc.
703-813-8344
mailto: croodl@ispec.com