Re: Is this possible?



USE IN TableName

is the "specifically FoxPro command" for closing TableName, regardless of which work area it's in.

- Rush

B. Chernick wrote:
I do an Open, Use TableName, a Pack TableName, and then a Close in the Finally clause (so it always gets called).

(I don't recognize this 'Use In' you refer to. What is that?)

It occurs to me that the Close I am referring to is the Close of the OleDB connection object . Are you saying that I need some other specifically FoxPro command to close the table before I close the connection?

"swdev2" wrote:

A pack takes exclusive control of a table.
If you don't CLOSE the table after packing it, ie - you still have it open,
then NO ONE ELSE can get to it for any 'exclusive' file i/o.

I'd check that you're actually CLOSING the file after the pack.
"PACK Tablename", right ?
then
"Use in (Tablename) "

It's not enough just to destroy the data connector by 'exiting' the
program - it will hang around in the server memory after it was 'destroyed'
for a bit.

HTH !
Mondo Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQL
www.efgroup.net/vfpwebhosting
www.terrafox.net www.viasqlserver.net

"B. Chernick" <BChernick@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AA92E00B-91D1-49FF-8B69-4B1E1414E24D@xxxxxxxxxxxxxxxx
I may have spoken too soon. The program works fine on my local machine.
If
I run it on our web server, it crashes with the message: 'Command contains
unrecognized phrase/keyword.'

This may be premature. I'm told that the users on that server are now
having permission problems, unable to read/write to the tables through
this
app, or something like that, and I'm going to wait for that to be fixed.
But
could this cause a problem like that?

Or is this a more likely possibility?:
http://support.microsoft.com/kb/932201
"Anders Altberg" wrote:

dcc.CommandText = "PACK Tablename"

-Anders

"B. Chernick" <BChernick@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DD5D2842-752F-4845-B048-0CF60EA3A0F5@xxxxxxxxxxxxxxxx
We have a temporary Dot Net 2.0 web app that connects to some FoxPro 6
DBF
tables. I've been asked to enhance it. All I am trying to do is put
a
button on the main page to run a Pack command. So far no luck. I
admit
that
I have not done much with direct ado.net connections lately. This is
basically the code.

Dim dc As New OleDb.OleDbConnection(<same connection string used in
the
rest of the app>)
dc.Open()
Dim dcc As New OleDb.OleDbCommand("Use <Filename.dbf> Exclusive", dc)
dcc.ExecuteNonQuery
dcc.CommandText = "Pack"
dcc.ExecuteNonQuery

It only crashes on the Pack call, with an error of "No table is open
in
the
current work area."

(Incidentally, the first ExecuteNonQuery command is returning the
number
of
rows in the target FoxPro table so I would assume that command did run
successfully.)





.