Yes, you are right
The only way to avoid this, is to define a Parameter and Set its width to a higher value, like in this example
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim oConn As New OleDbConnection("Provider=VFPOLEDB.1;Data Source=c:\")
Dim oCMD As New OleDbCommand()
Dim longstr As String
Dim pad As Char
pad = Convert.ToChar("-")
longstr = "This is a Test Message"
longstr = longstr.PadRight(2124, pad)
With oCMD
.Connection = oConn
.Connection.Open()
.CommandType = CommandType.Text
.CommandText = "CREATE TABLE Test (code n(1), fldtest M)"
.ExecuteNonQuery()
.CommandText = "INSERT INTO Test VALUES (1,'A' )"
.ExecuteNonQuery()
.CommandText = "UPDATE Test SET FLDTEST = ? WHERE CODE=1"
.Parameters.Add("FLDTEST", OleDbType.Char, 10000).Value = longstr .ExecuteNonQuery()
.Connection.Close()
End With
oConn.Close()
End Sub
> hi
> im using this from
Vb.NET i have a form with texarea, and i tried to set in the table the field as Memo.
> my SQL statement looks like this :
> insert into mytable (myname, mytext) values ('Peter' , 'text....(the text is longer than 254 characters)')
> but it turns Error the same if i make update statement.
> im not using the command window i have website with VFP database.
> thank you
>
> > > hello i have form with text area, i save the content of the field in database, but the problem is when the length of the text area is more that 254 character it turns error. i chosed the type as memo and it's also not working, which field type should i chose for long textes ? if it's Memo so how i can make the statement to insert into this field ? thank you very much
> >
> > If you are doing it in code:
> >
> > REPLACE <memofield_name> WITH <long_text_string>
> >
> >
> > If you have the field set as the ControlSource - you must use an EditBox (not a tetbox) and then no command is necessary.
> >
> > If you are using buffered tables, don't forget to TableUpdate() after the data has been entered.
> >
> >
> > Regards
> > Andy Kramek
> > Microsoft MVP (Visual FoxPro)
> > Akron, OH, USA
>
>
> you can share every thing but your ...
_________________________
Programmatically Yours
Walid Abu-zahr
Breathing FoxPro