Is there a limitation on a string from a VB.NET oledb INSERT on a
FoxPro table's memo field?
I found I had to trim a system exception message string down to a length of
250,
otherwise I was getting an OLEDB exception of "Command contains
unrecognized phrase/keyword."
The system exception originally was 345 in length:
"System.Data.OleDb.OleDbException: Cannot open file
\\myserver\vol1\folder1\subfolder\mydir\dbfs\test\cond_eom.dbf.
at OSPUserClose.Prepost.makeEOMFiles() in
D:\dev\OSPUserClose\OSPUserClose\Prepost.vb:line 597
at OSPUserClose.Prepost.RunPrepostButton_Click(Object sender, EventArgs
e) in D:\dev\OSPUserClose\OSPUserClose\Prepost.vb:line 92"
I removed any single quotes, chr(10) and chr(13)'s and nothing else unusual
appears when I read the Hex
values.
Below is an example of my vb code. It only fails on the string above, so
far.
Thanks in advance,
Marc Miller
Dim strOleDbCommand2 As OleDbCommand = New OleDbCommand("INSERT INTO
error_log " & _
"VALUES ('" & strProcName & "', datetime(),'" & strUser &
"','" & strError & "')", oConn)
oConn.Open()
strOleDbCommand2.ExecuteNonQuery()