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

Re: Is this possible? by Anders

Anders
Tue Apr 22 16:18:28 CDT 2008

dcc.CommandText = "PACK Tablename"

-Anders

"B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
news:DD5D2842-752F-4845-B048-0CF60EA3A0F5@microsoft.com...
> 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.)
>
>
>



Re: Is this possible? by BChernick

BChernick
Wed Apr 23 10:02:02 CDT 2008

Thanks! That did it. (Not quite the same as using the FoxPro 6 IDE.)

"Anders Altberg" wrote:

> dcc.CommandText = "PACK Tablename"
>
> -Anders
>
> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> news:DD5D2842-752F-4845-B048-0CF60EA3A0F5@microsoft.com...
> > 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.)
> >
> >
> >
>
>
>

Re: Is this possible? by BChernick

BChernick
Thu Apr 24 12:39:10 CDT 2008

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@discussions.microsoft.com> wrote in message
> news:DD5D2842-752F-4845-B048-0CF60EA3A0F5@microsoft.com...
> > 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.)
> >
> >
> >
>
>
>

Re: Is this possible? by swdev2

swdev2
Thu Apr 24 17:53:40 CDT 2008

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@discussions.microsoft.com> wrote in message
news:AA92E00B-91D1-49FF-8B69-4B1E1414E24D@microsoft.com...
> 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@discussions.microsoft.com> wrote in message
> > news:DD5D2842-752F-4845-B048-0CF60EA3A0F5@microsoft.com...
> > > 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.)
> > >
> > >
> > >
> >
> >
> >



Re: Is this possible? by Anders

Anders
Thu Apr 24 19:33:48 CDT 2008

The latest version is 9.0.0.5815; it should have the hotfix which was
version 9.0.0.4915.
http://www.microsoft.com/downloads/details.aspx?familyid=e1a87d8f-2d58-491f-a0fa-95a3289c5fd4&displaylang=en

-Anders

"B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
news:AA92E00B-91D1-49FF-8B69-4B1E1414E24D@microsoft.com...
>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@discussions.microsoft.com> wrote in message
>> news:DD5D2842-752F-4845-B048-0CF60EA3A0F5@microsoft.com...
>> > 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.)
>> >
>> >
>> >
>>
>>
>>



Re: Is this possible? by BChernick

BChernick
Fri Apr 25 07:20:01 CDT 2008

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@discussions.microsoft.com> wrote in message
> news:AA92E00B-91D1-49FF-8B69-4B1E1414E24D@microsoft.com...
> > 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@discussions.microsoft.com> wrote in message
> > > news:DD5D2842-752F-4845-B048-0CF60EA3A0F5@microsoft.com...
> > > > 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.)
> > > >
> > > >
> > > >
> > >
> > >
> > >
>
>
>

Re: Is this possible? by BChernick

BChernick
Fri Apr 25 08:52:02 CDT 2008

I've just upgraded the OleDB driver on the server to the latest but the
problem persists.

I have also tried issuing a close command for individual tables but I have
yet to find any syntax that works. (The program on the server is still doing
an Open/Use/Pack/Close.)

"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@discussions.microsoft.com> wrote in message
> news:AA92E00B-91D1-49FF-8B69-4B1E1414E24D@microsoft.com...
> > 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@discussions.microsoft.com> wrote in message
> > > news:DD5D2842-752F-4845-B048-0CF60EA3A0F5@microsoft.com...
> > > > 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.)
> > > >
> > > >
> > > >
> > >
> > >
> > >
>
>
>

Re: Is this possible? by Rush

Rush
Fri Apr 25 09:10:57 CDT 2008

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@discussions.microsoft.com> wrote in message
>> news:AA92E00B-91D1-49FF-8B69-4B1E1414E24D@microsoft.com...
>>
>>> 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@discussions.microsoft.com> wrote in message
>>>> news:DD5D2842-752F-4845-B048-0CF60EA3A0F5@microsoft.com...
>>>>
>>>>> 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.)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>
>>

Re: Is this possible? by BChernick

BChernick
Fri Apr 25 09:11:00 CDT 2008

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@discussions.microsoft.com> wrote in message
> news:AA92E00B-91D1-49FF-8B69-4B1E1414E24D@microsoft.com...
> > 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@discussions.microsoft.com> wrote in message
> > > news:DD5D2842-752F-4845-B048-0CF60EA3A0F5@microsoft.com...
> > > > 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.)
> > > >
> > > >
> > > >
> > >
> > >
> > >
>
>
>

Re: Is this possible? by BChernick

BChernick
Fri Apr 25 09:45:01 CDT 2008

I'm sorry but you've completely lost me. 'Use In' is a close command?

(I'm also currently looking at FoxPro 6's help and that doesn't help much
either. If I may quote: 'Specifies the work area in which the table is
opened. You can close a table in a specific work area by issuing USE with the
IN clause and the work area number.' I really don't understand what this
is saying.)

"Rush Strong" wrote:

> 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@discussions.microsoft.com> wrote in message
> >> news:AA92E00B-91D1-49FF-8B69-4B1E1414E24D@microsoft.com...
> >>
> >>> 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@discussions.microsoft.com> wrote in message
> >>>> news:DD5D2842-752F-4845-B048-0CF60EA3A0F5@microsoft.com...
> >>>>
> >>>>> 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.)
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>
> >>
>

Re: Is this possible? by Rush

Rush
Fri Apr 25 10:37:24 CDT 2008

FoxPro opens each table in a separate "work area." Each Work Area is
numbered. Only one work area is 'current;' commands affect the table in
the current area by default - but other areas can be specified.
Consider the following:

SELECT 1
USE FirstTable.dbf

SELECT 2
USE SecondTable

SELECT 3
USE MyForm.scx

USE OneMoreTable IN 4 ALIAS LastTable

FirstTable.dbf is open in WA (work area) 1. [Specifying the '.dbf' in
the table name is optional, if the table is named with the default 'dbf'
extension.]

SecondTable is open in WA2. The 'dbf' extension was left off, as is
typically the case.

WA3 is a bit different. MyForm.scx is a table which describes a form.
It is identical (in structure) to a .dbf table, only the extension has
been changed. Because it is a non-default extension, the 'scx' must be
specified.

The final command opens OneMoreTable in WA4, but does NOT select that
area - we're still in WA3. This shows the basic IN syntax - it allows
commands to affect a non-current WA. We've also added the ALIAS clause,
which effectively renames 'OneMoreTable' to 'LastTable.' (This only
affects code references - the actual file name, OneMoreTable.dbf, is
unchanged.)

Issuing a USE command without a table name will close any table in the
current area. The USE command can also be qualified with the IN
clause. Thus,

SELECT 1
USE

will close FirstTable, leaving us in an empty WA.

USE IN 2

will close SecondTable. We're still in WA1; both WA1 and WA2 are empty.

Back in the old days, we had to keep track of which table was open in
which WA number. This was simplified by the use of ALIASes. Each table
is assigned an alias, which defaults to the file name (without
extension). Thus, we could have closed the above tables by:

SELECT FirstTable
USE

USE IN SecondTable

[While Fox still supports the use of WA numbers, it is obviously much
clearer to use aliases.]

We can now close the last two tables:

USE IN C
USE IN LastTable

Huh? Where did the 'C' come from? Well, believe it or not, their is a
third way to reference work areas - the first half a dozen are also
lettered A through F. This is a holdover from the early days, when we
only had 6 areas to work with. That limit has gone up a couple of times,
to (IIRC) 64K currently. USE IN C is the same as USE IN 3 which (in
this case) is the same as USE IN MyForm (the alias of 'MyForm.scx').

And so to answer your question: USE IN [Alias|WA number|WA letter]
closes a single table in the specified work area.

Hope it helps...

- Rush

B. Chernick wrote:
> I'm sorry but you've completely lost me. 'Use In' is a close command?
>
> (I'm also currently looking at FoxPro 6's help and that doesn't help much
> either. If I may quote: 'Specifies the work area in which the table is
> opened. You can close a table in a specific work area by issuing USE with the
> IN clause and the work area number.' I really don't understand what this
> is saying.)
>
> "Rush Strong" wrote:
>
>
>> 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@discussions.microsoft.com> wrote in message
>>>> news:AA92E00B-91D1-49FF-8B69-4B1E1414E24D@microsoft.com...
>>>>
>>>>
>>>>> 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@discussions.microsoft.com> wrote in message
>>>>>> news:DD5D2842-752F-4845-B048-0CF60EA3A0F5@microsoft.com...
>>>>>>
>>>>>>
>>>>>>> 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.)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>

Re: Is this possible? by Stefan

Stefan
Fri Apr 25 10:30:38 CDT 2008


"B. Chernick" <BChernick@discussions.microsoft.com> schrieb im Newsbeitrag
news:C0F21B26-98BD-46A1-9173-4E023B8B0C92@microsoft.com...
> I'm sorry but you've completely lost me. 'Use In' is a close command?
>
> (I'm also currently looking at FoxPro 6's help and that doesn't help much
> either. If I may quote: 'Specifies the work area in which the table is
> opened. You can close a table in a specific work area by issuing USE with the
> IN clause and the work area number.' I really don't understand what this
> is saying.)

That's confusing because USE is Close and Open at the same time
USE theTable.DBF && opens an table in the current workarea
USE && closes an alias in the current workarea, if there is one
USE theTable IN 0 && opens table in the next unused WE
USE IN <workarea> && closes the alias in <workarea>
&& where <workarea> can be specified as a number or as an alias name.

So, if for example you are not sure if an alias is open but want
to close it anyway, you can:
USE IN Select("aliasMayExistOrNot")



hth
-Stefan




--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------



Re: Is this possible? by swdev2

swdev2
Fri Apr 25 13:08:25 CDT 2008

OK - so if it's working in the production setting,
then there's something else going on.

A Pack is taking care of deleted records and auto reindexes the file.
If you have any tables with 'parent-child' relationships for your users,
it may be you've deleted parent records where CHILD records still exist,
and it MAY BE that your users are experiencing some other errors because of
this.
(Na, never mind the CHILD records in CHILD tables, I've reread your 2nd
post, you've not mentioned that problem)

I'm sorry, I hate to be grasping at straws here, but.
to me it makes more sense to have some VFP-written COM pgm on the server,
and issue any maintenance commands through it, cause that VFP-written COM
pgm
will have 'native file access' to any dbf files, without having to worry
about other connector types
with other permissions problems.

Also, the 'rights to the file(s)' get inherited and reset during a pack on a
server, so if you have a TEST server floating around,
you can see how it gets changed when you study the attrib command output in
a cmd window. For example, group rights might get knocked out (emphasis on
'might') when you're doing yer pack.

I know you say this is just a one-off, but you might wanna study another
vfp-centric framework for webapps,
like Active VFP Pages over at http://www.codeplex.com/activevfp

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

"B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
news:AAE52630-6008-4EE6-8B28-A415ECC676AD@microsoft.com...
> 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@discussions.microsoft.com> wrote in message
> > news:AA92E00B-91D1-49FF-8B69-4B1E1414E24D@microsoft.com...
> > > 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@discussions.microsoft.com> wrote in message
> > > > news:DD5D2842-752F-4845-B048-0CF60EA3A0F5@microsoft.com...
> > > > > 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.)
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> >
> >
> >



Re: Is this possible? by BChernick

BChernick
Fri Apr 25 12:38:00 CDT 2008

Thanks to both you and S. Wuebbe for the interesting background material but
I'm wondering if this might be overkill. (Since I'm never dealing with more
than one table at a time.)

As of right now both my local machine and the server now have the latest
version OleDB driver and nothing's changed. It runs fine on mine and fails
on the server. (Only the Pack command. Everything else runs normally.) The
same error: Command contains unrecognized phrase/keyword.

It occured to me that, given the nature of connections from Web apps, I
should try combining the Use Exclusive and Pack commands into one
string/ExecuteNonQuery.

So I did this:
Dim dcc As New OleDb.OleDbCommand("Use <path>.<filename>.dbf
Exclusive;Pack TableName", dc)

and got the same results, runs fine on my machine, crashes on the server
with the same error: "Command contains unrecognized phrase/keyword."

"Rush Strong" wrote:

> FoxPro opens each table in a separate "work area." Each Work Area is
> numbered. Only one work area is 'current;' commands affect the table in
> the current area by default - but other areas can be specified.
> Consider the following:
>
> SELECT 1
> USE FirstTable.dbf
>
> SELECT 2
> USE SecondTable
>
> SELECT 3
> USE MyForm.scx
>
> USE OneMoreTable IN 4 ALIAS LastTable
>
> FirstTable.dbf is open in WA (work area) 1. [Specifying the '.dbf' in
> the table name is optional, if the table is named with the default 'dbf'
> extension.]
>
> SecondTable is open in WA2. The 'dbf' extension was left off, as is
> typically the case.
>
> WA3 is a bit different. MyForm.scx is a table which describes a form.
> It is identical (in structure) to a .dbf table, only the extension has
> been changed. Because it is a non-default extension, the 'scx' must be
> specified.
>
> The final command opens OneMoreTable in WA4, but does NOT select that
> area - we're still in WA3. This shows the basic IN syntax - it allows
> commands to affect a non-current WA. We've also added the ALIAS clause,
> which effectively renames 'OneMoreTable' to 'LastTable.' (This only
> affects code references - the actual file name, OneMoreTable.dbf, is
> unchanged.)
>
> Issuing a USE command without a table name will close any table in the
> current area. The USE command can also be qualified with the IN
> clause. Thus,
>
> SELECT 1
> USE
>
> will close FirstTable, leaving us in an empty WA.
>
> USE IN 2
>
> will close SecondTable. We're still in WA1; both WA1 and WA2 are empty.
>
> Back in the old days, we had to keep track of which table was open in
> which WA number. This was simplified by the use of ALIASes. Each table
> is assigned an alias, which defaults to the file name (without
> extension). Thus, we could have closed the above tables by:
>
> SELECT FirstTable
> USE
>
> USE IN SecondTable
>
> [While Fox still supports the use of WA numbers, it is obviously much
> clearer to use aliases.]
>
> We can now close the last two tables:
>
> USE IN C
> USE IN LastTable
>
> Huh? Where did the 'C' come from? Well, believe it or not, their is a
> third way to reference work areas - the first half a dozen are also
> lettered A through F. This is a holdover from the early days, when we
> only had 6 areas to work with. That limit has gone up a couple of times,
> to (IIRC) 64K currently. USE IN C is the same as USE IN 3 which (in
> this case) is the same as USE IN MyForm (the alias of 'MyForm.scx').
>
> And so to answer your question: USE IN [Alias|WA number|WA letter]
> closes a single table in the specified work area.
>
> Hope it helps...
>
> - Rush
>
> B. Chernick wrote:
> > I'm sorry but you've completely lost me. 'Use In' is a close command?
> >
> > (I'm also currently looking at FoxPro 6's help and that doesn't help much
> > either. If I may quote: 'Specifies the work area in which the table is
> > opened. You can close a table in a specific work area by issuing USE with the
> > IN clause and the work area number.' I really don't understand what this
> > is saying.)
> >
> > "Rush Strong" wrote:
> >
> >
> >> 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@discussions.microsoft.com> wrote in message
> >>>> news:AA92E00B-91D1-49FF-8B69-4B1E1414E24D@microsoft.com...
> >>>>
> >>>>
> >>>>> 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@discussions.microsoft.com> wrote in message
> >>>>>> news:DD5D2842-752F-4845-B048-0CF60EA3A0F5@microsoft.com...
> >>>>>>
> >>>>>>
> >>>>>>> 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" <