Re: VFP Memos and OleDB

From: Stefan Wuebbe (stefan.wuebbe_at_gmx.de)
Date: 08/14/04


Date: Sun, 15 Aug 2004 00:59:36 +0200

Michael,

Did you try the updated vfpoledb.dll that ships with Vfp9 Public Beta?
http://www.microsoft.com/downloads/details.aspx?familyid=23fbc57b-93b0-4cb7-b376-53ca04fca159&displaylang=en

-Stefan

"Michael Schuldenfrei" <michaels-no-spAm@actionbase.nospam.com> schrieb im
Newsbeitrag news:%23i84x74fEHA.384@TK2MSFTNGP10.phx.gbl...
> I've also tried adding "Locale Identifier=1252;" to the connection string -
> the bug still happens. Any other ideas?
>
> Michael
>
>
> "Michael Schuldenfrei" <michaels-no-spAm@actionbase.nospam.com> wrote in
> message news:un4$tw4fEHA.3944@tk2msftngp13.phx.gbl...
>> Stefan,
>>
>> Thanks for the response. I have performed a number of tests and come up
>> with interesting conclusions.
>>
>> 1. The problem is reproducible even in a simple console application
> (sample
>> below).
>> 2. It ONLY occurs when there are code page mismatches. My machine is
>> running in a Hebrew locale (CP-1255) while the DBF file I am accessing was
>> created using CP-1252 (English). In this configuration, the problem is
>> consistent. I haven't tried other codepage variations.
>>
>> Does anyone know if it is possible to change the code page for the OLE DB
>> driver (like the "codepage" option in config.fpw)? Perhaps that will
> solve
>> the problem.
>>
>> Thanks again,
>>
>> Michael
>>
>> Here is the simple code I wrote to reproduce the problem:
>>
>> static void Main(string[] args)
>> {
>> OleDbConnection conn = new OleDbConnection();
>> OleDbCommand cmd = new OleDbCommand();
>> conn.ConnectionString = @"Data Source=" +
>> @"""E:\Test.NET\TestVFPMemo\data\VFPTest.dbc"";" +
>> @"Provider=""VFPOLEDB.1"";Collating Sequence=GENERAL;Mode=Share Deny
>> None";
>> cmd.Connection = conn;
>> conn.Open();
>>
>> cmd.CommandText = "Select notes from Test where schoolid=1";
>> string s = (string)cmd.ExecuteScalar();
>>
>> cmd.CommandText = "Update test set notes=? where schoolid=1";
>> cmd.Parameters.Add(new OleDbParameter("sometext", s+s+s));
>> cmd.ExecuteNonQuery();
>>
>> conn.Close();
>> }
>>
>> Note that the referenced database has a single table "test" with two
> fields:
>> schoolid (integer) and notes (memo).
>>
>>
>> "Stefan Wuebbe" <stefan.wuebbe@gmx.de> wrote in message
>> news:OqM0$p2fEHA.3272@TK2MSFTNGP11.phx.gbl...
>> > Hi Michael,
>> >
>> > Can you reproduce the effect in pure C# / VB, to track down
>> > if it's an OleDB problem or rather CLR / .Net or even an IIS
>> > issue or a particular combination of these?
>> >
>> >
>> > -Stefan
>> >
>> > "Michael Schuldenfrei" <michaels-no-spAm@actionbase.nospam.com> schrieb
> im
>> > Newsbeitrag news:%23cPOKGxfEHA.2984@tk2msftngp13.phx.gbl...
>> > > Hi,
>> > >
>> > > I have a VFP 6 database that I am accessing from ASP.Net using the
>> latest
>> > > VFP (version 8) OleDB driver and I am having some serious problems
>> updating
>> > > Memo fields. I am using a parameterized query to perform the update,
>> but if
>> > > the argument contains more than 512 characters, the first 512
> characters
>> get
>> > > repeated over and over again in the database (up to the length of the
>> > > original string.)
>> > >
>> > > In desperation, I tried breaking the string down into small (<250)
>> character
>> > > strings and to append these to the Memo one after the other using
>> "Update
>> > > mytable set myfield = myfield + ?" however, I still get the same
>> results.
>> > >
>> > > Can anyone help me on this?
>> > >
>> > > Thanks,
>> > >
>> > > Michael Schuldenfrei
>> > >
>> > >
>> >
>>
>>
>
>