Board index » delphi » Using XML files to store application data?

Using XML files to store application data?

Hi all!

Sorry if this question is stupid, but I'm new to CBuilder and know not much
of XML. I have to store data from my application in some database. I'd like
to use XML for that. Is there an OLE DB provider for XML databases, so I
could use ADO express? I've already downloaded the MS XML SDK, but couldn't
do anything with that. Any hints to get me started?

Thx,
Jens

 

Re:Using XML files to store application data?


You can use MIDAS but you need to include a MIDAS dll in your
distribution if you will.

Re:Using XML files to store application data?


you are using "CBuilder" and i am using "Delphi 5E". in delphi, i use
ADOExpress to write (TADODataSet.SaveToFile with xml option) xml to an ascii
file and use the same TADODataset.LoadFromFile to load an xml file.

example:

  with tAdoDataSet do
   begin
       active:=false;
       Connection:=nil;
       commandtype:=cmdFile;
       commandtext:='C:\MyFolder\XmlFile.Txt';
       LoadFromFile('C:\MyFolder\XmlFile.Txt');
   end;

hope this helps,

jw

Quote
"Jens Weiermann" <j.weierm...@wilms.com> wrote in message

news:3af0fb5e_1@dnews...
Quote
> Hi all!

> Sorry if this question is stupid, but I'm new to CBuilder and know not
much
> of XML. I have to store data from my application in some database. I'd
like
> to use XML for that. Is there an OLE DB provider for XML databases, so I
> could use ADO express? I've already downloaded the MS XML SDK, but
couldn't
> do anything with that. Any hints to get me started?

> Thx,
> Jens

Re:Using XML files to store application data?


Hi JW!

Thanks, this seems to go in the right direction. One more question: To be
able to save an ADO data set to a file, I must *HAVE* an ADO data set, but
my data is stored in a std::vector. How do I get the vector's data into an
ADODataSet?

Thanks!

Jens

"JW" <J_W...@Yahoo.Com> schrieb im Newsbeitrag news:3af1468c$1_2@dnews...

Quote
> you are using "CBuilder" and i am using "Delphi 5E". in delphi, i use
> ADOExpress to write (TADODataSet.SaveToFile with xml option) xml to an
ascii
> file and use the same TADODataset.LoadFromFile to load an xml file.

> example:

>   with tAdoDataSet do
>    begin
>        active:=false;
>        Connection:=nil;
>        commandtype:=cmdFile;
>        commandtext:='C:\MyFolder\XmlFile.Txt';
>        LoadFromFile('C:\MyFolder\XmlFile.Txt');
>    end;

> hope this helps,

> jw

Re:Using XML files to store application data?


<< To be able to save an ADO data set to a file, I must *HAVE* an ADO data
set>>

Yes, you would have read your data from the database via adoexpress.

<< but my data is stored in a std::vector. How do I get the vector's data
into an ADODataSet?>>

I assume"vector" here is Image ? Depend on the RDBMS you use. For example:
MS/SQL server, your field would be defined as "image". Then you store the
image (BMP/DOC/GIF...) via TBlobField. Retrieve the bitmap field jus like
any other field, then savetofile as pfXML. That is all. Whwen you load from
xml, your picture/doc file would then be loaded properly. The
TADOdataSET.savetofile will take care of the conversion from bitmap/image
type to ascii file and load back to your db control properly for you without
you coding a single line of code.

JW

Other Threads