Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

about memo field in foxpro

221 views
Skip to first unread message

omar

unread,
May 29, 2003, 8:57:51 AM5/29/03
to
when i tried to insert a new record through a vb.net and
oledb foxpro provider to foxpro table and this table had a
memo field :
cmd.Connection = OleDbConnection1
OleDbConnection1.Open()
Dim i As Integer
dim f as integer=400
Dim str1 As String = "d"
For i = 0 To
str1 = "d" + str1
Next
cmd.CommandText = "insert into table1 values ('" &
str1 & "')"

cmd.ExecuteNonQuery()


i faced this error :
Command contains unrecognized phrase/keyword
caz the oledb can't put a value more than 254 in a memo
field. what can i do??????

thanx


Cindy Winegarden

unread,
May 29, 2003, 3:58:31 PM5/29/03
to
Perhaps this KB article will help:

http://support.microsoft.com/default.aspx?scid=kb;en-us;208208
"HOWTO: Add Records with Memo Data Using the Visual FoxPro ODBC Driver"

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

"omar" <stin...@hotmail.com> wrote in message
news:522c01c325e1$e9b9e7d0$a101...@phx.gbl...

omar

unread,
May 30, 2003, 1:16:55 AM5/30/03
to
thanx,
but how can i add this functionality to ado.net. no
appendchunck in ado.net.
>.
>

Cindy Winegarden

unread,
May 31, 2003, 10:48:56 AM5/31/03
to
Hi Omar,

I don't know the answer to this question but I've passed it along to my
contacts at Microsoft to see what I can find out for you.

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

"omar" <stin...@hotmail.com> wrote in message

news:5c8a01c3266a$aff3df90$a401...@phx.gbl...

Cindy Winegarden

unread,
Jun 1, 2003, 11:24:51 PM6/1/03
to
Hi Omar,

I was able to insert a large amount of text with the following code:

Imports System.Data.OleDb

Module Module1

Sub Main()

' Assumes VFP table TestADO (Id C(10), Memo1 M)

' in database Test.dbc

Dim OleDbConnection1 = New OleDbConnection("User ID=;DSN=;" & _

"Cache Authentication=False;Data Source=""C:\MY DOCUMENTS\VISUAL FOXPRO
PROJECTS\TEST.DBC"";" & _

"Password=;Provider=""VFPOLEDB.1"";Collating Sequence=MACHINE;Mask
Password=False;Mode=Share Deny None;" & _

"Extended Properties=;Encrypt Password=False")

OleDbConnection1.Open()

Dim OleDbCommand1 As OleDbCommand = New OleDbCommand

OleDbCommand1.Connection = OleDbConnection1

OleDbCommand1.CommandType = CommandType.Text

OleDbCommand1.CommandText = _

"INSERT INTO TestADO (Id, Memo1) VALUES (?, ?)"

Dim Parm0 As OleDbParameter = New Data.OleDb.OleDbParameter

Dim Parm1 As OleDbParameter = New Data.OleDb.OleDbParameter

OleDbCommand1.Parameters.Add(Parm0)

OleDbCommand1.Parameters.Add(Parm1)

OleDbCommand1.Parameters(0).Value = "Id Here"

OleDbCommand1.Parameters(1).Value = _

"The quick brown fox jumped over the lazy dog. 50" & _

"The quick brown fox jumped over the lazy dog. 100" & _

"The quick brown fox jumped over the lazy dog. 150" & _

"The quick brown fox jumped over the lazy dog. 200" & _

"The quick brown fox jumped over the lazy dog. 250" & _

"The quick brown fox jumped over the lazy dog. 300" & _

"The quick brown fox jumped over the lazy dog. 350" & _

"The quick brown fox jumped over the lazy dog. 400" & _

"The quick brown fox jumped over the lazy dog. 450" & _

"The quick brown fox jumped over the lazy dog. 500"

Dim RowsAffected As Integer = OleDbCommand1.ExecuteNonQuery()

OleDbConnection1.Close()

End Sub

End Module


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

> >> the oledb can't put a value more than 254 in a memo

0 new messages