Re: Is this possible?

Tech-Archive recommends: Fix windows errors by optimizing your registry



It occurs to me that I have not performed an obvious test.

Given the current condition of the program (doing an Open/Use
Exclusive/Pack/Close connection.) what I can and have done is run the pack
routine and then (while the app is still running) try to open one of the
involved dbf tables in Exclusive mode using the FoxPro 6 IDE.

I have tried this on both my local machine (where the routine works
correctly) and the web server (where it crashes). In both cases I am able to
open the table in exclusive mode through the IDE so it looks like the tables
are being closed.



"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.)









.


Quantcast