Home > Archive > microsoft.public.cert.exam.mcsd > May 2003 > .NET OLE DB





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author .NET OLE DB
mic

2003-05-28, 3:23 am

Hi,

I am trying to execute insert query using .NET OLE DB, that connects to
FOXPRO table. It gives me the following error:

'Command contains unrecognized phrase/keyword'

I am sure from the syntax, but I think the error occurs because I am trying
to inset to a Memo field in foxpro, and the insert statement has more than
255 characters.

Did anyone face it before?

Thanks


Somchai U.

2003-05-28, 5:23 am

I do not see your SQL command so I have to make a guess. It is possible that
text inserted does not encode/escape properly. (quote character)

Somchai

"mic" <mabusharkh@ccc.gr> wrote in message
news:erQROIPJDHA.1720@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> I am trying to execute insert query using .NET OLE DB, that connects to
> FOXPRO table. It gives me the following error:
>
> 'Command contains unrecognized phrase/keyword'
>
> I am sure from the syntax, but I think the error occurs because I am

trying
> to inset to a Memo field in foxpro, and the insert statement has more than
> 255 characters.
>
> Did anyone face it before?
>
> Thanks
>
>



mic

2003-05-28, 7:23 am

I am sure from my SQL command. When I decrease the string value that will
inserted, the command is executed but when I leave the string as it's it
fails. It seems that the OLE DB driver for foxpro has a bug when dealing
with MEMO fields if the string has more than 255 chars.


"Somchai U." <somchai@no-email.com> wrote in message
news:O#bGy4PJDHA.1392@TK2MSFTNGP10.phx.gbl...
> I do not see your SQL command so I have to make a guess. It is possible

that
> text inserted does not encode/escape properly. (quote character)
>
> Somchai
>
> "mic" <mabusharkh@ccc.gr> wrote in message
> news:erQROIPJDHA.1720@TK2MSFTNGP11.phx.gbl...
> > Hi,
> >
> > I am trying to execute insert query using .NET OLE DB, that connects to
> > FOXPRO table. It gives me the following error:
> >
> > 'Command contains unrecognized phrase/keyword'
> >
> > I am sure from the syntax, but I think the error occurs because I am

> trying
> > to inset to a Memo field in foxpro, and the insert statement has more

than
> > 255 characters.
> >
> > Did anyone face it before?
> >
> > Thanks
> >
> >

>
>



Cindy Winegarden

2003-05-28, 8:23 am

Hi Somchai,

In FoxPro the maximum length of a quoted string is 255 characters, although
much much more can be contained in a variable. To get around this we
sometimes do the following:

cString = "Some text here " + "more text here " + "even more text here."
Note that the string concatenation character in FoxPro is "+", and FoxPro
will accept '', "", and [] as string delimiters.

I haven't worked with FoxPro OLE DB enough to tell you more than that
without some experimentation.

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden@mvps.org, www.cindywinegarden.com

"mic" <mabusharkh@ccc.gr> wrote in message
news:ud1ZUARJDHA.1360@TK2MSFTNGP10.phx.gbl...
> I am sure from my SQL command. When I decrease the string value that will
> inserted, the command is executed but when I leave the string as it's it
> fails. It seems that the OLE DB driver for foxpro has a bug when dealing
> with MEMO fields if the string has more than 255 chars.
>
>
> "Somchai U." <somchai@no-email.com> wrote in message
> news:O#bGy4PJDHA.1392@TK2MSFTNGP10.phx.gbl...
> > I do not see your SQL command so I have to make a guess. It is possible

> that
> > text inserted does not encode/escape properly. (quote character)
> >
> > Somchai
> >
> > "mic" <mabusharkh@ccc.gr> wrote in message
> > news:erQROIPJDHA.1720@TK2MSFTNGP11.phx.gbl...
> > > Hi,
> > >
> > > I am trying to execute insert query using .NET OLE DB, that connects

to[co
lor=darkred]
> > > FOXPRO table. It gives me the following error:
> > >
> > > 'Command contains unrecognized phrase/keyword'
> > >
> > > I am sure from the syntax, but I think the error occurs because I am

> > trying
> > > to inset to a Memo field in foxpro, and the insert statement has more

> than
> > > 255 characters.
> > >
> > > Did anyone face it before?
> > >
> > > Thanks
> > >
> > >

> >
> >

>
>[/color]


mic

2003-05-28, 11:23 am

Hi Cindy,

It seems that I did not make my self clear. In fact, I am writing a VB.NET
application that will access a foxpro table and insert to it. In that foxpro
table, there is a MEMO field, and as I was told, it can hold a long string.

The problem happens when I do the following:

dim strInsertSQL as string="insert into table1 values (<a long string> )"
dim ObjCommand as new OLEDbCommand
ObjCommand.Commandtext=strInsertSQL

So, when I execute this from VB, It gives me the following:

'Command contains unrecognized phrase/keyword'

When I shortened the string length, the command was executed. So, it seems
there is a bug in the driver.

Thanks,


"Cindy Winegarden" <cindy.winegarden@mvps.org> wrote in message
news:eQCuUeRJDHA.1024@TK2MSFTNGP10.phx.gbl...
> Hi Somchai,
>
> In FoxPro the maximum length of a quoted string is 255 characters,

although
> much much more can be contained in a variable. To get around this we
> sometimes do the following:
>
> cString = "Some text here " + "more text here " + "even more text here."
> Note that the string concatenation character in FoxPro is "+", and FoxPro
> will accept '', "", and [] as string delimiters.
>
> I haven't worked with FoxPro OLE DB enough to tell you more than that
> without some experimentation.
>
> --
> Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
> cindy.winegarden@mvps.org, www.cindywinegarden.com
>
> "mic" <mabusharkh@ccc.gr> wrote in message
> news:ud1ZUARJDHA.1360@TK2MSFTNGP10.phx.gbl...
> > I am sure from my SQL command. When I decrease the string value that

will
> > inserted, the command is executed but when I leave the string as it's it
> > fails. It seems that the OLE DB driver for foxpro has a bug when dealing
> > with MEMO fields if the string has more than 255 chars.
> >
> >
> > "Somchai U." <somchai@no-email.com> wrote in message
> > news:O#bGy4PJDHA.1392@TK2MSFTNGP10.phx.gbl...
> > > I do not see your SQL command so I have to make a guess. It is

possible
> > that
> > > text inserted does not encode/escape properly. (quote character)
> > >
> > > Somchai
> > >
> > > "mic" <mabusharkh@ccc.gr> wrote in message
> > > news:erQROIPJDHA.1720@TK2MSFTNGP11.phx.gbl...
> > > > Hi,
> > > >
> > > > I am trying to execute insert query using .NET OLE DB, that connects

> to

> > > > FOXPRO table. It gives me the following error:
> > > >
> > > > 'Command contains unrecognized phrase/keyword'
> > > >
> > > > I am sure from the syntax, but I think the error occurs because I am
> > > trying
> > > > to inset to a Memo field in foxpro, and the insert statement has

more
> > than
> > > > 255 characters.
> > > >
> > > > Did anyone face it before?
> > > >
> > > > Thanks
> > > >
> > > >
> > >
> > >

> >
> >

>
>



Cindy Winegarden

2003-05-28, 1:23 pm

I understood you perfectly. Although a Memo field can hold gobs of data and
a string can hold the entire contents of "War and Peace" (this was demoed at
a conference and the presenter used VFP text handling commands to count the
number of times "and" occurred) FoxPro cannot handle a _quoted_ string
longer than 254 characters. The SQL command you send via OLE DB has a long
quoted string.

I found the following KB article:
http://support.microsoft.com/defaul...kb;en-us;208208
"HOWTO: Add Records with Memo Data Using the Visual FoxPro ODBC Driver"

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden@mvps.org, www.cindywinegarden.com

"mic" <mabusharkh@ccc.gr> wrote in message
news:%23WkgI$SJDHA.3260@tk2msftngp13.phx.gbl...

> It seems that I did not make my self clear. In fact, I am writing a VB.NET
> application that will access a foxpro table and insert to it. In that

foxpro
> table, there is a MEMO field, and as I was told, it can hold a long

string.


mic

2003-05-28, 11:23 pm

Thanks Cindy


"Cindy Winegarden" <cindy.winegarden@mvps.org> wrote in message
news:ure0Y#TJDHA.3084@tk2msftngp13.phx.gbl...
> I understood you perfectly. Although a Memo field can hold gobs of data

and
> a string can hold the entire contents of "War and Peace" (this was demoed

at
> a conference and the presenter used VFP text handling commands to count

the
> number of times "and" occurred) FoxPro cannot handle a _quoted_ string
> longer than 254 characters. The SQL command you send via OLE DB has a long
> quoted string.
>
> I found the following KB article:
> http://support.microsoft.com/defaul...kb;en-us;208208
> "HOWTO: Add Records with Memo Data Using the Visual FoxPro ODBC Driver"
>
> --
> Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
> cindy.winegarden@mvps.org, www.cindywinegarden.com
>
> "mic" <mabusharkh@ccc.gr> wrote in message
> news:%23WkgI$SJDHA.3260@tk2msftngp13.phx.gbl...
>
> > It seems that I did not make my self clear. In fact, I am writing a

VB.NET
> > application that will access a foxpro table and insert to it. In that

> foxpro
> > table, there is a MEMO field, and as I was told, it can hold a long

> string.
>
>



Somchai U.

2003-05-29, 12:23 am

Now I see. You means string constant in a pair of quotes. I used to see this
limit on FoxPro/DOS. I use append memo command to update memo field
(line-by-line), so I does not actually use SQL command with FoxPro/DOS.
However, I have never used FoxPro/Win, so I do not aware if this limitation
is still carried. FoxPro under Microsoft's umbrella is not quite impressive.
:-)

Somchai

"Cindy Winegarden" <cindy.winegarden@mvps.org> wrote in message
news:eQCuUeRJDHA.1024@TK2MSFTNGP10.phx.gbl...
> Hi Somchai,
>
> In FoxPro the maximum length of a quoted string is 255 characters,

although
> much much more can be contained in a variable. To get around this we
> sometimes do the following:
>
> cString = "Some text here " + "more text here " + "even more text here."
> Note that the string concatenation character in FoxPro is "+", and FoxPro
> will accept '', "", and [] as string delimiters.
>
> I haven't worked with FoxPro OLE DB enough to tell you more than that
> without some experimentation.
>
> --
> Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
> cindy.winegarden@mvps.org, www.cindywinegarden.com
>
> "mic" <mabusharkh@ccc.gr> wrote in message
> news:ud1ZUARJDHA.1360@TK2MSFTNGP10.phx.gbl...
> > I am sure from my SQL command. When I decrease the string value that

will
> > inserted, the command is executed but when I leave the string as it's it
> > fails. It seems that the OLE DB driver for foxpro has a bug when dealing
> > with MEMO fields if the string has more than 255 chars.
> >
> >
> > "Somchai U." <somchai@no-email.com> wrote in message
> > news:O#bGy4PJDHA.1392@TK2MSFTNGP10.phx.gbl...
> > > I do not see your SQL command so I have to make a guess. It is

possible
> > that
> > > text inserted does not encode/escape properly. (quote character)
> > >
> > > Somchai
> > >
> > > "mic" <mabusharkh@ccc.gr> wrote in message
> > > news:erQROIPJDHA.1720@TK2MSFTNGP11.phx.gbl...
> > > > Hi,
> > > >
> > > > I am trying to execute insert query using .NET OLE DB, that connects

> to

> > > > FOXPRO table. It gives me the following error:
> > > >
> > > > 'Command contains unrecognized phrase/keyword'
> > > >
> > > > I am sure from the syntax, but I think the error occurs because I am
> > > trying
> > > > to inset to a Memo field in foxpro, and the insert statement has

more
> > than
> > > > 255 characters.
> > > >
> > > > Did anyone face it before?
> > > >
> > > > Thanks
> > > >
> > > >
> > >
> > >

> >
> >

>
>



Cindy Winegarden

2003-05-29, 8:23 am

Every development tool has its weaknesses. If the last FoxPro you saw was
FP2.6 for DOS, you've missed all the wonderful things that have happened up
through Visual FoxPro 8!

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden@mvps.org, www.cindywinegarden.com

"Somchai U." <somchai@no-email.com> wrote in message
news:%23Js372ZJDHA.1720@TK2MSFTNGP11.phx.gbl...
> ... I have never used FoxPro/Win, so I do not aware if this limitation

is still carried. FoxPro under Microsoft's umbrella is not quite impressive.


Kline Sphere

2003-05-29, 9:23 am

Lines: 1
Xref: nntp3.aus1.giganews.com microsoft.public.cert.exam.mcsd:20917

>Every development tool has its weaknesses. If the last FoxPro you saw was
>FP2.6 for DOS, you've missed all the wonderful things that have happened up
>through Visual FoxPro 8!


Absolutely. It's a sham fox does not get the same attention as sql
server.
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net