Contributions
Re: How to load the contents of a file from the store into a string.
I must have been confused by this part of the help:Working with string lists. Thus, that means that I have to save the file from the store to disk first and then load it from there...I just hoped I could load the content straight on, without the round trip to the disk. Tnx.991Views0likes0CommentsHow to load the contents of a file from the store into a string.
Hi, I'm trying to figure out how to load the content of a file into a string in DelphiScript. The idea is to load a SQL script (that builds my database/ imports sample data) from the stores and then execute it through a ADO connection. I can execute individual statements, but not whole script.That's what I'm after.. Here's what I've got so far, however TStringlist is not known. (AConnection is a global variable specifying an ADO connection to the server). procedure ExecuteSQLScript(ASQLScript:string); var AScript: TStringList; begin try AScript := TStringList.Create; try AScript.LoadFromFile(Objects.StoredObject[ <meta http-equiv="content-type" content="text/html; charset=utf-8" />ASQLScript]); AConnection.Execute_(AScript.Text); Log.Message(Format('Executed SQL: %s',[ <meta http-equiv="content-type" content="text/html; charset=utf-8" />AScript.Text])); finally AScript.free; end; except Log.Error('Execption',ExceptionMessage); end; end; Any ideas? Tnx.11KViews0likes3Comments