I'm trying to write a quickie Winforms utility (VB, 2.0) that will pack some
FoxPro 6 dbf tables. Unfortunately the same connection strings that worked
with my web app don't seem to work in Winforms. It's crashing on open with a
'Feature is not available' message. (And yes I've already checked
ConnectionStrings.com)

I've tried a connection string of both:
"Provider=VFPOLEDB.1;" + <file path> + ";Collating Sequence=General"
(This is what I've been using in my web apps.)
and

"Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
Driver};SourceType=DBF;" + <file path> +
";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"

(got that one from ConnectionStrings.com)

What am I missing?

(Is there some reference I'm forgetting? Something extra needed in Winforms
but not web apps???)

Re: Feature is not available? by Paul

Paul
Thu May 08 19:54:53 CDT 2008

What is the line that's causing the error?


"B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
news:14E43ECC-8BEB-4B8D-8AA4-21C23A550614@microsoft.com...
> I'm trying to write a quickie Winforms utility (VB, 2.0) that will pack
> some
> FoxPro 6 dbf tables. Unfortunately the same connection strings that
> worked
> with my web app don't seem to work in Winforms. It's crashing on open
> with a
> 'Feature is not available' message. (And yes I've already checked
> ConnectionStrings.com)
>
> I've tried a connection string of both:
> "Provider=VFPOLEDB.1;" + <file path> + ";Collating Sequence=General"
> (This is what I've been using in my web apps.)
> and
>
> "Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
> Driver};SourceType=DBF;" + <file path> +
> ";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"
>
> (got that one from ConnectionStrings.com)
>
> What am I missing?
>
> (Is there some reference I'm forgetting? Something extra needed in
> Winforms
> but not web apps???)



Re: Feature is not available? by BChernick

BChernick
Fri May 09 07:38:00 CDT 2008

On dc.open. Here's the actual code. sConnStr is the connection string
described earlier.

Dim dc As New OleDb.OleDbConnection(sConnStr)
Try
dc.Open()
Catch ex As Exception
MsgBox("Open Fails, error = " + ex.Message)
Exit Sub
End Try

"Paul Pedersen" wrote:

> What is the line that's causing the error?
>
>
> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> news:14E43ECC-8BEB-4B8D-8AA4-21C23A550614@microsoft.com...
> > I'm trying to write a quickie Winforms utility (VB, 2.0) that will pack
> > some
> > FoxPro 6 dbf tables. Unfortunately the same connection strings that
> > worked
> > with my web app don't seem to work in Winforms. It's crashing on open
> > with a
> > 'Feature is not available' message. (And yes I've already checked
> > ConnectionStrings.com)
> >
> > I've tried a connection string of both:
> > "Provider=VFPOLEDB.1;" + <file path> + ";Collating Sequence=General"
> > (This is what I've been using in my web apps.)
> > and
> >
> > "Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
> > Driver};SourceType=DBF;" + <file path> +
> > ";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"
> >
> > (got that one from ConnectionStrings.com)
> >
> > What am I missing?
> >
> > (Is there some reference I'm forgetting? Something extra needed in
> > Winforms
> > but not web apps???)
>
>
>

Re: Feature is not available? by Paul

Paul
Fri May 09 13:07:33 CDT 2008

Typically that message will appear if you try to do something that's not
allowed in the runtime version (i.e., FoxPro is not installed on the
machine). Older Foxpro's like 6 were more picky about that than 9.

Is it possibly due to some code in the database? I forget what all the
forbidden features are/were, but some are: DEBUG, COMPILE, SET STEP ON,
things like that. If there are such commands in the db procedures that
automatically run on open, you might get that message.





"B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
news:D563964D-7253-4834-B6BC-0022A3DB154D@microsoft.com...
> On dc.open. Here's the actual code. sConnStr is the connection string
> described earlier.
>
> Dim dc As New OleDb.OleDbConnection(sConnStr)
> Try
> dc.Open()
> Catch ex As Exception
> MsgBox("Open Fails, error = " + ex.Message)
> Exit Sub
> End Try
>
> "Paul Pedersen" wrote:
>
>> What is the line that's causing the error?
>>
>>
>> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
>> news:14E43ECC-8BEB-4B8D-8AA4-21C23A550614@microsoft.com...
>> > I'm trying to write a quickie Winforms utility (VB, 2.0) that will pack
>> > some
>> > FoxPro 6 dbf tables. Unfortunately the same connection strings that
>> > worked
>> > with my web app don't seem to work in Winforms. It's crashing on open
>> > with a
>> > 'Feature is not available' message. (And yes I've already checked
>> > ConnectionStrings.com)
>> >
>> > I've tried a connection string of both:
>> > "Provider=VFPOLEDB.1;" + <file path> + ";Collating Sequence=General"
>> > (This is what I've been using in my web apps.)
>> > and
>> >
>> > "Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
>> > Driver};SourceType=DBF;" + <file path> +
>> > ";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"
>> >
>> > (got that one from ConnectionStrings.com)
>> >
>> > What am I missing?
>> >
>> > (Is there some reference I'm forgetting? Something extra needed in
>> > Winforms
>> > but not web apps???)
>>
>>
>>



Re: Feature is not available? by BChernick

BChernick
Fri May 09 13:35:01 CDT 2008

Sorry but I'm not following you. I do have FoxPro 6 installed but that
shouldn't matter one way or the other if I'm simply using the oledb driver to
access a table. And as I mentioned earlier, I am using the same connection
string as the web app.

As for 'code in the database', I'm dealing with FoxPro 6 free tables, DBFs.
I don't think that applies.

Also I've checked and all users of this computer have complete access to and
control of the directory where the tables are located.

"Paul Pedersen" wrote:

> Typically that message will appear if you try to do something that's not
> allowed in the runtime version (i.e., FoxPro is not installed on the
> machine). Older Foxpro's like 6 were more picky about that than 9.
>
> Is it possibly due to some code in the database? I forget what all the
> forbidden features are/were, but some are: DEBUG, COMPILE, SET STEP ON,
> things like that. If there are such commands in the db procedures that
> automatically run on open, you might get that message.
>
>
>
>
>
> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> news:D563964D-7253-4834-B6BC-0022A3DB154D@microsoft.com...
> > On dc.open. Here's the actual code. sConnStr is the connection string
> > described earlier.
> >
> > Dim dc As New OleDb.OleDbConnection(sConnStr)
> > Try
> > dc.Open()
> > Catch ex As Exception
> > MsgBox("Open Fails, error = " + ex.Message)
> > Exit Sub
> > End Try
> >
> > "Paul Pedersen" wrote:
> >
> >> What is the line that's causing the error?
> >>
> >>
> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> >> news:14E43ECC-8BEB-4B8D-8AA4-21C23A550614@microsoft.com...
> >> > I'm trying to write a quickie Winforms utility (VB, 2.0) that will pack
> >> > some
> >> > FoxPro 6 dbf tables. Unfortunately the same connection strings that
> >> > worked
> >> > with my web app don't seem to work in Winforms. It's crashing on open
> >> > with a
> >> > 'Feature is not available' message. (And yes I've already checked
> >> > ConnectionStrings.com)
> >> >
> >> > I've tried a connection string of both:
> >> > "Provider=VFPOLEDB.1;" + <file path> + ";Collating Sequence=General"
> >> > (This is what I've been using in my web apps.)
> >> > and
> >> >
> >> > "Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
> >> > Driver};SourceType=DBF;" + <file path> +
> >> > ";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"
> >> >
> >> > (got that one from ConnectionStrings.com)
> >> >
> >> > What am I missing?
> >> >
> >> > (Is there some reference I'm forgetting? Something extra needed in
> >> > Winforms
> >> > but not web apps???)
> >>
> >>
> >>
>
>
>

Re: Feature is not available? by BChernick

BChernick
Fri May 09 15:07:00 CDT 2008


A massive apology. I found the immediate problem. I left out the phrase
'Data Source='. Now the Open works.

Still can't quite get the pack command to work. More later.

"Paul Pedersen" wrote:

> Typically that message will appear if you try to do something that's not
> allowed in the runtime version (i.e., FoxPro is not installed on the
> machine). Older Foxpro's like 6 were more picky about that than 9.
>
> Is it possibly due to some code in the database? I forget what all the
> forbidden features are/were, but some are: DEBUG, COMPILE, SET STEP ON,
> things like that. If there are such commands in the db procedures that
> automatically run on open, you might get that message.
>
>
>
>
>
> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> news:D563964D-7253-4834-B6BC-0022A3DB154D@microsoft.com...
> > On dc.open. Here's the actual code. sConnStr is the connection string
> > described earlier.
> >
> > Dim dc As New OleDb.OleDbConnection(sConnStr)
> > Try
> > dc.Open()
> > Catch ex As Exception
> > MsgBox("Open Fails, error = " + ex.Message)
> > Exit Sub
> > End Try
> >
> > "Paul Pedersen" wrote:
> >
> >> What is the line that's causing the error?
> >>
> >>
> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> >> news:14E43ECC-8BEB-4B8D-8AA4-21C23A550614@microsoft.com...
> >> > I'm trying to write a quickie Winforms utility (VB, 2.0) that will pack
> >> > some
> >> > FoxPro 6 dbf tables. Unfortunately the same connection strings that
> >> > worked
> >> > with my web app don't seem to work in Winforms. It's crashing on open
> >> > with a
> >> > 'Feature is not available' message. (And yes I've already checked
> >> > ConnectionStrings.com)
> >> >
> >> > I've tried a connection string of both:
> >> > "Provider=VFPOLEDB.1;" + <file path> + ";Collating Sequence=General"
> >> > (This is what I've been using in my web apps.)
> >> > and
> >> >
> >> > "Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
> >> > Driver};SourceType=DBF;" + <file path> +
> >> > ";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"
> >> >
> >> > (got that one from ConnectionStrings.com)
> >> >
> >> > What am I missing?
> >> >
> >> > (Is there some reference I'm forgetting? Something extra needed in
> >> > Winforms
> >> > but not web apps???)
> >>
> >>
> >>
>
>
>

Re: Feature is not available? by Fred

Fred
Fri May 09 15:18:34 CDT 2008

You need to use "PACK tablename" not just the "PACK" command like when
you're in VFP.

--
Fred
Microsoft Visual FoxPro MVP


"B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
news:F13730C8-BBC2-420E-82D4-FA30333E35E7@microsoft.com...
>
> A massive apology. I found the immediate problem. I left out the phrase
> 'Data Source='. Now the Open works.
>
> Still can't quite get the pack command to work. More later.
>
> "Paul Pedersen" wrote:
>
>> Typically that message will appear if you try to do something that's not
>> allowed in the runtime version (i.e., FoxPro is not installed on the
>> machine). Older Foxpro's like 6 were more picky about that than 9.
>>
>> Is it possibly due to some code in the database? I forget what all the
>> forbidden features are/were, but some are: DEBUG, COMPILE, SET STEP ON,
>> things like that. If there are such commands in the db procedures that
>> automatically run on open, you might get that message.
>>
>>
>>
>>
>>
>> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
>> news:D563964D-7253-4834-B6BC-0022A3DB154D@microsoft.com...
>> > On dc.open. Here's the actual code. sConnStr is the connection string
>> > described earlier.
>> >
>> > Dim dc As New OleDb.OleDbConnection(sConnStr)
>> > Try
>> > dc.Open()
>> > Catch ex As Exception
>> > MsgBox("Open Fails, error = " + ex.Message)
>> > Exit Sub
>> > End Try
>> >
>> > "Paul Pedersen" wrote:
>> >
>> >> What is the line that's causing the error?
>> >>
>> >>
>> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
>> >> news:14E43ECC-8BEB-4B8D-8AA4-21C23A550614@microsoft.com...
>> >> > I'm trying to write a quickie Winforms utility (VB, 2.0) that will
>> >> > pack
>> >> > some
>> >> > FoxPro 6 dbf tables. Unfortunately the same connection strings that
>> >> > worked
>> >> > with my web app don't seem to work in Winforms. It's crashing on
>> >> > open
>> >> > with a
>> >> > 'Feature is not available' message. (And yes I've already checked
>> >> > ConnectionStrings.com)
>> >> >
>> >> > I've tried a connection string of both:
>> >> > "Provider=VFPOLEDB.1;" + <file path> + ";Collating Sequence=General"
>> >> > (This is what I've been using in my web apps.)
>> >> > and
>> >> >
>> >> > "Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
>> >> > Driver};SourceType=DBF;" + <file path> +
>> >> > ";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"
>> >> >
>> >> > (got that one from ConnectionStrings.com)
>> >> >
>> >> > What am I missing?
>> >> >
>> >> > (Is there some reference I'm forgetting? Something extra needed in
>> >> > Winforms
>> >> > but not web apps???)
>> >>
>> >>
>> >>
>>
>>
>>



Re: Feature is not available? by BChernick

BChernick
Fri May 09 15:34:01 CDT 2008

I am using 'Pack <table name> but it's still not working.

The complete command string at present is 'Use <table name> Exclusive; Pack
<table Name>'

Do I need something else? Some sort of close or release command? Is the
connection.close enough?

"Fred Taylor" wrote:

> You need to use "PACK tablename" not just the "PACK" command like when
> you're in VFP.
>
> --
> Fred
> Microsoft Visual FoxPro MVP
>
>
> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> news:F13730C8-BBC2-420E-82D4-FA30333E35E7@microsoft.com...
> >
> > A massive apology. I found the immediate problem. I left out the phrase
> > 'Data Source='. Now the Open works.
> >
> > Still can't quite get the pack command to work. More later.
> >
> > "Paul Pedersen" wrote:
> >
> >> Typically that message will appear if you try to do something that's not
> >> allowed in the runtime version (i.e., FoxPro is not installed on the
> >> machine). Older Foxpro's like 6 were more picky about that than 9.
> >>
> >> Is it possibly due to some code in the database? I forget what all the
> >> forbidden features are/were, but some are: DEBUG, COMPILE, SET STEP ON,
> >> things like that. If there are such commands in the db procedures that
> >> automatically run on open, you might get that message.
> >>
> >>
> >>
> >>
> >>
> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> >> news:D563964D-7253-4834-B6BC-0022A3DB154D@microsoft.com...
> >> > On dc.open. Here's the actual code. sConnStr is the connection string
> >> > described earlier.
> >> >
> >> > Dim dc As New OleDb.OleDbConnection(sConnStr)
> >> > Try
> >> > dc.Open()
> >> > Catch ex As Exception
> >> > MsgBox("Open Fails, error = " + ex.Message)
> >> > Exit Sub
> >> > End Try
> >> >
> >> > "Paul Pedersen" wrote:
> >> >
> >> >> What is the line that's causing the error?
> >> >>
> >> >>
> >> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> >> >> news:14E43ECC-8BEB-4B8D-8AA4-21C23A550614@microsoft.com...
> >> >> > I'm trying to write a quickie Winforms utility (VB, 2.0) that will
> >> >> > pack
> >> >> > some
> >> >> > FoxPro 6 dbf tables. Unfortunately the same connection strings that
> >> >> > worked
> >> >> > with my web app don't seem to work in Winforms. It's crashing on
> >> >> > open
> >> >> > with a
> >> >> > 'Feature is not available' message. (And yes I've already checked
> >> >> > ConnectionStrings.com)
> >> >> >
> >> >> > I've tried a connection string of both:
> >> >> > "Provider=VFPOLEDB.1;" + <file path> + ";Collating Sequence=General"
> >> >> > (This is what I've been using in my web apps.)
> >> >> > and
> >> >> >
> >> >> > "Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
> >> >> > Driver};SourceType=DBF;" + <file path> +
> >> >> > ";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"
> >> >> >
> >> >> > (got that one from ConnectionStrings.com)
> >> >> >
> >> >> > What am I missing?
> >> >> >
> >> >> > (Is there some reference I'm forgetting? Something extra needed in
> >> >> > Winforms
> >> >> > but not web apps???)
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>

Re: Feature is not available? by Dan

Dan
Fri May 09 15:47:36 CDT 2008

Can you describe "not working"?

Should we guess what you're actually seeing? <g>

Dan

B. Chernick wrote:
> I am using 'Pack <table name> but it's still not working.
>
> The complete command string at present is 'Use <table name>
> Exclusive; Pack <table Name>'
>
> Do I need something else? Some sort of close or release command? Is
> the connection.close enough?
>
> "Fred Taylor" wrote:
>
>> You need to use "PACK tablename" not just the "PACK" command like
>> when you're in VFP.
>>
>> --
>> Fred
>> Microsoft Visual FoxPro MVP
>>
>>
>> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
>> news:F13730C8-BBC2-420E-82D4-FA30333E35E7@microsoft.com...
>>>
>>> A massive apology. I found the immediate problem. I left out the
>>> phrase 'Data Source='. Now the Open works.
>>>
>>> Still can't quite get the pack command to work. More later.
>>>
>>> "Paul Pedersen" wrote:
>>>
>>>> Typically that message will appear if you try to do something
>>>> that's not allowed in the runtime version (i.e., FoxPro is not
>>>> installed on the machine). Older Foxpro's like 6 were more picky
>>>> about that than 9.
>>>>
>>>> Is it possibly due to some code in the database? I forget what all
>>>> the forbidden features are/were, but some are: DEBUG, COMPILE, SET
>>>> STEP ON, things like that. If there are such commands in the db
>>>> procedures that automatically run on open, you might get that
>>>> message.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in
>>>> message news:D563964D-7253-4834-B6BC-0022A3DB154D@microsoft.com...
>>>>> On dc.open. Here's the actual code. sConnStr is the connection
>>>>> string described earlier.
>>>>>
>>>>> Dim dc As New OleDb.OleDbConnection(sConnStr)
>>>>> Try
>>>>> dc.Open()
>>>>> Catch ex As Exception
>>>>> MsgBox("Open Fails, error = " + ex.Message)
>>>>> Exit Sub
>>>>> End Try
>>>>>
>>>>> "Paul Pedersen" wrote:
>>>>>
>>>>>> What is the line that's causing the error?
>>>>>>
>>>>>>
>>>>>> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in
>>>>>> message
>>>>>> news:14E43ECC-8BEB-4B8D-8AA4-21C23A550614@microsoft.com...
>>>>>>> I'm trying to write a quickie Winforms utility (VB, 2.0) that
>>>>>>> will pack
>>>>>>> some
>>>>>>> FoxPro 6 dbf tables. Unfortunately the same connection strings
>>>>>>> that worked
>>>>>>> with my web app don't seem to work in Winforms. It's crashing
>>>>>>> on open
>>>>>>> with a
>>>>>>> 'Feature is not available' message. (And yes I've already
>>>>>>> checked ConnectionStrings.com)
>>>>>>>
>>>>>>> I've tried a connection string of both:
>>>>>>> "Provider=VFPOLEDB.1;" + <file path> + ";Collating
>>>>>>> Sequence=General" (This is what I've been using in my web apps.)
>>>>>>> and
>>>>>>>
>>>>>>> "Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
>>>>>>> Driver};SourceType=DBF;" + <file path> +
>>>>>>> ";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"
>>>>>>>
>>>>>>> (got that one from ConnectionStrings.com)
>>>>>>>
>>>>>>> What am I missing?
>>>>>>>
>>>>>>> (Is there some reference I'm forgetting? Something extra
>>>>>>> needed in Winforms
>>>>>>> but not web apps???)



Re: Feature is not available? by BChernick

BChernick
Fri May 09 15:47:03 CDT 2008

It has been suggested to me that I am asking the wrong question.

Is it even possible to do a 'Pack' outside of FoxPro 6 itself? Do you need
the FoxPro 6 Ide (or some portion of it) installed on your computer and do
you have to shell to it?

"Fred Taylor" wrote:

> You need to use "PACK tablename" not just the "PACK" command like when
> you're in VFP.
>
> --
> Fred
> Microsoft Visual FoxPro MVP
>
>
> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> news:F13730C8-BBC2-420E-82D4-FA30333E35E7@microsoft.com...
> >
> > A massive apology. I found the immediate problem. I left out the phrase
> > 'Data Source='. Now the Open works.
> >
> > Still can't quite get the pack command to work. More later.
> >
> > "Paul Pedersen" wrote:
> >
> >> Typically that message will appear if you try to do something that's not
> >> allowed in the runtime version (i.e., FoxPro is not installed on the
> >> machine). Older Foxpro's like 6 were more picky about that than 9.
> >>
> >> Is it possibly due to some code in the database? I forget what all the
> >> forbidden features are/were, but some are: DEBUG, COMPILE, SET STEP ON,
> >> things like that. If there are such commands in the db procedures that
> >> automatically run on open, you might get that message.
> >>
> >>
> >>
> >>
> >>
> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> >> news:D563964D-7253-4834-B6BC-0022A3DB154D@microsoft.com...
> >> > On dc.open. Here's the actual code. sConnStr is the connection string
> >> > described earlier.
> >> >
> >> > Dim dc As New OleDb.OleDbConnection(sConnStr)
> >> > Try
> >> > dc.Open()
> >> > Catch ex As Exception
> >> > MsgBox("Open Fails, error = " + ex.Message)
> >> > Exit Sub
> >> > End Try
> >> >
> >> > "Paul Pedersen" wrote:
> >> >
> >> >> What is the line that's causing the error?
> >> >>
> >> >>
> >> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> >> >> news:14E43ECC-8BEB-4B8D-8AA4-21C23A550614@microsoft.com...
> >> >> > I'm trying to write a quickie Winforms utility (VB, 2.0) that will
> >> >> > pack
> >> >> > some
> >> >> > FoxPro 6 dbf tables. Unfortunately the same connection strings that
> >> >> > worked
> >> >> > with my web app don't seem to work in Winforms. It's crashing on
> >> >> > open
> >> >> > with a
> >> >> > 'Feature is not available' message. (And yes I've already checked
> >> >> > ConnectionStrings.com)
> >> >> >
> >> >> > I've tried a connection string of both:
> >> >> > "Provider=VFPOLEDB.1;" + <file path> + ";Collating Sequence=General"
> >> >> > (This is what I've been using in my web apps.)
> >> >> > and
> >> >> >
> >> >> > "Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
> >> >> > Driver};SourceType=DBF;" + <file path> +
> >> >> > ";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"
> >> >> >
> >> >> > (got that one from ConnectionStrings.com)
> >> >> >
> >> >> > What am I missing?
> >> >> >
> >> >> > (Is there some reference I'm forgetting? Something extra needed in
> >> >> > Winforms
> >> >> > but not web apps???)
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>

Re: Feature is not available? by Fred

Fred
Fri May 09 16:28:05 CDT 2008

No, you don't need the VFP IDE. Try separating it out as 2 commands, I
don't think VFP handles multiple commands.


USE tablename EXCLUSIVE
PACK tablename
--
Fred
Microsoft Visual FoxPro MVP


"B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
news:24A8A583-A37A-463D-A51A-569CB1C85B54@microsoft.com...
> It has been suggested to me that I am asking the wrong question.
>
> Is it even possible to do a 'Pack' outside of FoxPro 6 itself? Do you
> need
> the FoxPro 6 Ide (or some portion of it) installed on your computer and do
> you have to shell to it?
>
> "Fred Taylor" wrote:
>
>> You need to use "PACK tablename" not just the "PACK" command like when
>> you're in VFP.
>>
>> --
>> Fred
>> Microsoft Visual FoxPro MVP
>>
>>
>> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
>> news:F13730C8-BBC2-420E-82D4-FA30333E35E7@microsoft.com...
>> >
>> > A massive apology. I found the immediate problem. I left out the
>> > phrase
>> > 'Data Source='. Now the Open works.
>> >
>> > Still can't quite get the pack command to work. More later.
>> >
>> > "Paul Pedersen" wrote:
>> >
>> >> Typically that message will appear if you try to do something that's
>> >> not
>> >> allowed in the runtime version (i.e., FoxPro is not installed on the
>> >> machine). Older Foxpro's like 6 were more picky about that than 9.
>> >>
>> >> Is it possibly due to some code in the database? I forget what all the
>> >> forbidden features are/were, but some are: DEBUG, COMPILE, SET STEP
>> >> ON,
>> >> things like that. If there are such commands in the db procedures that
>> >> automatically run on open, you might get that message.
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
>> >> news:D563964D-7253-4834-B6BC-0022A3DB154D@microsoft.com...
>> >> > On dc.open. Here's the actual code. sConnStr is the connection
>> >> > string
>> >> > described earlier.
>> >> >
>> >> > Dim dc As New OleDb.OleDbConnection(sConnStr)
>> >> > Try
>> >> > dc.Open()
>> >> > Catch ex As Exception
>> >> > MsgBox("Open Fails, error = " + ex.Message)
>> >> > Exit Sub
>> >> > End Try
>> >> >
>> >> > "Paul Pedersen" wrote:
>> >> >
>> >> >> What is the line that's causing the error?
>> >> >>
>> >> >>
>> >> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in
>> >> >> message
>> >> >> news:14E43ECC-8BEB-4B8D-8AA4-21C23A550614@microsoft.com...
>> >> >> > I'm trying to write a quickie Winforms utility (VB, 2.0) that
>> >> >> > will
>> >> >> > pack
>> >> >> > some
>> >> >> > FoxPro 6 dbf tables. Unfortunately the same connection strings
>> >> >> > that
>> >> >> > worked
>> >> >> > with my web app don't seem to work in Winforms. It's crashing on
>> >> >> > open
>> >> >> > with a
>> >> >> > 'Feature is not available' message. (And yes I've already
>> >> >> > checked
>> >> >> > ConnectionStrings.com)
>> >> >> >
>> >> >> > I've tried a connection string of both:
>> >> >> > "Provider=VFPOLEDB.1;" + <file path> + ";Collating
>> >> >> > Sequence=General"
>> >> >> > (This is what I've been using in my web apps.)
>> >> >> > and
>> >> >> >
>> >> >> > "Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
>> >> >> > Driver};SourceType=DBF;" + <file path> +
>> >> >> > ";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"
>> >> >> >
>> >> >> > (got that one from ConnectionStrings.com)
>> >> >> >
>> >> >> > What am I missing?
>> >> >> >
>> >> >> > (Is there some reference I'm forgetting? Something extra needed
>> >> >> > in
>> >> >> > Winforms
>> >> >> > but not web apps???)
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>



Re: Feature is not available? by Anders

Anders
Sat May 10 03:01:00 CDT 2008

You're still putting two commands into the string sepaarated by ; like in
most SQL languages. You can 't do that in VFP because ; has the opposite
meaning, it's the line continuation token. And USE tablename is not needed,
just PACK tablename.
-Anders

"B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
news:663F8A90-2B06-4758-B478-DCCEA70A5277@microsoft.com...
>I am using 'Pack <table name> but it's still not working.
>
> The complete command string at present is 'Use <table name> Exclusive;
> Pack
> <table Name>'
>
> Do I need something else? Some sort of close or release command? Is the
> connection.close enough?
>
> "Fred Taylor" wrote:
>
>> You need to use "PACK tablename" not just the "PACK" command like when
>> you're in VFP.
>>
>> --
>> Fred
>> Microsoft Visual FoxPro MVP
>>
>>
>> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
>> news:F13730C8-BBC2-420E-82D4-FA30333E35E7@microsoft.com...
>> >
>> > A massive apology. I found the immediate problem. I left out the
>> > phrase
>> > 'Data Source='. Now the Open works.
>> >
>> > Still can't quite get the pack command to work. More later.
>> >
>> > "Paul Pedersen" wrote:
>> >
>> >> Typically that message will appear if you try to do something that's
>> >> not
>> >> allowed in the runtime version (i.e., FoxPro is not installed on the
>> >> machine). Older Foxpro's like 6 were more picky about that than 9.
>> >>
>> >> Is it possibly due to some code in the database? I forget what all the
>> >> forbidden features are/were, but some are: DEBUG, COMPILE, SET STEP
>> >> ON,
>> >> things like that. If there are such commands in the db procedures that
>> >> automatically run on open, you might get that message.
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
>> >> news:D563964D-7253-4834-B6BC-0022A3DB154D@microsoft.com...
>> >> > On dc.open. Here's the actual code. sConnStr is the connection
>> >> > string
>> >> > described earlier.
>> >> >
>> >> > Dim dc As New OleDb.OleDbConnection(sConnStr)
>> >> > Try
>> >> > dc.Open()
>> >> > Catch ex As Exception
>> >> > MsgBox("Open Fails, error = " + ex.Message)
>> >> > Exit Sub
>> >> > End Try
>> >> >
>> >> > "Paul Pedersen" wrote:
>> >> >
>> >> >> What is the line that's causing the error?
>> >> >>
>> >> >>
>> >> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in
>> >> >> message
>> >> >> news:14E43ECC-8BEB-4B8D-8AA4-21C23A550614@microsoft.com...
>> >> >> > I'm trying to write a quickie Winforms utility (VB, 2.0) that
>> >> >> > will
>> >> >> > pack
>> >> >> > some
>> >> >> > FoxPro 6 dbf tables. Unfortunately the same connection strings
>> >> >> > that
>> >> >> > worked
>> >> >> > with my web app don't seem to work in Winforms. It's crashing on
>> >> >> > open
>> >> >> > with a
>> >> >> > 'Feature is not available' message. (And yes I've already
>> >> >> > checked
>> >> >> > ConnectionStrings.com)
>> >> >> >
>> >> >> > I've tried a connection string of both:
>> >> >> > "Provider=VFPOLEDB.1;" + <file path> + ";Collating
>> >> >> > Sequence=General"
>> >> >> > (This is what I've been using in my web apps.)
>> >> >> > and
>> >> >> >
>> >> >> > "Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
>> >> >> > Driver};SourceType=DBF;" + <file path> +
>> >> >> > ";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"
>> >> >> >
>> >> >> > (got that one from ConnectionStrings.com)
>> >> >> >
>> >> >> > What am I missing?
>> >> >> >
>> >> >> > (Is there some reference I'm forgetting? Something extra needed
>> >> >> > in
>> >> >> > Winforms
>> >> >> > but not web apps???)
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>



Re: Feature is not available? by BChernick

BChernick
Mon May 12 09:02:02 CDT 2008

Sorry about that. I meant to say that after running the program, the deleted
records are still there. (I may have gotten past this immediate problem.
More later.)

"Dan Freeman" wrote:

> Can you describe "not working"?
>
> Should we guess what you're actually seeing? <g>
>
> Dan
>
> B. Chernick wrote:
> > I am using 'Pack <table name> but it's still not working.
> >
> > The complete command string at present is 'Use <table name>
> > Exclusive; Pack <table Name>'
> >
> > Do I need something else? Some sort of close or release command? Is
> > the connection.close enough?
> >
> > "Fred Taylor" wrote:
> >
> >> You need to use "PACK tablename" not just the "PACK" command like
> >> when you're in VFP.
> >>
> >> --
> >> Fred
> >> Microsoft Visual FoxPro MVP
> >>
> >>
> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> >> news:F13730C8-BBC2-420E-82D4-FA30333E35E7@microsoft.com...
> >>>
> >>> A massive apology. I found the immediate problem. I left out the
> >>> phrase 'Data Source='. Now the Open works.
> >>>
> >>> Still can't quite get the pack command to work. More later.
> >>>
> >>> "Paul Pedersen" wrote:
> >>>
> >>>> Typically that message will appear if you try to do something
> >>>> that's not allowed in the runtime version (i.e., FoxPro is not
> >>>> installed on the machine). Older Foxpro's like 6 were more picky
> >>>> about that than 9.
> >>>>
> >>>> Is it possibly due to some code in the database? I forget what all
> >>>> the forbidden features are/were, but some are: DEBUG, COMPILE, SET
> >>>> STEP ON, things like that. If there are such commands in the db
> >>>> procedures that automatically run on open, you might get that
> >>>> message.
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in
> >>>> message news:D563964D-7253-4834-B6BC-0022A3DB154D@microsoft.com...
> >>>>> On dc.open. Here's the actual code. sConnStr is the connection
> >>>>> string described earlier.
> >>>>>
> >>>>> Dim dc As New OleDb.OleDbConnection(sConnStr)
> >>>>> Try
> >>>>> dc.Open()
> >>>>> Catch ex As Exception
> >>>>> MsgBox("Open Fails, error = " + ex.Message)
> >>>>> Exit Sub
> >>>>> End Try
> >>>>>
> >>>>> "Paul Pedersen" wrote:
> >>>>>
> >>>>>> What is the line that's causing the error?
> >>>>>>
> >>>>>>
> >>>>>> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in
> >>>>>> message
> >>>>>> news:14E43ECC-8BEB-4B8D-8AA4-21C23A550614@microsoft.com...
> >>>>>>> I'm trying to write a quickie Winforms utility (VB, 2.0) that
> >>>>>>> will pack
> >>>>>>> some
> >>>>>>> FoxPro 6 dbf tables. Unfortunately the same connection strings
> >>>>>>> that worked
> >>>>>>> with my web app don't seem to work in Winforms. It's crashing
> >>>>>>> on open
> >>>>>>> with a
> >>>>>>> 'Feature is not available' message. (And yes I've already
> >>>>>>> checked ConnectionStrings.com)
> >>>>>>>
> >>>>>>> I've tried a connection string of both:
> >>>>>>> "Provider=VFPOLEDB.1;" + <file path> + ";Collating
> >>>>>>> Sequence=General" (This is what I've been using in my web apps.)
> >>>>>>> and
> >>>>>>>
> >>>>>>> "Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
> >>>>>>> Driver};SourceType=DBF;" + <file path> +
> >>>>>>> ";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"
> >>>>>>>
> >>>>>>> (got that one from ConnectionStrings.com)
> >>>>>>>
> >>>>>>> What am I missing?
> >>>>>>>
> >>>>>>> (Is there some reference I'm forgetting? Something extra
> >>>>>>> needed in Winforms
> >>>>>>> but not web apps???)
>
>
>

Re: Feature is not available? by BChernick

BChernick
Mon May 12 09:04:01 CDT 2008

Sorry, forgot about the ';' in FoxPro. As for the 'Use' command not being
needed, I have not heard that before. I thought it was mandatory, or is that
just in the IDE?

"Anders Altberg" wrote:

> You're still putting two commands into the string sepaarated by ; like in
> most SQL languages. You can 't do that in VFP because ; has the opposite
> meaning, it's the line continuation token. And USE tablename is not needed,
> just PACK tablename.
> -Anders
>
> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> news:663F8A90-2B06-4758-B478-DCCEA70A5277@microsoft.com...
> >I am using 'Pack <table name> but it's still not working.
> >
> > The complete command string at present is 'Use <table name> Exclusive;
> > Pack
> > <table Name>'
> >
> > Do I need something else? Some sort of close or release command? Is the
> > connection.close enough?
> >
> > "Fred Taylor" wrote:
> >
> >> You need to use "PACK tablename" not just the "PACK" command like when
> >> you're in VFP.
> >>
> >> --
> >> Fred
> >> Microsoft Visual FoxPro MVP
> >>
> >>
> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> >> news:F13730C8-BBC2-420E-82D4-FA30333E35E7@microsoft.com...
> >> >
> >> > A massive apology. I found the immediate problem. I left out the
> >> > phrase
> >> > 'Data Source='. Now the Open works.
> >> >
> >> > Still can't quite get the pack command to work. More later.
> >> >
> >> > "Paul Pedersen" wrote:
> >> >
> >> >> Typically that message will appear if you try to do something that's
> >> >> not
> >> >> allowed in the runtime version (i.e., FoxPro is not installed on the
> >> >> machine). Older Foxpro's like 6 were more picky about that than 9.
> >> >>
> >> >> Is it possibly due to some code in the database? I forget what all the
> >> >> forbidden features are/were, but some are: DEBUG, COMPILE, SET STEP
> >> >> ON,
> >> >> things like that. If there are such commands in the db procedures that
> >> >> automatically run on open, you might get that message.
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> >> >> news:D563964D-7253-4834-B6BC-0022A3DB154D@microsoft.com...
> >> >> > On dc.open. Here's the actual code. sConnStr is the connection
> >> >> > string
> >> >> > described earlier.
> >> >> >
> >> >> > Dim dc As New OleDb.OleDbConnection(sConnStr)
> >> >> > Try
> >> >> > dc.Open()
> >> >> > Catch ex As Exception
> >> >> > MsgBox("Open Fails, error = " + ex.Message)
> >> >> > Exit Sub
> >> >> > End Try
> >> >> >
> >> >> > "Paul Pedersen" wrote:
> >> >> >
> >> >> >> What is the line that's causing the error?
> >> >> >>
> >> >> >>
> >> >> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in
> >> >> >> message
> >> >> >> news:14E43ECC-8BEB-4B8D-8AA4-21C23A550614@microsoft.com...
> >> >> >> > I'm trying to write a quickie Winforms utility (VB, 2.0) that
> >> >> >> > will
> >> >> >> > pack
> >> >> >> > some
> >> >> >> > FoxPro 6 dbf tables. Unfortunately the same connection strings
> >> >> >> > that
> >> >> >> > worked
> >> >> >> > with my web app don't seem to work in Winforms. It's crashing on
> >> >> >> > open
> >> >> >> > with a
> >> >> >> > 'Feature is not available' message. (And yes I've already
> >> >> >> > checked
> >> >> >> > ConnectionStrings.com)
> >> >> >> >
> >> >> >> > I've tried a connection string of both:
> >> >> >> > "Provider=VFPOLEDB.1;" + <file path> + ";Collating
> >> >> >> > Sequence=General"
> >> >> >> > (This is what I've been using in my web apps.)
> >> >> >> > and
> >> >> >> >
> >> >> >> > "Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
> >> >> >> > Driver};SourceType=DBF;" + <file path> +
> >> >> >> > ";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"
> >> >> >> >
> >> >> >> > (got that one from ConnectionStrings.com)
> >> >> >> >
> >> >> >> > What am I missing?
> >> >> >> >
> >> >> >> > (Is there some reference I'm forgetting? Something extra needed
> >> >> >> > in
> >> >> >> > Winforms
> >> >> >> > but not web apps???)
> >> >> >>
> >> >> >>
> >> >> >>
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>

Re: Feature is not available? by BChernick

BChernick
Mon May 12 09:19:00 CDT 2008

Thanks to all of you for your help. It appears my main problem was failing
to put a full file name after the Pack command. ('Anders Altberg' has stated
that a Use exclusive command is not necessary so I've removed that as well
and everything appears to be working normally.)

However I seem to have a permissions problem now. If I run this on DBFs on
my own pc or on network drives I more or less have ownership of, the program
works fine. However on other network drives I and my coworker get the
following error message:

Error opening file <complete file name> for Exclusive use, error = Command
contains unrecognized phrase/keyword.

Both I and my coworker have the latest vfpoledb.dll installed on our
machines (Version 9.0.00.5815)

Anyone recognize this?

"Fred Taylor" wrote:

> No, you don't need the VFP IDE. Try separating it out as 2 commands, I
> don't think VFP handles multiple commands.
>
>
> USE tablename EXCLUSIVE
> PACK tablename
> --
> Fred
> Microsoft Visual FoxPro MVP
>
>
> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> news:24A8A583-A37A-463D-A51A-569CB1C85B54@microsoft.com...
> > It has been suggested to me that I am asking the wrong question.
> >
> > Is it even possible to do a 'Pack' outside of FoxPro 6 itself? Do you
> > need
> > the FoxPro 6 Ide (or some portion of it) installed on your computer and do
> > you have to shell to it?
> >
> > "Fred Taylor" wrote:
> >
> >> You need to use "PACK tablename" not just the "PACK" command like when
> >> you're in VFP.
> >>
> >> --
> >> Fred
> >> Microsoft Visual FoxPro MVP
> >>
> >>
> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> >> news:F13730C8-BBC2-420E-82D4-FA30333E35E7@microsoft.com...
> >> >
> >> > A massive apology. I found the immediate problem. I left out the
> >> > phrase
> >> > 'Data Source='. Now the Open works.
> >> >
> >> > Still can't quite get the pack command to work. More later.
> >> >
> >> > "Paul Pedersen" wrote:
> >> >
> >> >> Typically that message will appear if you try to do something that's
> >> >> not
> >> >> allowed in the runtime version (i.e., FoxPro is not installed on the
> >> >> machine). Older Foxpro's like 6 were more picky about that than 9.
> >> >>
> >> >> Is it possibly due to some code in the database? I forget what all the
> >> >> forbidden features are/were, but some are: DEBUG, COMPILE, SET STEP
> >> >> ON,
> >> >> things like that. If there are such commands in the db procedures that
> >> >> automatically run on open, you might get that message.
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
> >> >> news:D563964D-7253-4834-B6BC-0022A3DB154D@microsoft.com...
> >> >> > On dc.open. Here's the actual code. sConnStr is the connection
> >> >> > string
> >> >> > described earlier.
> >> >> >
> >> >> > Dim dc As New OleDb.OleDbConnection(sConnStr)
> >> >> > Try
> >> >> > dc.Open()
> >> >> > Catch ex As Exception
> >> >> > MsgBox("Open Fails, error = " + ex.Message)
> >> >> > Exit Sub
> >> >> > End Try
> >> >> >
> >> >> > "Paul Pedersen" wrote:
> >> >> >
> >> >> >> What is the line that's causing the error?
> >> >> >>
> >> >> >>
> >> >> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in
> >> >> >> message
> >> >> >> news:14E43ECC-8BEB-4B8D-8AA4-21C23A550614@microsoft.com...
> >> >> >> > I'm trying to write a quickie Winforms utility (VB, 2.0) that
> >> >> >> > will
> >> >> >> > pack
> >> >> >> > some
> >> >> >> > FoxPro 6 dbf tables. Unfortunately the same connection strings
> >> >> >> > that
> >> >> >> > worked
> >> >> >> > with my web app don't seem to work in Winforms. It's crashing on
> >> >> >> > open
> >> >> >> > with a
> >> >> >> > 'Feature is not available' message. (And yes I've already
> >> >> >> > checked
> >> >> >> > ConnectionStrings.com)
> >> >> >> >
> >> >> >> > I've tried a connection string of both:
> >> >> >> > "Provider=VFPOLEDB.1;" + <file path> + ";Collating
> >> >> >> > Sequence=General"
> >> >> >> > (This is what I've been using in my web apps.)
> >> >> >> > and
> >> >> >> >
> >> >> >> > "Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
> >> >> >> > Driver};SourceType=DBF;" + <file path> +
> >> >> >> > ";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"
> >> >> >> >
> >> >> >> > (got that one from ConnectionStrings.com)
> >> >> >> >
> >> >> >> > What am I missing?
> >> >> >> >
> >> >> >> > (Is there some reference I'm forgetting? Something extra needed
> >> >> >> > in
> >> >> >> > Winforms
> >> >> >> > but not web apps???)
> >> >> >>
> >> >> >>
> >> >> >>
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>

Re: Feature is not available? by Olaf

Olaf
Tue May 13 04:39:34 CDT 2008

> Error opening file <complete file name> for Exclusive use, error = Command
> contains unrecognized phrase/keyword.
That's puzzling.

It may not be a wrong syntax, but as long as you don't show
a real case we can't tell.

It's a bit contradicting itself, as the whole syntax is just
PACK <complete file name>, and it says it can't open a file
exclusive on the one side, which means the syntax should
be okay and the command got executed, but then the
"command contains an unrecognized phrase".

Do you have spaces in the file name?

Then make it
PACK ('<complete file name>')

And you can't of course pack with any parallel thread having
that table opened.

Bye, Olaf.



Re: Feature is not available? by Anders

Anders
Mon May 12 14:10:17 CDT 2008

set up a connection with Exclusive=Yes
If the Open fails you're likely keeping the DBC open some place, and/or have
the table open somewhere. If you're in the VFP IDE, remember that the PM
keeps a connection open if any table in that database has been opened, or
you've used the PM to see the tables in the database all its own which you
can only close by selecting the database on the Data page of the PM and
hitting the Close button, or closing the PM.

This doesn't work in OLEDB as there are no workareas, alias or implicit
aliases.
USE table
PACK
PACK IN tablename
That's why there is a command "PACK tablename", just like the tablename is
specified in every SQL DML command.
It also works in VFP:
CLOSE ALL
PACK C:\tables\tests\temp.dbf
and the Pack command locates the table, opens it, copies it with SET DELETED
ON, renames the temp file (and leaves it open).

-Anders


"B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
news:F965A7D4-91DC-42E5-BD18-910D2AA304B7@microsoft.com...
> Sorry about that. I meant to say that after running the program, the
> deleted
> records are still there. (I may have gotten past this immediate problem.
> More later.)
>
> "Dan Freeman" wrote:
>
>> Can you describe "not working"?
>>
>> Should we guess what you're actually seeing? <g>
>>
>> Dan
>>
>> B. Chernick wrote:
>> > I am using 'Pack <table name> but it's still not working.
>> >
>> > The complete command string at present is 'Use <table name>
>> > Exclusive; Pack <table Name>'
>> >
>> > Do I need something else? Some sort of close or release command? Is
>> > the connection.close enough?
>> >
>> > "Fred Taylor" wrote:
>> >
>> >> You need to use "PACK tablename" not just the "PACK" command like
>> >> when you're in VFP.
>> >>
>> >> --
>> >> Fred
>> >> Microsoft Visual FoxPro MVP
>> >>
>> >>
>> >> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in message
>> >> news:F13730C8-BBC2-420E-82D4-FA30333E35E7@microsoft.com...
>> >>>
>> >>> A massive apology. I found the immediate problem. I left out the
>> >>> phrase 'Data Source='. Now the Open works.
>> >>>
>> >>> Still can't quite get the pack command to work. More later.
>> >>>
>> >>> "Paul Pedersen" wrote:
>> >>>
>> >>>> Typically that message will appear if you try to do something
>> >>>> that's not allowed in the runtime version (i.e., FoxPro is not
>> >>>> installed on the machine). Older Foxpro's like 6 were more picky
>> >>>> about that than 9.
>> >>>>
>> >>>> Is it possibly due to some code in the database? I forget what all
>> >>>> the forbidden features are/were, but some are: DEBUG, COMPILE, SET
>> >>>> STEP ON, things like that. If there are such commands in the db
>> >>>> procedures that automatically run on open, you might get that
>> >>>> message.
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in
>> >>>> message news:D563964D-7253-4834-B6BC-0022A3DB154D@microsoft.com...
>> >>>>> On dc.open. Here's the actual code. sConnStr is the connection
>> >>>>> string described earlier.
>> >>>>>
>> >>>>> Dim dc As New OleDb.OleDbConnection(sConnStr)
>> >>>>> Try
>> >>>>> dc.Open()
>> >>>>> Catch ex As Exception
>> >>>>> MsgBox("Open Fails, error = " + ex.Message)
>> >>>>> Exit Sub
>> >>>>> End Try
>> >>>>>
>> >>>>> "Paul Pedersen" wrote:
>> >>>>>
>> >>>>>> What is the line that's causing the error?
>> >>>>>>
>> >>>>>>
>> >>>>>> "B. Chernick" <BChernick@discussions.microsoft.com> wrote in
>> >>>>>> message
>> >>>>>> news:14E43ECC-8BEB-4B8D-8AA4-21C23A550614@microsoft.com...
>> >>>>>>> I'm trying to write a quickie Winforms utility (VB, 2.0) that
>> >>>>>>> will pack
>> >>>>>>> some
>> >>>>>>> FoxPro 6 dbf tables. Unfortunately the same connection strings
>> >>>>>>> that worked
>> >>>>>>> with my web app don't seem to work in Winforms. It's crashing
>> >>>>>>> on open
>> >>>>>>> with a
>> >>>>>>> 'Feature is not available' message. (And yes I've already
>> >>>>>>> checked ConnectionStrings.com)
>> >>>>>>>
>> >>>>>>> I've tried a connection string of both:
>> >>>>>>> "Provider=VFPOLEDB.1;" + <file path> + ";Collating
>> >>>>>>> Sequence=General" (This is what I've been using in my web apps.)
>> >>>>>>> and
>> >>>>>>>
>> >>>>>>> "Provider=VFPOLEDB.1;DRIVER={Microsoft Visual FoxPro
>> >>>>>>> Driver};SourceType=DBF;" + <file path> +
>> >>>>>>> ";Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE"
>> >>>>>>>
>> >>>>>>> (got that one from ConnectionStrings.com)
>> >>>>>>>
>> >>>>>>> What am I missing?
>> >>>>>>>
>> >>>>>>> (Is there some reference I'm forgetting? Something extra
>> >>>>>>> needed in Winforms
>> >>>>>>> but not web apps???)
>>
>>
>>



Re: Feature is not available? by Olaf

Olaf
Tue May 13 04:59:03 CDT 2008

Hi B. Chernick

I don't know if you already said your webapp runs
24/7 or if it only runs at daytime (in an intranet)?

All that pack really does is create a new dbf file
with a temp name, copies all undeleted records
to the temp file, then finally deletes the old
file and renames the temp file to the old name.

That also explains the need for exclusive access.

If a table is large, PACK takes longer and longer,
the duration is proportional to the number of
total records, not only to the number of deleted
records.

It's recommendable to not do the PACK routine
within the web app using that database/free tables,
but make a secondary web app for that kind of
data maintainance. Then stop the main web app
so the maintainance web app can have exclusive
data access.

Instead of packing a table in a 24/7 system a better
strategy would be to recycle deleted records when
inserting new ones, instead of insert-sql you'd recall
a deleted record and update field values, and only
insert if you don't find a deleted record.

That way you could avoid the problem of needing
exclusive access.

Bye, Olaf.



Re: Feature is not available? by BChernick

BChernick
Tue May 13 07:45:00 CDT 2008

Web app? Sorry but I gave up on that weeks ago. My current effort is to
create a simple standalone Winforms (Dot Net 2.0) program that will select a
directory and pack all the DBFs in it. It appears to be largely working now
(with or without a USE EXCLUSIVE command) although we may have some network
permission problems. Exclusive access itself should not be a problems since
the tables are only used by a small number of people who work in the same
office. Admittedly my posts have been somewhat irregular because I have not
been able to give undivided attention to this project. (Not high priority.)

(By the way, I am using complete file paths and no table has spaces in its
name.)

Thanks.

"Olaf Doschke" wrote:

> Hi B. Cherni