Hi,
I friend has a problem and I made some tests and it really happens...
I'm using delphi 6, and the problem happened when I try to use ClientDataset
with MyBase XML tables in a little application. When I create the dataset
and save the XML file, the component generate a XML file using a XML format
like this:
<ROW RowState="4" ReciboID="1" Usuario="Tarcísio"
Codigo="KTRH-DECB-24406-KINIX" Prestacao="1" Aplicativo="Censo"
Versao="1999" Tipo="1" Vencimento="19990905" Prestacoes="1"
DataMinima="19990830" Gratuitos="10" />
<ROW RowState="4" ReciboID="2" Usuario="COOPRASE"
Codigo="KMHX-KTFT-31781-KIHTH" Prestacao="1" Aplicativo="IMF Nativas"
Versao="1999" Tipo="1" Vencimento="19990909" Prestacoes="1"
DataMinima="19990909" Gratuitos="10" />
Everithing works fine... so, I made changes in application to use MIDASLIB
(in the uses clause) and compile the application without packages. So, it
just stop to work.
Now, if I open the XML file, I have a diferent file using another XML
format. I don't know why, but the application just change the XML format of
the older file to something like this:
- <ROW>
RowState="4"
<ReciboID>1</ReciboID>
<Usuario>Tarcísio</Usuario>
<Codigo>KTRH-DECB-24406-KINIX</Codigo>
<Prestacao>1</Prestacao>
<Aplicativo>Censo</Aplicativo>
<Versao>1999</Versao>
<Tipo>1</Tipo>
<Vencimento>19990905</Vencimento>
<Prestacoes>1</Prestacoes>
<DataMinima>19990830</DataMinima>
<Gratuitos>10</Gratuitos>
</ROW>
- <ROW>
RowState="4"
<ReciboID>3</ReciboID>
<Usuario>COOPRASE</Usuario>
<Codigo>KMHX-DMBE-3027-GNRT</Codigo>
<Prestacao>1</Prestacao>
<Aplicativo>Censo</Aplicativo>
<Versao>1999</Versao>
<Tipo>1</Tipo>
<Vencimento>19990909</Vencimento>
<Prestacoes>1</Prestacoes>
<DataMinima>19990909</DataMinima>
<Gratuitos>10</Gratuitos>
</ROW>
So, my questions:
1) How can I change the format of new file to older format?
2) This changes (Midaslib...) is the cause of problems? Another possible
cause?
3) I couldn't find any kind of document or an article that explain the
problem.
Thanks for any help,
[]'s
BETO.
Thanks,
[]'s
BETO.
"Roberto Capra Neto" <NOS...@hotmail.com> escreveu na mensagem
news:3df08c8a$1...@newsgroups.borland.com...
> Everithing works fine... so, I made changes in application to use MIDASLIB
> (in the uses clause) and compile the application without packages. So, it
> just stop to work.
I can confirm this is a problem in D6, but it's working fine in D7. The
following code demonstrates the problem:
uses Db, DBClient;
procedure TForm1.Button1Click(Sender: TObject);
var
cs : TClientDataSet;
begin
cs := TClientDataSet.Create(nil);
try
cs.FieldDefs.Add('Campo1',ftstring,10);
cs.FieldDefs.Add('Campo2',ftstring,10);
cs.FieldDefs.Add('Campo3',ftstring,10);
cs.CreateDataSet;
cs.AppendRecord(['123','456','789']);
cs.AppendRecord(['abc','cde','fgh']);
cs.SaveToFile('c:\test.xml');
finally
cs.Free;
end;
end;
In Delphi 6, if you compile with MidasLib in the uses clause, it generates a
different XML than when using midas.dll.
--
Leonel