Well it's not necessarily a matter of is one better than the other, it's a matter of what it will be used for. Ini Files are indeed a weaker solution for storing more complex application settings - just look at the XML Config file of any large website. Dowlnoad internet explorer for mac. From XSD schema files? I use Delphi 2007 professional. I tried to write a tool myself, but the Delphi object model knows only. Use the imported classes but create the XML manually in a string and read. > and read the results with a XML document. Yes, checkout. May 19, 2011 - CJC Delphi Title: Read XML made easy. Question: Here you can found easy examples of how to read an XML file using a TXMLDocument. XML truly provides a much more enhanced way of storing your data. Writing XML is fairly easy, however reading XML is quite a chore, more than Ini. You need to really parse through XML in many different ways, whereas Ini is very straightforward and isn't that flexible - you just read line by line. So performance is also a reason. For saving one or two string values and nothing else, Ini is perfect. For a deep complicated configuration, including lists and lists within lists (hierarchy tree), XML would be the answer. JD Solutions RE: Use XML to config Delphi XE2 application (Programmer). So here's my scenario. We are removing permissions from our application and using database groups instead. The auditors don't like the fact that us programmers can access the live database. We are a small company and the users depend on us heavily. I need to use the XML file to hold the database connection and within Delphi depending on environment parameters passed in it will connect to the live for users and development for us developers. We have this currently working with UDL's but we'd rather have all the connections in one file. Any thoughts? ![]() RE: Use XML to config Delphi XE2 application (Programmer) 1 Jun 12 09:53. That process is fine for what you're needing. I do that with many of my programs. In my case I alternate between using an AbsoluteDB database or an AccuRacer database to hold my settings. It really is an.ini within a database. It just means that anyone can't just look at the contents without doing some leg work. XML files,.ini files and.UDL files are all non-secure if you're storing passwords so if your auditors are concerned about security then none of those options, by default, are secure. What part are you having a challenge with? RE: Use XML to config Delphi XE2 application. The best 'Secure' solution I could see in place for this situation is exactly as you described, a file which only contains connection info (INI would work fine). The INI files of the developers will contain only connection strings which they are permitted. But when their source is published, the final project's INI file will contain the production connection string, which the developers will never see. Any SQL scripts are run by a DBA who analyzes the scripts before executing them on production. More good practice is to have QA and Test servers. But again I'm going into more detail than was asked. One INI file may look like this. Be careful, though. Dynamically creating a TXMLDocument with a nil Owner causes the TXMLDocument to act as an interface instead of an object. Calling Free() on such an instance would be very bad. If you want to use Free(), then you have to provide a non- nil Owner (in which case, the Free() is redundant since the Owner will free the TXMLDocument when the Owner is freed). If you dynamically allocate a TXMLDocument with a nil Owner, you MUST assign it to a IXMLDocument variable, in which case use NewXMLDocument() instead of TXMLDocument.Create(nil). – Dec 2 '11 at 21:22 •. Like any other component, TXMLDocument's constructor takes a TComponent Owner as input. If you specify a non- nil Owner, the Owner will take ownership of freeing the TXMLDocument. If you specify a nil Owner instead, then TXMLDocument will be ownerless and you are responsible for freeing it. But TXMLDocument is special in that latter case, as it does not act as a normal component when it has a nil Owner, it acts as a reference-counted interface instead, so you have to involve the reference counting system in order to free it properly. – Dec 2 '11 at 23:29 •.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |