Yes that's the idea I try to show , And I need to discover how to surpass
the 254 chars limit

I guess that the solution  is to use append chunk, but I'm triyng to use
that methode  without sucess

Look for the 2 folowing codes one in asp and another in php,  I tried to
make both codes  as identical as possible, the asp one work perfect , the
php does not give any error but don't append the new record.

I'm very near to be crazy, I'm figthing with a simple memo updated for more
than a week, and nobody helped on this matter until now, I hope you can give
some tips.

The asp code

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft FrontPage 5.0">
</HEAD>
<BODY>
Pagina de teste
<%
Set oConn = Server.CreateObject("ADODB.connection")
oConn.Open "Driver=Microsoft Visual FoxPro Driver;
SourceType=DBf;SourceDB=c:\;BackgroundFetch=No;"
set Rs = server.CREATEOBJECT("ADOR.Recordset")
Rs.cursortype = 1 'adOpenKeyset
Rs.cursorlocation = 2 'adUseServer
Rs.locktype = 3 'adLockOptimistic
Rs.OPEN "select * from memotest",oConn
part1 = string(254,"A")
part2 = string(254,"B")
part3 = string(254,"C")
Rs.AddNew
rs.Fields("ID")="0001"
Rs.Fields("Memo1").AppendChunk(part1)
Rs.Fields("Memo1").AppendChunk(part2)
Rs.Fields("Memo1").AppendChunk(part3)
Rs.UPDATE
RS.Requery

Do While Not RS.EOF
  Response.Write cstr(RS(0))
  Response.Write cstr(RS(1))
  RS.MoveNext
  Loop

rs.Close
oconn.Close
set oconn = nothing
set rs = nothing
%>
</BODY>
</HTML>


The php Code

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft FrontPage 5.0">
</HEAD>
<BODY>
Pagina de teste
<?php
  $oConn = new COM("ADODB.Connection") or die ("connection create fail");;
  $oConn->Open("Driver=Microsoft Visual FoxPro Driver;
SourceType=DBf;SourceDB=c:\;BackgroundFetch=No;") ;
  $Rs = new COM("ADOR.Recordset");
  $Rs->cursortype = 1 ;//'adOpenKeyset
  $Rs->cursorlocation = 2; //'adUseServer
  $Rs->locktype = 3 ;//'adLockOptimistic
  $Rs->Open('select * from memotest',$oConn);
  $part1 = str_repeat('A',254);
  $part2 = str_repeat('B',254);
  $part3 = str_repeat('C',254);
  $Rs->AddNew;
  $Rs->fields["ID"]->value = '0001';
  $Rs->fields["Memo1"]->AppendChunk($part1);
  $Rs->fields["Memo1"]->AppendChunk($part2);
  $Rs->fields["Memo1"]->AppendChunk($part3);
  $Rs->update;
  $Rs->Requery;

  while (!$Rs->EOF){
    echo $Rs->fields["ID"]->value.' ' ;
    echo $Rs->fields["MEMO1"]->value ;
    $Rs->movenext();  }

  $Rs->Close;
  $oConn->Close;
  $oConn = null;
  $Rs = null;
?>
</BODY>
</HTML>


And the Table structure

Structure for table:    C:\MEMOTEST.DBF
Number of data records: 8
Date of last update:    08/21/02
Memo file block size:   64
Code Page:              1252
Field  Field Name      Type                Width    Dec   Index   Collate
Nulls
    1  ID              Character               5
No
    2  MEMO1           Memo                    4
No
** Total **                                   10


Subject: RE: [PHP-WIN] ADO & ODBC , for experts only


> A long shot:
>
> The only essential different I can see at a fast glance is the
> length of the string repeat.
>
> It might be that the string becomes truncated in the third statement.
> Try to execute a string that is 200 bytes in total length, and then
> expand it to 300, if you gets and error if you execute the second
> statement then you know what the fault depends on.
>




-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to