<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2376419844319975738</id><updated>2024-03-06T06:47:06.955+00:00</updated><category term="Apagar encender pantalla Turn on off display Delphi XE"/><category term="Base de Datos Cliente-Servidor en 3 capas y más."/><category term="Campo NULL Table Field"/><category term="Cifrar AES encryption decryption Delphi XE Unicode"/><category term="Cifrar Descifrar Encrypt Decrypt Cryptographic Delphi XE"/><category term="Comparar archivo texto fuente Compare source text file"/><category term="Delphi XE Firebird Boolean"/><category term="Delphi XE Firebird DataSnap DBX4 Crear Base de Datos Create DabaBase"/><category term="ENTER INTRO TAB DELPHI XE"/><category term="Efecto aparecer desaparecer ventana show hide window AlphaBlend"/><category term="Efecto ventana window effect Delphi XE"/><category term="Ejemplo: Aplicación de 3 capas multihilo con DBX4 y Delphi XE - multi-threaded application with Delphi XE and DataSnap DBX4"/><category term="Filtros Filters DataSnap DBX4 ZLibCompression DbxCompressionFilter"/><category term="IP local nombre PC usuario windows user PC name"/><category term="MDIChild  FormCount  Screen WindowState BringToFront Delphi Ventana ya abierta Form"/><category term="No se puede crear una transacción"/><category term="PNG transparentes con canal Alpha en Delphi XE Alpha channel transparent"/><category term="Personaliza Rejilla - Custon Data Grid DbGrid"/><category term="Reconcile error Delphi XE"/><category term="SEAMOS VISIBLES"/><category term="SQL Manager LITE"/><category term="SQL server identity Delphi Procedure Store Image Blob Imagen Insert Output"/><category term="Sincronizar hora synchronize time Delphi XE"/><category term="TEnum String Delphi XE"/><category term="UTF8 Delphi xe firebird"/><category term="Unique file name Delphi XE - Nombre de fichero único."/><category term="Ventana Clave acceso access key window splash Delphi XE"/><category term="Version aplicacion Delphi XE - application"/><category term="Word no puede completar guardar debido a un error de permiso de archivo"/><category term="clave cadena aleatoria random key string"/><category term="connection close gracefully Delphi XE Datasnap"/><category term="exceeded the capacity"/><category term="se excedió la capacidad Can not create a transaction"/><category term="solucionado"/><category term="velocidad base de datos TDBXTransaction SQLConnection BeginTransaction TDBXIsolations ReadCommitted CommitFreeAndNil RollBackFreeAndNil Rollback StartTransaction  Rollback  Transaction Commit"/><title type='text'>Trabajando con Delphi XE</title><subtitle type='html'>Un punto de reunión para programadores en Delphi</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>36</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-4884630241846784472</id><published>2012-08-19T21:52:00.000+01:00</published><updated>2012-08-19T21:54:34.821+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="solucionado"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL server identity Delphi Procedure Store Image Blob Imagen Insert Output"/><title type='text'>SQL Server - Campos Identity e insertar Blob o Imagen</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Si&amp;nbsp;necesitáis&amp;nbsp;hacer inserciones de documentos e imágenes mediante código SQL y si tras una inserción necesitais saber el código generado mediante Identity por SQL Server, la opción segura es la siguiente y se trata de usar una nueva función disponible desde SQL Server 2005.&lt;br /&gt;
&lt;br /&gt;
Paso 1. Crear un Procedimiento (Procedure) en la base de datos. Siempre recomiendo&lt;a href=&quot;http://www.sqlmanager.net/en/tools/free&quot; target=&quot;_blank&quot;&gt; SQL Manager Lite&lt;/a&gt; for SQL Server que es gratuito, es muy sencillo de usar y es el mejor.&lt;br /&gt;
&lt;br /&gt;
Paso 2. Crear un procedimiento almacenado (Store Procedure) en Delphi que lo ejecuta y recibe el valor.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;u&gt;&lt;b&gt;PASO 1.&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
Recordad que para simplificar tenemos una tabla llamada documentos.&lt;br /&gt;
A este procedimiento le pasamos los parámetros de entrada, entre ellos uno de imagen (image en SQL Server y Blob en Delphi)&lt;br /&gt;
Tiene como parámetro de salida: CodNuevo que será el código que se la base de datos habrá generado de forma automática.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #993333; font-family: monospace; font-weight: bold;&quot;&gt;CREATE&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;PROCEDURE dbo&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;InsertarDocumento&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;@Descripcion varchar&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc; font-family: monospace;&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;@Extension varchar&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc; font-family: monospace;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;@NombreArchivoOriginal varchar&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc; font-family: monospace;&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;@Fichero image&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;@Revision varchar&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc; font-family: monospace;&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;@TamañoKB int&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;@CodNuevo int output&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #993333; font-family: monospace; font-weight: bold;&quot;&gt;AS&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;BEGIN&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;coMULTI&quot; style=&quot;color: grey; font-family: monospace; font-style: italic;&quot;&gt;/* Procedure body */&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;DECLARE @FILAS_INSERTADAS&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #993333; font-family: monospace; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;CodDocumento int&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #993333; font-family: monospace; font-weight: bold;&quot;&gt;INSERT&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #993333; font-family: monospace; font-weight: bold;&quot;&gt;INTO&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;Documentos &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;Descripcion&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;Extension&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;NombreArchivoOriginal&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;Fichero&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;Revision&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;TamañoKB &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;OUTPUT INSERTED&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;CodDocumento&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #993333; font-family: monospace; font-weight: bold;&quot;&gt;INTO&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;@FILAS_INSERTADAS&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #993333; font-family: monospace; font-weight: bold;&quot;&gt;VALUES&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;@Descripcion&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;@Extension&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;@NombreArchivoOriginal&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;@Fichero&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;@Revision&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;@TamañoKB &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #993333; font-family: monospace; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;@CodNuevo&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #66cc66; font-family: monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;CodDocumento&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: #993333; font-family: monospace; font-weight: bold;&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;@FILAS_INSERTADAS&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;END&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: red;&quot;&gt;PASO 2.&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
Creamos en Delphi un componente &lt;span style=&quot;color: blue;&quot;&gt;TSQLDataSet &lt;/span&gt;que llamamos&amp;nbsp;&lt;span style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;SQL_Proc_InsertarDocumento&lt;/span&gt;&lt;br /&gt;
Le ponemos &amp;nbsp;las propiedades&lt;br /&gt;
- &amp;nbsp;conexión en su parámetro &lt;span style=&quot;color: blue;&quot;&gt;SQLConnection&lt;/span&gt;&lt;br /&gt;
- &lt;span style=&quot;color: blue;&quot;&gt;CommandType &lt;/span&gt;a&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;ctStoredProc&lt;/span&gt;&lt;br /&gt;
- &lt;span style=&quot;color: blue;&quot;&gt;CommandText &lt;/span&gt;entonces se desplegará una lista donde deberá estar el procedimiento &#39;&lt;span style=&quot;color: blue;&quot;&gt;InsertarDocumento&lt;/span&gt;&#39;&lt;br /&gt;
&lt;br /&gt;
Una vez hecho eso podremos ver los parámetros que se generan automáticamente en &lt;span style=&quot;color: blue;&quot;&gt;Params&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Luego ponemos el código pasando los parámetros de entrada y recibiendo el de salida en &lt;span style=&quot;color: blue;&quot;&gt;Result&lt;/span&gt;.&lt;br /&gt;
Lo mejor para esto es crear una función, pero para simplificar lo pongo con un ejemplo directo.&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;SQL_Proc_InsertarDocumento&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Active&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;SQL_Proc_InsertarDocumento&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Active&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw2&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;FALSE&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;S&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;QL_Proc_InsertarDocumento&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;ParamByName&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red; font-family: monospace;&quot;&gt;&#39;@Descripcion&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;= &#39;Prueba1&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;SQL_Proc_InsertarDocumento&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;ParamByName&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red; font-family: monospace;&quot;&gt;&#39;@Extension&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;= &#39;PDF&#39;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;Fichero :=&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;&#39;c:\prueba.pdf&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;SQL_Proc_InsertarDocumento&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;ParamByName&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red; font-family: monospace;&quot;&gt;&#39;@NombreArchivoOriginal&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;= Fichero;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;SQL_Proc_InsertarDocumento&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;ParamByName&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red; font-family: monospace;&quot;&gt;&#39;@Fichero&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;LoadFromFile&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(Fichero&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;ftBlob&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;SQL_Proc_InsertarDocumento&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;ParamByName&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red; font-family: monospace;&quot;&gt;&#39;@Revision&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;= &#39;&#39;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;SQL_Proc_InsertarDocumento&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;ParamByName&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red; font-family: monospace;&quot;&gt;&#39;@TamañoKb&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;= 128;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;SQL_Proc_InsertarDocumento&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;ExecSQL&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw2&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;FALSE&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;Result&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;SQL_Proc_InsertarDocumento&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;ParamByName&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red; font-family: monospace;&quot;&gt;&#39;@CodNuevo&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;SQL_Proc_InsertarDocumento&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Active&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw2&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;FALSE&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/4884630241846784472/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/08/sql-server-campos-identity-e-insertar.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/4884630241846784472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/4884630241846784472'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/08/sql-server-campos-identity-e-insertar.html' title='SQL Server - Campos Identity e insertar Blob o Imagen'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-4508956794353754282</id><published>2012-08-12T20:39:00.000+01:00</published><updated>2012-08-12T20:39:51.293+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MDIChild  FormCount  Screen WindowState BringToFront Delphi Ventana ya abierta Form"/><title type='text'>Comprobar si una ventana está abierta</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Si dentro de nuestra aplicación no queremos que una ventana se abra más de una vez, nos bastará con comprobar antes de crearla si ya está abierta.&lt;br /&gt;
&lt;br /&gt;
Esta sencilla función nos comprueba si ya está abierta y en caso de estarlo la activa. Si estuviera minimizada la restaura.&lt;br /&gt;
&lt;br /&gt;
En este caso se le pasa como parámetro la clase de la ventana. Ese valor lo&amp;nbsp;podéis&amp;nbsp;coger de la declaración de vuestra ventana. Aquí lo selecciono en naranja de la definición de un Tform básico.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;var&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; Form1&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;&lt;span style=&quot;background-color: #f0f0f0;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: orange;&quot;&gt;TForm1&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;implementation&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span class=&quot;co2&quot; style=&quot;color: green; font-family: monospace; font-style: italic;&quot;&gt;{$R *.dfm}&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
La función es la siguiente.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;VentanaAbierta&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;Ventana&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-family: monospace; font-weight: bold;&quot;&gt;TClass&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-family: monospace; font-weight: bold;&quot;&gt;Boolean&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;i&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-family: monospace; font-weight: bold;&quot;&gt;integer&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; nada&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-family: monospace; font-weight: bold;&quot;&gt;TClass&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; f&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;Tform&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;result&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw2&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;i&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;Screen&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;FormCount&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: blue; font-family: monospace;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;downto&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: blue; font-family: monospace;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;do&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; f&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;Screen&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Forms&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;F&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;ClassType&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;Ventana&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;F&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;WindowState&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;wsMinimized&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; F&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;WindowState&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;WsNormal&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;BringToFront&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;result&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw2&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/4508956794353754282/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/08/comprobar-si-una-ventana-esta-abierta.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/4508956794353754282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/4508956794353754282'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/08/comprobar-si-una-ventana-esta-abierta.html' title='Comprobar si una ventana está abierta'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-1687221937141632631</id><published>2012-08-11T00:18:00.000+01:00</published><updated>2012-08-11T00:18:00.606+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exceeded the capacity"/><category scheme="http://www.blogger.com/atom/ns#" term="No se puede crear una transacción"/><category scheme="http://www.blogger.com/atom/ns#" term="se excedió la capacidad Can not create a transaction"/><title type='text'>ERROR: Se excedió la capacidad de transacciones</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Trabajando con Delphi XE y XE2 y SQL Server 2008 Express, me salió el siguiente error:&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&quot;No se puede crear una transacción, se excedió la capacidad&quot;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
El problema viene de que hay o parece haber muchas conexiones abiertas&amp;nbsp;simultáneamente&amp;nbsp;sobre una TSQLConnection.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Aunque en la ayuda nos dice que puede provenir de que la base de datos pone un límite de conexiones, no era mi caso, ya que consultando la propiedad&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background-color: white;&quot;&gt;TSQLConnection.MaxStmtsPerConn&lt;/span&gt;&lt;/span&gt; veo que pone 0, lo que quiere decir que no hay limite.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Por si acaso, y no está de más, antes de abrir el &lt;span style=&quot;color: blue;&quot;&gt;TSQLConnection.AutoClone = TRUE&lt;/span&gt;, lo que nos previene de este tipo de problemas si topásemos con una base de datos que si pone límites.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
La solución es:&lt;/div&gt;
&lt;div&gt;
- En&lt;b&gt; modo de diseño&lt;/b&gt;, en el módulo de datos (que es donde supongo&amp;nbsp;estáis&amp;nbsp;poniendo los componentes)&lt;/div&gt;
&lt;div&gt;
- Los &lt;span style=&quot;color: blue;&quot;&gt;TCLientDataSET&lt;/span&gt; y &lt;span style=&quot;color: blue;&quot;&gt;TSQLDataSet&lt;/span&gt; o más antiguamente los TSQLQuery y TSQLTable &amp;nbsp;poner su propiedad &lt;span style=&quot;color: blue;&quot;&gt;Active=FALSE&lt;/span&gt;.&lt;/div&gt;
&lt;div&gt;
- También a&amp;nbsp;TSQLConnection.Active = FALSE.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
- Luego, en cada ventana que el usuario cierra &lt;b&gt;en ejecución&lt;/b&gt;, cerrad las tablas que se hayan abierto.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/1687221937141632631/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/08/error-se-excedio-la-capacidad-de.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/1687221937141632631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/1687221937141632631'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/08/error-se-excedio-la-capacidad-de.html' title='ERROR: Se excedió la capacidad de transacciones'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-7955161137876390926</id><published>2012-08-04T21:15:00.001+01:00</published><updated>2012-08-04T21:15:23.132+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cifrar Descifrar Encrypt Decrypt Cryptographic Delphi XE"/><title type='text'>Cifrar - Descifrar</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Cuando se quiera descifrar y cifrar ya sean cadenas de texto, ficheros o stream, he encontrado una gran utilidad que no usa ninguna librería externa y sin ningún tipo de complicación.&lt;br /&gt;
&lt;br /&gt;
Se trata del component &lt;a href=&quot;http://www.cityinthesky.co.uk/&quot; target=&quot;_blank&quot;&gt;DCPcrypt de&amp;nbsp;David Barton&lt;/a&gt;&amp;nbsp;que está de lo más actualizado aunque pueda no parecerlo.&lt;br /&gt;
&lt;br /&gt;
Como siempre, mostraré los pasos uno a uno para que sea aún más sencillo.&lt;br /&gt;
1)&amp;nbsp;&lt;a href=&quot;http://www.pepak.net/files/tools/dcpcrypt.zip&quot; target=&quot;_blank&quot;&gt;Descargar&lt;/a&gt; el componente más actualizado que vale para Delphi XE y XE2.&lt;br /&gt;
2) Descomprimir en una carpeta.&lt;br /&gt;
3)&amp;nbsp;Desde Delphi ir a &quot;File - Open&quot; y elegir el archivo&amp;nbsp;DCPdelphi6.dpk&lt;br /&gt;
(aunque pueda parecer que es para Delphi 6, está actualizado y funciona perfectamente)&lt;br /&gt;
4) Compilar e Instalar: Pulsando el botón derecho sobre DCPdelphi6.bpl, primero elegir &lt;b&gt;Compile&amp;nbsp;&lt;/b&gt;y luego &lt;b&gt;Install&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOBRIOK22hRapMLkAZxkzZPyM3pDphVAGokI0JV6t0E5dKDc9ZymrHf6Tnnk4onWc7jgAmwFFQUvIz9-pEV4qPGS-80JZeUJXVaoM0qdPpt24DuKUiupDmHWGl6R8WcpIR5NNe6Qee0Ds/s1600/Cifrar.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOBRIOK22hRapMLkAZxkzZPyM3pDphVAGokI0JV6t0E5dKDc9ZymrHf6Tnnk4onWc7jgAmwFFQUvIz9-pEV4qPGS-80JZeUJXVaoM0qdPpt24DuKUiupDmHWGl6R8WcpIR5NNe6Qee0Ds/s640/Cifrar.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
5) Aparecerán entonces dos nuevas paletas, aunque no en la práctica sólo nos servirán para que rellenen automáticamente el &lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;uses&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVFSwJw1ZcqfpD5NOrjwzgbVbAz9xIBtNvzi0SV0vrSx0ZcrmxFtEvg81SaMQ9g-xHeynB1s7KjAtDlC3DjjxfKP7sLyRzKWzvNEh9RGyJUJAHPPEr06atfv343EFqIzpoIjnI2dJApyE/s1600/Componentes.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVFSwJw1ZcqfpD5NOrjwzgbVbAz9xIBtNvzi0SV0vrSx0ZcrmxFtEvg81SaMQ9g-xHeynB1s7KjAtDlC3DjjxfKP7sLyRzKWzvNEh9RGyJUJAHPPEr06atfv343EFqIzpoIjnI2dJApyE/s1600/Componentes.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
6) Ejemplo práctico: Una cadena de texto combinando Rijndael con Sha512&lt;span style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace; font-size: 10px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;Añadir al uses:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;DCPcrypt2&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;DCPblockciphers&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;DCPrijndael&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;DCPrc4&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;DCPsha512;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace; font-size: 10px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;TForm1&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Cifrar&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;Texto&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;Clave&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-family: monospace; font-weight: bold;&quot;&gt;AnsiString&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-family: monospace; font-weight: bold;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;var&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; Cipher&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;TDCP_Rijndael&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Cipher&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;TDCP_Rijndael&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Create&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw2&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;Self&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Cipher&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;InitStr&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;Clave&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;TDCP_sha512&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; result&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;Cipher&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;EncryptString&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;Texto&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Cipher&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Burn&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Cipher&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Free&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;TForm1&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Descifrar&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;Texto&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;Clave&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-family: monospace; font-weight: bold;&quot;&gt;AnsiString&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-family: monospace; font-weight: bold;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;var&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; Cipher&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;TDCP_Rijndael&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Cipher&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;TDCP_Rijndael&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Create&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw2&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;Self&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Cipher&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;InitStr&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;Clave&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;TDCP_sha512&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;result&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;Cipher&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;DecryptString&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;Texto&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Cipher&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Burn&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Cipher&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-family: monospace;&quot;&gt;Free&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-family: monospace; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066; font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;color: #000066; font-family: monospace;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;Y listo.&lt;br /&gt;
&lt;br /&gt;
Para saber más sobre el componente para cifrar archivos o trabajar con stream abrid el archivo que &lt;b&gt;index.html&lt;/b&gt; dentro de la carpeta &lt;b&gt;Docs &lt;/b&gt;en la carpeta donde&amp;nbsp;habéis&amp;nbsp;descomprimido el componente.&lt;br /&gt;
&lt;br /&gt;
Ahh, un detalle: si os gusta el componente y&amp;nbsp;queréis&amp;nbsp;levantar la moral al amigo David para que&amp;nbsp;continué&amp;nbsp;con el proyecto,&amp;nbsp;podéis&amp;nbsp;escribirle un &lt;a href=&quot;mailto:crypto@cityinthesky.co.uk&quot; target=&quot;_blank&quot;&gt;correo &lt;/a&gt;al menos para saludarlo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/7955161137876390926/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/08/cifrar-descifrar.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/7955161137876390926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/7955161137876390926'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/08/cifrar-descifrar.html' title='Cifrar - Descifrar'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOBRIOK22hRapMLkAZxkzZPyM3pDphVAGokI0JV6t0E5dKDc9ZymrHf6Tnnk4onWc7jgAmwFFQUvIz9-pEV4qPGS-80JZeUJXVaoM0qdPpt24DuKUiupDmHWGl6R8WcpIR5NNe6Qee0Ds/s72-c/Cifrar.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-7951878297894681600</id><published>2012-03-31T01:11:00.002+01:00</published><updated>2012-03-31T01:11:44.870+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="velocidad base de datos TDBXTransaction SQLConnection BeginTransaction TDBXIsolations ReadCommitted CommitFreeAndNil RollBackFreeAndNil Rollback StartTransaction  Rollback  Transaction Commit"/><title type='text'>Acelerar las operaciones multiples con una base de datos</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
En muchas ocasiones, hay que realizar operaciones con bases de datos que implican cientos o miles de inserciones, borrados o modificaciones.&lt;br /&gt;
&lt;br /&gt;
Cuando las ejecutamos vemos que la aplicación se queda un largo tiempo realizándolas, dejando a nuestro cliente al borde del ataque al corazón y con enormes ganas de insularnos.&lt;br /&gt;
&lt;br /&gt;
Aunque hay otros métodos más sofisticados, el que voy a poner no implica cambios en el código, tan sólo añadir unas líneas de código.&lt;br /&gt;
&lt;br /&gt;
Recordar que este código sustituye al antiguo&amp;nbsp;&lt;span style=&quot;background-color: #f6f6f6; font-size: x-small; text-align: -webkit-auto;&quot;&gt;StartTransaction,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #f6f6f6; font-size: x-small; text-align: -webkit-auto;&quot;&gt;Transaccion.Rollback y&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #f6f6f6; font-size: x-small; text-align: -webkit-auto;&quot;&gt;Transaction.Commit&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
En el uses añadimos las unidades: &lt;span style=&quot;color: blue;&quot;&gt;SqlExpr &lt;/span&gt;y &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;DBXCommon&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
En la función que realiza el proceso, definimos una variable:&lt;br /&gt;
&lt;span class=&quot;kw1&quot; style=&quot;background-color: #f0f0f0; font-family: monospace; font-weight: bold; text-align: -webkit-auto;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;kw1&quot; style=&quot;background-color: #f0f0f0; font-family: monospace; font-weight: bold; text-align: -webkit-auto;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace; text-align: -webkit-auto;&quot;&gt;&amp;nbsp;DBXTransaction&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace; text-align: -webkit-auto;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace; text-align: -webkit-auto;&quot;&gt;TDBXTransaction&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace; text-align: -webkit-auto;&quot;&gt;;&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Luego añadimos el siguiente código:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, Helvetica;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;code&quot;&gt;&lt;pre class=&quot;code&quot; style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;DBXTransaction&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;&amp;nbsp;SQLConnection1&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;background-color: #f0f0f0; color: #006600; white-space: normal;&quot;&gt;BeginTransaction&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;TDBXIsolations&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;SnapShot);&lt;/span&gt;
&lt;span class=&quot;kw1&quot; style=&quot;background-color: #f0f0f0; font-weight: bold; white-space: normal;&quot;&gt;try&lt;/span&gt;

&lt;span style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;co1&quot; style=&quot;background-color: #f0f0f0; color: grey; font-style: italic; white-space: normal;&quot;&gt;// Aquí estará nuestro actual código que hace todas las operaciones.&lt;/span&gt;

&lt;span style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; SQLConnection1&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;background-color: #f0f0f0; color: #006600; white-space: normal;&quot;&gt;CommitFreeAndNil&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;DBXTransaction&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: #f0f0f0; font-weight: bold; white-space: normal;&quot;&gt;except&lt;/span&gt;

&lt;span style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; SQLConnection1&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;background-color: #f0f0f0; color: #006600; white-space: normal;&quot;&gt;RollBackFreeAndNil&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;DBXTransaction&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: #f0f0f0; font-weight: bold; white-space: normal;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;;&lt;/span&gt;
&lt;/pre&gt;
&lt;pre class=&quot;code&quot; style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;sy1&quot; style=&quot;background-color: #f0f0f0; color: #000066; white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;code&quot; style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;code&quot; style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; text-align: left; white-space: normal;&quot;&gt;En pruebas que he hecho, insertando unos 3500 registros en una base de datos local, y sólo añadiendo ese código, se ha reducido el tiempo casi en un 40%. En una base de datos a través de internet la mejora sería aún mayor.&lt;/span&gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;&lt;pre class=&quot;code&quot; style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; text-align: left; white-space: normal;&quot;&gt;Más adelante explicaré como mejorar aún más nuestras operaciones con las bases de datos.&lt;/span&gt;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/7951878297894681600/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/03/acelerar-las-operaciones-multiples-con.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/7951878297894681600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/7951878297894681600'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/03/acelerar-las-operaciones-multiples-con.html' title='Acelerar las operaciones multiples con una base de datos'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-1889809137192802764</id><published>2012-03-25T02:45:00.000+01:00</published><updated>2012-03-25T02:45:16.348+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IP local nombre PC usuario windows user PC name"/><title type='text'>Datos del PC: Nombre, IP y usuario</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Siempre es muy útil poder disponer de los datos relativos a la red del equipo en el que estamos ejecutando nuestra aplicación.&lt;br /&gt;
He englobado los principales datos en una única función para simplificar el proceso y así obtener:&lt;br /&gt;
- Nombre del PC&lt;br /&gt;
- Dirección IP local&lt;br /&gt;
- Nombre del usuario de Windows.&lt;br /&gt;
&lt;br /&gt;
Recordad añadir al &lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;uses &lt;/span&gt;&lt;/span&gt;lo siguiente:&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;WinInet, WinSock&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
Para simplificar los parámetros he creado un tipo de datos que debeis poner después del uses&lt;br /&gt;
&lt;ol style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace; font-size: 10px; text-align: -webkit-auto;&quot;&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;type&lt;/span&gt;&amp;nbsp;TDatosPC &amp;nbsp;&amp;nbsp;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;record&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp; Nombre&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;,&lt;/span&gt;&amp;nbsp;IP&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;,&lt;/span&gt;&amp;nbsp;Usuario&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;br /&gt;
Y esta es la función que nos devuelve los tres datos&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace; font-size: 10px; text-align: -webkit-auto;&quot;&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;procedure&lt;/span&gt;&amp;nbsp;ObtenerDatosPC&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;var&lt;/span&gt;&amp;nbsp;Datos&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;TDatosPC&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;const&lt;/span&gt;&amp;nbsp;LARGO_MAXIMO&amp;nbsp;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;var&lt;/span&gt;&amp;nbsp;&amp;nbsp; buffer&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;Array&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;LARGO_MAXIMO&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;]&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Largo&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;Cardinal&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; font-weight: bold; vertical-align: top;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; font-weight: normal; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; PuntHost&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&amp;nbsp;PHostEnt&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; PuntIP&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;PAnsichar&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; wVersionRequested&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;WORD&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; wsaData&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&amp;nbsp;TWSAData&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; font-weight: bold; vertical-align: top;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; font-weight: normal; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;Largo&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;LARGO_MAXIMO&amp;nbsp;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp;Datos&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Nombre&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;If&lt;/span&gt;&amp;nbsp;GetComputerName&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;buffer&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;,&lt;/span&gt;&amp;nbsp;Largo&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; Datos&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Nombre&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;buffer&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; font-weight: bold; vertical-align: top;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; font-weight: normal; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp;Datos&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Usuario&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;if&lt;/span&gt;&amp;nbsp;GetUserName&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;buffer&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;,&lt;/span&gt;&amp;nbsp;largo&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Datos&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Usuario&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;buffer&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; wVersionRequested&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;MAKEWORD&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; font-weight: bold; vertical-align: top;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; font-weight: normal; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; WSAStartup&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;&amp;nbsp;wVersionRequested&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;,&lt;/span&gt;&amp;nbsp;wsaData&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; GetHostName&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy2&quot; style=&quot;color: #000066;&quot;&gt;@&lt;/span&gt;buffer&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;,&lt;/span&gt;&amp;nbsp;LARGO_MAXIMO&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; PuntHost&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;GetHostByName&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy2&quot; style=&quot;color: #000066;&quot;&gt;@&lt;/span&gt;buffer&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; PuntIP&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;iNet_ntoa&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;&amp;nbsp;PInAddr&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;&amp;nbsp;PuntHost&lt;span class=&quot;sy2&quot; style=&quot;color: #000066;&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;h_addr_list&lt;/span&gt;&lt;span class=&quot;sy2&quot; style=&quot;color: #000066;&quot;&gt;^&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy2&quot; style=&quot;color: #000066;&quot;&gt;^&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; Datos&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;IP&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;PuntIP&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; font-weight: bold; vertical-align: top;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; font-weight: normal; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; WSACleanup&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/1889809137192802764/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/03/datos-del-pc-nombre-ip-y-usuario.html#comment-form' title='9 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/1889809137192802764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/1889809137192802764'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/03/datos-del-pc-nombre-ip-y-usuario.html' title='Datos del PC: Nombre, IP y usuario'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-7257296678840713406</id><published>2012-03-24T00:45:00.000+00:00</published><updated>2012-03-24T01:11:47.977+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Efecto aparecer desaparecer ventana show hide window AlphaBlend"/><title type='text'>Efecto para mostrar/ocultar ventana</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Cuando tenemos que mostrar una ventana con datos de una o varias tablas podemos comprobar como se dibuja de forma lenta y creando efectos pocos agradables a la vista.&lt;br /&gt;
&lt;br /&gt;
Para evitar esos desagradables efectos, pongo el siguiente ejemplo. Una función de lo más sencilla que permitirá que las ventanas aparezcan y desaparezcan con un bonito efecto visual.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #e06666;&quot;&gt;Aunque cada uno lo pondrá a su gusto, el &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;retardo &lt;/span&gt;&lt;span style=&quot;color: #e06666;&quot;&gt;suele estar bien con un valor de &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;10&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #f1c232;&quot;&gt;Este efecto de DESAPARECER lo&amp;nbsp;podéis&amp;nbsp;poner en el evento &lt;span style=&quot;color: blue;&quot;&gt;OnClose &lt;/span&gt;y/o también en &lt;span style=&quot;color: blue;&quot;&gt;OnCloseQuery&lt;/span&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;co1&quot; style=&quot;color: grey; font-style: italic;&quot;&gt;// Hace que una ventana desaparezca.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;co1&quot; style=&quot;color: grey; font-style: italic;&quot;&gt;// El retardo es en milisegundos.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;procedure&lt;/span&gt;&amp;nbsp;DesaparecerVentana&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;Retardo&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&amp;nbsp;Ventana&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;TForm&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;var&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; i&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;integer&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;background-color: #f0f0f0; color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; font-weight: bold; vertical-align: top;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; font-weight: normal; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; Ventana&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;AlphaBlendValue&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; Ventana&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;AlphaBlend&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw2&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;for&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;255&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;downto&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;do&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;background-color: #f0f0f0; color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; font-weight: bold; vertical-align: top;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; font-weight: normal; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp; Ventana&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;AlphaBlendValue&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;i&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp; Application&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;ProcessMessages&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;sleep&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;Retardo&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;vertical-align: top;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; font-weight: normal; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span style=&quot;background-color: initial; font-size: 1em; line-height: 1.2em;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;de2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; font-weight: normal; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span style=&quot;background-color: initial; font-size: 1em; line-height: 1.2em;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;de2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: none; background-origin: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;div style=&quot;font-family: monospace; font-size: 1em; font-weight: normal; line-height: 1.2em;&quot;&gt;
&lt;span style=&quot;background-color: #f1c232; font-size: 1em; line-height: 1.2em;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: small; text-align: left;&quot;&gt;Este efecto de APARECER lo&amp;nbsp;podéis&amp;nbsp;poner en el evento &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: small; text-align: left;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;OnShow&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: monospace; font-size: 1em; font-weight: normal; line-height: 1.2em;&quot;&gt;
&lt;span style=&quot;background-color: #f1c232; font-size: 1em; line-height: 1.2em;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: small; text-align: left;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: #f1c232;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: small; text-align: left;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 1em; line-height: 1.2em;&quot;&gt;NOTA IMPORTANTE: Si lo&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;line-height: 15px;&quot;&gt;queréis&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 1em; line-height: 1.2em;&quot;&gt;&amp;nbsp;hacer con la ventana principal de vuestra aplicación no lo pongais en el evento OnShow y haced lo siguiente:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: monospace; font-size: 1em; line-height: 1.2em;&quot;&gt;1) Poned la propiedad visible a FALSE de la ventana principal&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f1c232;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: small; text-align: left;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 1em; line-height: 1.2em;&quot;&gt;2) Entrad en project - View Source y después de la línea que pone:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: monospace; line-height: 15px;&quot;&gt;Application.CreateForm(TForm1, Form1); (o algo parecido)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f1c232;&quot;&gt;&lt;span style=&quot;background-color: transparent; line-height: 15px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: monospace;&quot;&gt;escribid&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: monospace;&quot;&gt;&lt;span style=&quot;line-height: 15px;&quot;&gt;&amp;nbsp;lo siguiente:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote style=&quot;border: none; margin: 0 0 0 40px; padding: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #f1c232;&quot;&gt;&lt;span style=&quot;color: blue; font-family: monospace;&quot;&gt;&lt;span style=&quot;line-height: 15px;&quot;&gt;Form1.visible := TRUE;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote style=&quot;border: none; margin: 0 0 0 40px; padding: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: monospace; line-height: 15px;&quot;&gt;AparecerVentana (10,Form1);&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&amp;nbsp;&lt;span style=&quot;background-color: initial; color: grey; font-family: monospace; font-size: 1em; font-style: italic; line-height: 1.2em;&quot;&gt;// Hace que una ventana aparezca.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;
&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;co1&quot; style=&quot;color: grey; font-style: italic;&quot;&gt;// El retardo es en milisegundos.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;procedure&lt;/span&gt;&amp;nbsp;AparecerVentana&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;Retardo&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&amp;nbsp;Ventana&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;TForm&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;var&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; i&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;integer&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;background-color: #f0f0f0; color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; font-weight: bold; vertical-align: top;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; font-weight: normal; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; Ventana&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;AlphaBlendValue&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; Ventana&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;AlphaBlend&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw2&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;for&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;255&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;do&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;background-color: #f0f0f0; color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; font-weight: bold; vertical-align: top;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; font-weight: normal; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp; Ventana&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;AlphaBlendValue&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;i&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp; Application&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;ProcessMessages&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;sleep&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;Retardo&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&amp;nbsp; Ventana&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;AlphaBlend&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw2&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;FALSE&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;background-color: #f0f0f0; color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; font-weight: bold; vertical-align: top;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; font-weight: normal; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;background-color: #f0f0f0; color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 17px; vertical-align: top;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; color: #000020; font-family: monospace; font-size: 1em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/7257296678840713406/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/03/efecto-para-mostrarocultar-ventana.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/7257296678840713406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/7257296678840713406'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/03/efecto-para-mostrarocultar-ventana.html' title='Efecto para mostrar/ocultar ventana'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-545674425310787401</id><published>2012-03-14T07:55:00.001+00:00</published><updated>2012-03-14T07:58:50.831+00:00</updated><title type='text'>Nuevo libro sobre Delphi</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd-uB8WFmrwjV1PanQ7RydPWrtRo9zG_X10KLDnkPt2toR-IuwQoZlXfb1r95UJvjzlxZ8qdS3YK9Zmc7BzFxOh7DtNrYxJdIBefnjG41XmUsUMxHyveKjpXNvxCPWc-1yVdwfm83U3Xk/s1600/libroDelphi.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;214&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd-uB8WFmrwjV1PanQ7RydPWrtRo9zG_X10KLDnkPt2toR-IuwQoZlXfb1r95UJvjzlxZ8qdS3YK9Zmc7BzFxOh7DtNrYxJdIBefnjG41XmUsUMxHyveKjpXNvxCPWc-1yVdwfm83U3Xk/s640/libroDelphi.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Por fin hay un nuevo libro sobre Delphi y en español.&lt;br /&gt;
&lt;br /&gt;
No será como uno de los&amp;nbsp;increíbles&amp;nbsp;libros de Ian Marteens, pero no se puede elegir dada la situación.&lt;br /&gt;
&lt;br /&gt;
Se titula &quot;La Guía de Delphi&quot; por Francisco Charte&lt;br /&gt;
&lt;br /&gt;
Podéis buscarlo en la web de&lt;a href=&quot;http://www.danysoft.com/&quot; target=&quot;_blank&quot;&gt; Danysoft&lt;/a&gt;&amp;nbsp;o directamente en &amp;nbsp;&lt;a href=&quot;http://shop.danysoft.com/epages/danyshop_com.sf/es_ES/?ObjectPath=/Shops/danyshop_com/Products/libroDELPHIXE2&quot; target=&quot;_blank&quot;&gt;Libro de Delphi en Danysoft&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/545674425310787401/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/03/nuevo-libro-sobre-delphi.html#comment-form' title='5 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/545674425310787401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/545674425310787401'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/03/nuevo-libro-sobre-delphi.html' title='Nuevo libro sobre Delphi'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd-uB8WFmrwjV1PanQ7RydPWrtRo9zG_X10KLDnkPt2toR-IuwQoZlXfb1r95UJvjzlxZ8qdS3YK9Zmc7BzFxOh7DtNrYxJdIBefnjG41XmUsUMxHyveKjpXNvxCPWc-1yVdwfm83U3Xk/s72-c/libroDelphi.jpg" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-1717599938538793398</id><published>2012-03-08T17:35:00.001+00:00</published><updated>2012-03-10T11:59:51.278+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Base de Datos Cliente-Servidor en 3 capas y más."/><title type='text'>Ejemplo: Aplicación con BASE DE DATOS de 3 de capas multihilo con DBX4 y Delphi XE - multi-threaded application with Database, Delphi XE and DataSnap DBX4</title><content type='html'>&lt;br /&gt;
Haremos un ejemplo de aplicación cliente servidor con BASE DE DATOS muy sencilla y lo explicaré lo más detallada posible.&lt;br /&gt;
&lt;br /&gt;
Básicamente es la misma que la que ya escribí sin base de datos, simplemente añadiendo unos componentes. Por ello, escribo la misma y cuando haya que hacer cosas distintas lo pondré especificado con las etiquetas&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;PASO ADICIONAL PARA USAR BASES DE DATOS (...)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;--- FIN PASO ADICIONAL PARA USAR BASES DE DATOS (...)&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Esto es para aquellos que el resto del proceso lo tengan claro y no quieran leerlo de nuevo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;u&gt;&lt;b&gt;APLICACIÓN SERVIDOR&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;u&gt;Paso 1 Servidor&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Abrimos Delphi y vamos a&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;File&amp;nbsp;&lt;/span&gt;-&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;New&amp;nbsp;&lt;/span&gt;-&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Other&amp;nbsp;&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVO-y5vWwzq9xyDy4GaOyCffSBcD4YM9epjxvd48VjD-10KLRyR70G2eeeS_Xo33MGJQdeIWYU6potIVSTBtEKsK77qijR1hljd7M17-TntoTDodKUU6lXuIZvoKKkNNtnDzoL6v8Q3l8/s1600/Paso1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVO-y5vWwzq9xyDy4GaOyCffSBcD4YM9epjxvd48VjD-10KLRyR70G2eeeS_Xo33MGJQdeIWYU6potIVSTBtEKsK77qijR1hljd7M17-TntoTDodKUU6lXuIZvoKKkNNtnDzoL6v8Q3l8/s640/Paso1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;u&gt;&lt;b&gt;Paso 2 Servidor&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
Ahora vamoa a&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp;New Item&lt;/span&gt;&amp;nbsp;elegir &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Delphi Projects&lt;/span&gt;&quot; - &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DataSnap Server&lt;/span&gt;&quot; y hacer clic &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DataSnap Server&lt;/span&gt;&quot; y&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&quot;OK&lt;/span&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGJL8hND2QV8w1RUawZorIrLPs92e9xZsaEN4kT_-4C5cLtaMiurtzON17_53l5zQdSgbJdflrAqyWYYUOAE282_-gBL17zwa5U3PqQT7RmzXxnhX6BNZjc_UHitxOpngDmZ91uB4ioiU/s1600/Paso2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGJL8hND2QV8w1RUawZorIrLPs92e9xZsaEN4kT_-4C5cLtaMiurtzON17_53l5zQdSgbJdflrAqyWYYUOAE282_-gBL17zwa5U3PqQT7RmzXxnhX6BNZjc_UHitxOpngDmZ91uB4ioiU/s640/Paso2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;u&gt;Paso 3: Servidor&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Tipo de Proyecto&lt;br /&gt;
Seleccionar:&lt;br /&gt;
VCL Forms&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Application&lt;/span&gt;: Si se quiere que el servidor tenga una o más ventanas (es nuestro ejemplo)&lt;br /&gt;
Console Applicaton: El servidor aparecerá como una consola de comandos.&lt;br /&gt;
Service application: Si queremos que nuestro servidor se ejecute como un servicio en Windows.&lt;br /&gt;
&lt;br /&gt;
Elegimos y pulsamos&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;NEXT&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYhBWOV0l6Sbi-7FeIRQXkVCH2ip7eGGtm_4BL-KOTDoWZsdyHYL2TZen2FAT7GaNXexYg2PGk7205hvccHioNPuM9WaDLCx1ywgWsVwpGSJ41ACkDfd5eI2tzFGr3SklD_pvx9BkHloM/s1600/Paso3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYhBWOV0l6Sbi-7FeIRQXkVCH2ip7eGGtm_4BL-KOTDoWZsdyHYL2TZen2FAT7GaNXexYg2PGk7205hvccHioNPuM9WaDLCx1ywgWsVwpGSJ41ACkDfd5eI2tzFGr3SklD_pvx9BkHloM/s640/Paso3.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;u&gt;Paso 4: Servidor&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Características del Servidor&lt;br /&gt;
-&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Protocol&lt;/span&gt;s: TCP/IP para una aplicación estandar y HTTP sobre todo para aplicaciones web.&lt;br /&gt;
-&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp;Autenticación:&lt;/span&gt;&lt;/span&gt;&amp;nbsp;Si queremos que en nuestro servidor se utilice algún tipo de identificación. No es la autenticación de una base de datos, es un nuevo sistema para proteger el código. No la marcamos&lt;br /&gt;
-&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Server Methods Class&lt;/span&gt;. Nos genera una unidad&amp;nbsp;con dos ejemplos de como usar funciones para compartir con los clientes.&lt;br /&gt;
En nuestro ejemplo lo dejaremos todo con las&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp;opciones por defecto&lt;/span&gt;&amp;nbsp;y pulsamos&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;NEXT&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7PWistXTgpANQAypooZBlO9v25PZl1_BqGg45osxBV836POvouVhWxpam3GlP1t-sgenXSC3EZEtVCL1Pqkub0DGtcS9YzWMomw_gdZe0FbBsPC0TSohOYOh-6Nnru-KbsnZls9ab9v4/s1600/Paso4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7PWistXTgpANQAypooZBlO9v25PZl1_BqGg45osxBV836POvouVhWxpam3GlP1t-sgenXSC3EZEtVCL1Pqkub0DGtcS9YzWMomw_gdZe0FbBsPC0TSohOYOh-6Nnru-KbsnZls9ab9v4/s640/Paso4.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;u&gt;Paso 5: Servidor&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Número de Puerto&lt;br /&gt;
Nos dejará elegir el número de puerto que usará nuestra aplicación.&lt;br /&gt;
Nos permitirá chequear si el puerto está en uso e incluso buscar uno libre.&lt;br /&gt;
&lt;br /&gt;
&lt;span id=&quot;goog_327751334&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_327751335&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWA78OcOPOXXDn5ywdFa2KJjkPn1ZjNKuxd9U0tVyEa42NbQx9_uNN_eq6zwT0jlKPEZDtow0sde7IoCqtQFdfvPhv9bsdS-rjmF2t8PbsFA_EHrmn4rBwQji6UpS-KgPfpj5xeacLpBc/s1600/Paso5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWA78OcOPOXXDn5ywdFa2KJjkPn1ZjNKuxd9U0tVyEa42NbQx9_uNN_eq6zwT0jlKPEZDtow0sde7IoCqtQFdfvPhv9bsdS-rjmF2t8PbsFA_EHrmn4rBwQji6UpS-KgPfpj5xeacLpBc/s640/Paso5.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;u&gt;Paso 6: Servidor&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Clase de métodos de servidor&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TComponent&lt;/span&gt;: Cuando queremos que el servidor sólo exponga funciones, sin bases de datos.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TDataModule&lt;/span&gt;: Si queremos que nuestro servidor exponga bases de datos a través de los TDataSetProviders&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TDSServerModule&lt;/span&gt;: Es la versión más completa para bases de datos ya que nos implementa el interface IAppServer&lt;br /&gt;
Nosotros escogemos&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TDSServerModule&amp;nbsp;&lt;/span&gt;y hacemos clic en&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Finish&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU-wmx7ENJ5jCX0GqQr6lDgVqImEehdNTgy5LzhzG2TV9oqGXi5tC-8jF7oir7RO_2g-5iodHDSN8iL92U2lp7h5q8SGDaEJ1uKcooO5_rotIrBFh1YN1DEgvDm4WpNz6-iyXAy828pps/s1600/Paso6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU-wmx7ENJ5jCX0GqQr6lDgVqImEehdNTgy5LzhzG2TV9oqGXi5tC-8jF7oir7RO_2g-5iodHDSN8iL92U2lp7h5q8SGDaEJ1uKcooO5_rotIrBFh1YN1DEgvDm4WpNz6-iyXAy828pps/s640/Paso6.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Ya tenemos nuestra versión básica de Servidor&lt;br /&gt;
Ahora nos aparece el proyecto con las distintas forms creadas&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ServerContainerUnit1&lt;/span&gt;: unidad para las características del servidor&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ServerMethodsUnit1&lt;/span&gt;: almacena los métodos que exportará el servidor, es decir, los que la aplicación cliente podrá usar.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Unit1&lt;/span&gt;: nuestro form principal&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhROKmhCvn14koIXnGDrsvCOXwt4efK2IaJUWv8TbwHZYf84buELdD_9Tb12Zn6VQSzsQAB6V8Y-UBUbgM-mwcbqcQ39fvxAKzsk4Op6zfJobNfA-v6NgShmvUNJxImBaOSSGoQ1N_VNiM/s1600/Paso7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhROKmhCvn14koIXnGDrsvCOXwt4efK2IaJUWv8TbwHZYf84buELdD_9Tb12Zn6VQSzsQAB6V8Y-UBUbgM-mwcbqcQ39fvxAKzsk4Op6zfJobNfA-v6NgShmvUNJxImBaOSSGoQ1N_VNiM/s640/Paso7.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora retocamos algo nuestro servidor:&lt;br /&gt;
Vamos a&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ServerContainerUnit1&lt;/span&gt;.pas en la pestaña de &quot;Diseño&quot;&lt;br /&gt;
&lt;br /&gt;
Al componente&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DSServer1&amp;nbsp;&lt;/span&gt;le ponemos la propiedad &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;AutoStart&lt;/span&gt;&quot; a&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;False&lt;/span&gt;, para así poder iniciar/parar el servidor de forma manual desde nuestro form principal.&lt;br /&gt;
&lt;br /&gt;
La propiedad&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;HideDsAdmin&amp;nbsp;&lt;/span&gt;es útil cuando la aplicación está totalmente terminada porque si la ponemos a TRUE no serán visibles los métodos que el servidor publique. así desde otra aplicación cliente de otra persona no se podrían usar nuestros métodos. Pero en tiempo de desarrollo hay que dejarla a&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;FALSE&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Luego en el componente DSServerClass, en el evento &quot;On Get Class&quot; vemos que el asistente ha creado el siguiente código:&lt;br /&gt;
PersistentClass := ServerMethodsUnit1.&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TServerMethods1&lt;/span&gt;;&lt;br /&gt;
Es la manera de decir dónde están las cosas que el servidor va a compartir.&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;MUY IMPORTANTE&lt;/u&gt;&lt;/b&gt;: anotar ese&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TServerMethods1&amp;nbsp;&lt;/span&gt;ya que lo vamos a necesitar en el lado del cliente a la hora de configurarlo.&lt;br /&gt;
&lt;br /&gt;
El&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DSTCPServerTransport1&amp;nbsp;&lt;/span&gt;es donde configuramos el máximo hilos, el puerto, y una cosa muy importante: los filtros para el transporte de datos. De esto último hay un ejemplo de comprimir las transmisiones en este blog.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjafAswP_rpM8PavMrW4MRhzPOSjzi1vPItUYw6_nZV3QQD87hr8VVGs79DQP2rp9QP3RgdgCHcIpyqY-ryhl4Z-5Ir91_h6Tsj4djWgB7YuZZmxLAmIU0G_q1wCPgmvwgthFA9AHmlPhk/s1600/Paso8.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjafAswP_rpM8PavMrW4MRhzPOSjzi1vPItUYw6_nZV3QQD87hr8VVGs79DQP2rp9QP3RgdgCHcIpyqY-ryhl4Z-5Ir91_h6Tsj4djWgB7YuZZmxLAmIU0G_q1wCPgmvwgthFA9AHmlPhk/s640/Paso8.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Luego en el componente&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DSServerClass1&amp;nbsp;&lt;/span&gt;ponemos la propiedad&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;LifeCycle&amp;nbsp;&lt;/span&gt;a&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;session&lt;/span&gt;&lt;br /&gt;
Los tipos posibles son&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Server&lt;/span&gt;: Un servidor para todos los clientes. El segundo que intenta acceder a un dato tiene que esperar.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Sesión&lt;/span&gt;. Cada cliente crea su servidor. Nadie espera salvo uno mismo si es multihilo. Guarda la memoria hasta que cierre sesión. Para iniciarse es mejor esta opción porque la Invocation puede hacer cosas que no esperamos.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Invocación&lt;/span&gt;. Mayor coste de proceso. No gasta memoria. No hay esperas. El problema que puede aparecer y que requiere de más atención es que como el TSQLConnection se cierra cuando no hay ningún acceso abierto, puede darse el caso de que las consultas nos devuelvan valores inesperados, como si acabásemos de entrar de nuevo.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbREEFhjcqkYUE4MzI1j5xxKQJ_-VYy5JjbVlf6yJsnfhHgbrI3HJHalkptBWMR6bf0flsj08hO8qszbamA8GKdFVxD755JCh1o3WaCuvukSZsQdxCBB1cz3bfcr5lEpDjR-Ba53-f2lc/s1600/Paso9.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbREEFhjcqkYUE4MzI1j5xxKQJ_-VYy5JjbVlf6yJsnfhHgbrI3HJHalkptBWMR6bf0flsj08hO8qszbamA8GKdFVxD755JCh1o3WaCuvukSZsQdxCBB1cz3bfcr5lEpDjR-Ba53-f2lc/s640/Paso9.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;La unidad ServerMethodUnit1&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
En la unidad ServerMethodsUnit1 ponemos todo lo que queremos que el servidor publique para los clientes: Funciones, TQuery, TTable, ...&lt;br /&gt;
&lt;br /&gt;
Si son function o procedure y las creamos de forma automática con SHIFT-CTRL-C recodar que se habrán creado en la zona Private y entonces no serán publicadas en el servidor.&lt;br /&gt;
&lt;b&gt;Recordar declarar&amp;nbsp;&amp;nbsp;function o procedure&amp;nbsp;en el en Public.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Si en el asistente de servidor hemos marcado la casilla de &quot;Sample Methods&quot; veremos que estarán creadas dos funciones de ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;function TServerMethods1.EchoString(Value: string): string;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; Result := Value;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;end;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;function TServerMethods1.ReverseString(Value: string): string;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; Result := StrUtils.ReverseString(Value);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;end;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Vamos a añadir nuestro ejemplo simple pero algo más útil: saber la hora que tiene el servidor.&lt;br /&gt;
Podría permitirnos sincronizar ordenadores o grabar en un registro la hora real del servidor y no la del pc desde donde lo ejecuta el cliente.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Function TServerMethods2.HoraEnServidor: TDateTime;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; result := now;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;end;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;PASO ADICIONAL PARA USAR BASES DE DATOS (1)&lt;/span&gt;&lt;br /&gt;
Ahora añadiremos nuestros componentes para la base de datos en el lado del servidor.
&lt;br /&gt;
Es en la &lt;span style=&quot;color: blue;&quot;&gt;ServerMethodsUnit &lt;/span&gt;donde debemos poner nuestros componentes de la base de datos.&lt;br /&gt;
En la parte derecha de Delphi, hacemos clic en la pestaña &quot;&lt;span style=&quot;color: blue;&quot;&gt;DataExplorer&lt;/span&gt;&quot;.&lt;br /&gt;
Buscamos nuestra base de datos, en mi caso dentro de Firebird, se llama CONEXIONDEMO.&lt;br /&gt;
Simplemente, la arrastramos hasta el form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBfvR1BKGV7qEIrL-h1vPhLjgvb1q_vDUIc66GSgCGtQLkSD0B-UFXJi0i1nw9HHjuuIojWz4YJUX9fEeu16oUVaIwZN_jc9qLiuRpbveEWy5Q7Vhqmumn7GAhjGJmb5GHBUQbb8hIQ-w/s1600/1+Poner+Base+de+Datos.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;512&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBfvR1BKGV7qEIrL-h1vPhLjgvb1q_vDUIc66GSgCGtQLkSD0B-UFXJi0i1nw9HHjuuIojWz4YJUX9fEeu16oUVaIwZN_jc9qLiuRpbveEWy5Q7Vhqmumn7GAhjGJmb5GHBUQbb8hIQ-w/s640/1+Poner+Base+de+Datos.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A continuación elegimos una tabla del &lt;span style=&quot;color: blue;&quot;&gt;DataExplorer&lt;/span&gt;, en mi caso, &quot;Clientes&quot; y simplemente la arrastramos hasta el form ServerMethodsUnit, así ya queda configurado nuestro &lt;span style=&quot;color: blue;&quot;&gt;TSLQDataSet&lt;/span&gt;. De forma manual, también podemos añadir otros , y suele ser lo más conveniente en una aplicación, los &lt;span style=&quot;color: blue;&quot;&gt;TSQLQuery&lt;/span&gt;.&lt;br /&gt;
Ahora, lo que nos falta el poner es el TDataSetProvider, uno por cada componente anterior, y cambiando su propiedad DataSet al valor apropidado, en nuestro caso inicial Clientes.&lt;br /&gt;
&lt;br /&gt;
En este ejemplo, para simplificar, las conexiones, dataset y demás los dejamos conectados, para así, poder probar sin tener que poner código adicional.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4r2RQ1m1gD4OJB9fpFVo955Vvzkfr9SPUzLFDSeJ_etKAuwWEflkJMfwn1Sdzo5SkeGzkXJZOGGK8KI75cDTpfbHYcPEi4uS50auuNCq2iVFXcE59e7-dF9pD0NmdMRR2_R_gT9Fvi7I/s1600/2+Poner+Tabla+y+Provider.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;512&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4r2RQ1m1gD4OJB9fpFVo955Vvzkfr9SPUzLFDSeJ_etKAuwWEflkJMfwn1Sdzo5SkeGzkXJZOGGK8KI75cDTpfbHYcPEi4uS50auuNCq2iVFXcE59e7-dF9pD0NmdMRR2_R_gT9Fvi7I/s640/2+Poner+Tabla+y+Provider.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora añadiremos los campos de la tabla que hemos colocado. Hacemos clic con el botón secundario del ratón sobre el &lt;span style=&quot;color: blue;&quot;&gt;TSQLDataSet &lt;/span&gt;llamado Clientes y elegimos &lt;span style=&quot;color: blue;&quot;&gt;&quot;Field Editor&lt;/span&gt;&quot; y dentro de ese, hacemos clic sobre el botón secundario del ratón y elegimos &quot;&lt;span style=&quot;color: blue;&quot;&gt;add all fields&lt;/span&gt;&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1KBj2tRK_y1u0lKgYwaXrQoJEM-bnhqRBcnypv5d7n9ANOff6fXCNmggaVg5wet9O_iu7EA1L1E2IrD5ikWoC0bgcbNY95bHwojvJZWMUWshxMk6MdIpgRZ-zqB7TBtS9TWxJEibqK7Y/s1600/3+Poner+Campos.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;512&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1KBj2tRK_y1u0lKgYwaXrQoJEM-bnhqRBcnypv5d7n9ANOff6fXCNmggaVg5wet9O_iu7EA1L1E2IrD5ikWoC0bgcbNY95bHwojvJZWMUWshxMk6MdIpgRZ-zqB7TBtS9TWxJEibqK7Y/s640/3+Poner+Campos.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;--- FIN PASO ADICIONAL PARA USAR BASES DE DATOS (1)&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Ahora abrimos la&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;unit1&amp;nbsp;&lt;/span&gt;y le ponemos un&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TButton&amp;nbsp;&lt;/span&gt;con el&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;caption&amp;nbsp;&lt;/span&gt;&quot;iniciar&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq_3iqsa0JczIXKNAnmIVJZiHOVRvLpQtxs7UvXgMXd0aupvoGX75rUSUJCSXQOwjDjrOMkXfbSsNcJqeL4tYaIjZn9RXOulzj5EVeIB62CqR-wcZqFj9KDYWhUtuhjweP1P8QCH2q_K8/s1600/Paso10.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq_3iqsa0JczIXKNAnmIVJZiHOVRvLpQtxs7UvXgMXd0aupvoGX75rUSUJCSXQOwjDjrOMkXfbSsNcJqeL4tYaIjZn9RXOulzj5EVeIB62CqR-wcZqFj9KDYWhUtuhjweP1P8QCH2q_K8/s640/Paso10.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;Añadimos al&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;uses&amp;nbsp;&lt;/span&gt;la unidad:&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ServerContainerUnit1&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
Y en el evento&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp;&quot;on click&quot;&lt;/span&gt;&amp;nbsp;del&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TButton&amp;nbsp;&lt;/span&gt;ponemos:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;begin&amp;nbsp; if ServerContainer1.DSServer1.started then&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;begin&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ServerContainer1.DSServer1.Stop;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Button1.Caption := &#39;Iniciar&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;end&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; else&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;begin&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ServerContainer1.DSServer1.Start;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Button1.Caption := &#39;Parar&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;end;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;end;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwC_Wr95U61L0uDC8er-CG6z8sl9SaE-Fnc1HeBkmqe51FBN9-1Vm2XAQVU6-VQAGk0YTTEdkUUAYVhlTcIX9rbzp0BRFWQktKJZQn2AEHjGDQYfWI1zNTRSfaOHK8Sf5BiTDo9o9G21s/s1600/Paso11.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwC_Wr95U61L0uDC8er-CG6z8sl9SaE-Fnc1HeBkmqe51FBN9-1Vm2XAQVU6-VQAGk0YTTEdkUUAYVhlTcIX9rbzp0BRFWQktKJZQn2AEHjGDQYfWI1zNTRSfaOHK8Sf5BiTDo9o9G21s/s640/Paso11.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora grabamos todo el proyecto en una carpeta, mejor separando al servidor del cliente:&lt;br /&gt;
Proyecto\Servidor&lt;br /&gt;
Y grabamos el proyecto con el nombre &quot;servidor&quot;&lt;br /&gt;
&lt;br /&gt;
MUY IMPORTANTE: ejecutamos el servidor en modo &quot;sin depuración&quot; haciendo clic con el botón secundario del ratón sobre el proyecto Servidor y eligiendo &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Run Without Debugging&lt;/span&gt;&quot;, porque a la hora de configurar y ejecutar el cliente lo vamos a necesitar&lt;br /&gt;
&lt;br /&gt;
Dado que hemos creado un servidor con inicio manual, recordar una vez ejecutado el servidor hacer clic sobre el botón iniciar del servidor para que esté totalmente operativo.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIvx9FDuK24vFmagd5SOejvTAua0SoSeL4JBge_vr4PchsvhUY6MSBbUh8KD8stgdDZ-tuTJFVo-tR8xgNYekObpKCJYPoY7WZ5XJZ2GMiVhYqkk5xOfqfcp19VOX2CzHfRS8tp0LjOnA/s1600/Paso12.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIvx9FDuK24vFmagd5SOejvTAua0SoSeL4JBge_vr4PchsvhUY6MSBbUh8KD8stgdDZ-tuTJFVo-tR8xgNYekObpKCJYPoY7WZ5XJZ2GMiVhYqkk5xOfqfcp19VOX2CzHfRS8tp0LjOnA/s640/Paso12.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;u&gt;&lt;b&gt;&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;u&gt;&lt;b&gt;APLICACIÓN CLIENTE&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
Sobre el proyecto pulsamos el botón derecho del ratón y elegimos &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Add New Project&lt;/span&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRJp3LOs8OlxdbMnrQl9xb8Hdw-SwwgWiHvJf6X4XnYJ_Fiqjc8af8Uv9P3-SrkgGn65cEZ6n_FQGOrT1AjLgar772Kguo6dN2K9Qwm4BCfOC04teERLmEntwDmZ3UiWkw-JR-y8ndQTY/s1600/ClienteAddNewProject.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRJp3LOs8OlxdbMnrQl9xb8Hdw-SwwgWiHvJf6X4XnYJ_Fiqjc8af8Uv9P3-SrkgGn65cEZ6n_FQGOrT1AjLgar772Kguo6dN2K9Qwm4BCfOC04teERLmEntwDmZ3UiWkw-JR-y8ndQTY/s640/ClienteAddNewProject.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Hacemos clic sobre &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Delphi Projects&lt;/span&gt;&quot; y seleccionamos &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;VCL Form Application&lt;/span&gt;&quot; y &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;OK&lt;/span&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh51aY1Z0GkPqWI_LJuLE9GwvJlXmzWAu7aS56raebwsaJzoUJ-41F5_tqLCbPy4AVoZeo_yHXHIIkX2Ql2bXhcVlp0AzC-yj1D2KdxYcQC1ab2uRXa76NnyzXQyNlEXBAA8t_DQdpbe5s/s1600/ClienteVCLApplication.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh51aY1Z0GkPqWI_LJuLE9GwvJlXmzWAu7aS56raebwsaJzoUJ-41F5_tqLCbPy4AVoZeo_yHXHIIkX2Ql2bXhcVlp0AzC-yj1D2KdxYcQC1ab2uRXa76NnyzXQyNlEXBAA8t_DQdpbe5s/s640/ClienteVCLApplication.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
RECORDAR:&lt;br /&gt;
&amp;nbsp;- que el servidor tienen que estar ejecutándose e iniciado.&lt;br /&gt;
- El proyecto activo en Delphi (el que está en negrita a la derecha) sea el del cliente, porque de lo contrario lo que vamos a hacer a continuación lo pondrá en el proyecto del servidor y habremos hecho un lío.&lt;br /&gt;
&lt;br /&gt;
Ahora vamos al menú &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;File&lt;/span&gt;&quot;, &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&quot;,&quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Other&lt;/span&gt;&quot;, elegimos &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Delphi Projects&lt;/span&gt;&quot;, luego &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DataSnap Server&lt;/span&gt;&quot; y &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Data Snap Client Module&lt;/span&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2xoMJs8bO0A0Jdy7KsZ-ybMDxvA1rl2wrOs3Yt1N42jQxud6IQU7YFMox9zSHi7zH1hf0Ped-WC8AoGudeHineKNCKaKbDIa1CkVYi5fzLnrUiDn_J25yX7PVl9lfwSTLPaCSMoBp_0U/s1600/ClienteAddOther.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2xoMJs8bO0A0Jdy7KsZ-ybMDxvA1rl2wrOs3Yt1N42jQxud6IQU7YFMox9zSHi7zH1hf0Ped-WC8AoGudeHineKNCKaKbDIa1CkVYi5fzLnrUiDn_J25yX7PVl9lfwSTLPaCSMoBp_0U/s640/ClienteAddOther.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Nos pedirá el tipo de servidor:&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp;Local o Remoto&lt;/span&gt;. La diferencia es que en el remoto pide nombre o IP del host y en el local no nos lo pide ya que pone &quot;localhost&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYFCY3ybgToUT9uow6mF4MQwQSE4IKzyosmKgaJbL3wfw36-hqKtw6WO_uj8lm7sPDcmEcNH58hXY64qZnKef2zoyZTHAD7AiMVnJssdk6duyBPkwbww3imGfOueP4cM58s4MCVEynwqU/s1600/ClienteLocalServer.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;314&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYFCY3ybgToUT9uow6mF4MQwQSE4IKzyosmKgaJbL3wfw36-hqKtw6WO_uj8lm7sPDcmEcNH58hXY64qZnKef2zoyZTHAD7AiMVnJssdk6duyBPkwbww3imGfOueP4cM58s4MCVEynwqU/s320/ClienteLocalServer.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ahora nos pide el tipo de servidor: en nuestro caso será sólo con&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DataSnap stand alone server&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-wx9cAnP9YO8SOU2fdePTLj5I5xpNLR0N39tVitW0Na8f6_-6YGjYeDphd7DLOncFMrYHBl6RUx72FpAULRmMsMhE5CwPpKI9_zRaRhSZZYGd__oLM6B8Nmn4G0oFCEOwCodYHyXfEBE/s1600/ClienteStandAlone.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;313&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-wx9cAnP9YO8SOU2fdePTLj5I5xpNLR0N39tVitW0Na8f6_-6YGjYeDphd7DLOncFMrYHBl6RUx72FpAULRmMsMhE5CwPpKI9_zRaRhSZZYGd__oLM6B8Nmn4G0oFCEOwCodYHyXfEBE/s320/ClienteStandAlone.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ahora nos pregunta que tipo de protocolo usaremos: en nuestro caso TCP/IP&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZebb_clINpvo7chDIk0zfx03s53ysHHlLalZzWKOBz1a0ICnZvtojtx69GeifkQkiG5-4mBYgA8ElA1rQyECVualAvZVholYZAq7fQ9ehtd4bFoCJCAJGVuThWzYmZjxr696ZkrDeocs/s1600/ClienteTcp.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;312&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZebb_clINpvo7chDIk0zfx03s53ysHHlLalZzWKOBz1a0ICnZvtojtx69GeifkQkiG5-4mBYgA8ElA1rQyECVualAvZVholYZAq7fQ9ehtd4bFoCJCAJGVuThWzYmZjxr696ZkrDeocs/s320/ClienteTcp.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Y ahora nos pide el puerto que le hemos puesto al servidor.&lt;br /&gt;
Es importante que el servidor se esté ejecutando, ya que de lo contrario no conectará y no nos dejará continuar.&lt;br /&gt;
&lt;br /&gt;
Si lo hemos hecho bien, y pulsamos el botón &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Test Connection&lt;/span&gt;&quot; nos mostrará un mensaje de &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;test connection succeeded&lt;/span&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
Y entonces podremos pulsar el botón &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;finish&lt;/span&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
Ahora grabamos el nuevo proyecto como &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;cliente&lt;/span&gt;&quot;, quedándonos algo como lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWM0J9h-EkdehAc38sbaSfRBamhld8FcSsGCN0EzrlNh2qYR9zx6UDvSjCeDCdrqbkObFZU6mQu4bSCq3a0s6uwiHPO8XpEhcSdAPdIzzX3QGbUJlk4nbPym0brGB28AYUHI8GcgclnaQ/s1600/ClienteTodoIniciado.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWM0J9h-EkdehAc38sbaSfRBamhld8FcSsGCN0EzrlNh2qYR9zx6UDvSjCeDCdrqbkObFZU6mQu4bSCq3a0s6uwiHPO8XpEhcSdAPdIzzX3QGbUJlk4nbPym0brGB28AYUHI8GcgclnaQ/s640/ClienteTodoIniciado.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora en la unit&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ClientModuleUnit1&amp;nbsp;&lt;/span&gt;nos aparecerá un&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;SQLConnection1&lt;/span&gt;. No debemos modificar nada de ese componente.&lt;br /&gt;
&lt;br /&gt;
Añadimos&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DSProviderConnection&amp;nbsp;&lt;/span&gt;y cambiamos lo siguiente:&lt;br /&gt;
propiedad&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Sqlconnection&amp;nbsp;&lt;/span&gt;apuntando a&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;SQLConnection1&amp;nbsp;&lt;/span&gt;(si no la hemos renombrado)&lt;br /&gt;
y lo más IMPORTANTE: la propiedad&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ServerClassName&amp;nbsp;&lt;/span&gt;con&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TServerMethods1&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
IMPORTANTE: No es una propiedad con una lista&amp;nbsp;desplegable&amp;nbsp;ni nada parecido. Hay que escribirlo y te deja poner cualquier cosa, eso sí, si no está correcto no funcionará nada.&lt;br /&gt;
&lt;br /&gt;
Es algo que expliqué en la parte del servidor y lo repito de nuevo:&lt;br /&gt;
&lt;br /&gt;
En el componente DSServerClass de la unidad ServerContainerUnit1;, en el evento &quot;On Get Class&quot; vemos el siguiente código que se genera automáticamente con el asistente:&lt;br /&gt;
PersistentClass := ServerMethodsUnit1.&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TServerMethods1&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6n_FwZ_gtY-sIqzTl3jgwKqdnN0jMAWHysMHvv8WBNDk53VQULMo4MXwZETXm7L7xXisPfoAaDqpmgXn6yMmuXtF9vQVb5LyaB6k_2n2qlnaH0PKKHVldC1lGqeJ-7zrfOWlOpz5tLyU/s1600/ClienteProviderConnection.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;370&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6n_FwZ_gtY-sIqzTl3jgwKqdnN0jMAWHysMHvv8WBNDk53VQULMo4MXwZETXm7L7xXisPfoAaDqpmgXn6yMmuXtF9vQVb5LyaB6k_2n2qlnaH0PKKHVldC1lGqeJ-7zrfOWlOpz5tLyU/s640/ClienteProviderConnection.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Luego ponemos un&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TSQLServerMethod&amp;nbsp;&lt;/span&gt;y cambiamos&lt;br /&gt;
propiedad&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Sqlconnection&amp;nbsp;&lt;/span&gt;apuntando a&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;SQLConnection1&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
Ahora en propiedad&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ServerMethodName&amp;nbsp;&lt;/span&gt;hacemos clic y si lo hemos hecho todo correcto y el servidor está funcionando, nos saldrá una lista con todas las funciones que el servidor está publicando.&lt;br /&gt;
En nuestro caso elegimos&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TServerMethods1.HoraEnServidor&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
Ahora hacemos doble clic en su propiedad Params y nos mostrará los parámetros de entrada salida del método elegido. En nuestro caso sólo tiene de salida por si lo queremos renombrar.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi92U5Fl0jQfEM3W_mzXA_V0M6k2iogzXeiI4QR2XrBmXcC3Yqkg7_MJK5qSliXt-NpoYhNRk-Lht1BR0FQF-lAloEXIa4LFRtYXRqly6D8H2DJSuRWDZeDx2LMycXchaBuFAcsODc42tU/s1600/ClienteServerMethod.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;348&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi92U5Fl0jQfEM3W_mzXA_V0M6k2iogzXeiI4QR2XrBmXcC3Yqkg7_MJK5qSliXt-NpoYhNRk-Lht1BR0FQF-lAloEXIa4LFRtYXRqly6D8H2DJSuRWDZeDx2LMycXchaBuFAcsODc42tU/s640/ClienteServerMethod.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Y ya sólo nos queda dar utilidad a nuestro cliente, pidiendo la hora a nuestro servidor y mostrándola.&lt;br /&gt;
&lt;br /&gt;
Ahora abrimos la unidad&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;unit3&lt;/span&gt;&lt;br /&gt;
En la clausula&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;uses&amp;nbsp;&lt;/span&gt;añadimos: ClientModuleUnit1;&lt;br /&gt;
&lt;br /&gt;
Ponemos un&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TButton&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
En el evento&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;onclick&amp;nbsp;&lt;/span&gt;del TButton ponemos&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;procedure TForm3.Button1Click(Sender: TObject);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;// &amp;nbsp;Así sería si tuviese parámetros de entrada, lo pongo para que veais el funcionamiento de las llamadas.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;// &amp;nbsp;ClientModule1.SqlServerMethod1.ParamByName(&#39;LoQueSea&#39;).Text := &#39;ValorEnviado&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; ClientModule1.SqlServerMethod1.ExecuteMethod;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; Showmessage (FormatDateTime&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (&#39;dd/mm/yy &amp;nbsp;hh:nn&#39;,ClientModule1.SqlServerMethod1.ParamByName(&#39;ReturnParameter&#39;).Value));&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;end;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Y ya tenemos una aplicación cliente servidor.&lt;br /&gt;
Si están interesados también podemos hacer lo mismo pero con bases de datos que es algo más complejo pero más apasionante.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;PASO ADICIONAL PARA USAR BASES DE DATOS (2)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
En la unit ClientModuleUnit ponemos un componente&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;DSProviderConnection &lt;/span&gt;y cambiamos sus propiedades:&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;- SQLConnection&lt;/span&gt;: apuntando a nuestro SQLConnection que está en este mismo form.&lt;br /&gt;
- LO MAS IMPORTANTE: &lt;span style=&quot;color: red;&quot;&gt;(recordad paso 6 del servidor&lt;/span&gt;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;En la unit&amp;nbsp;ServerContainerUnit nos aparece el código siguente:&lt;br /&gt;
&amp;nbsp; &amp;nbsp;PersistentClass := ServerMethodsUnit1.&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TServerMethods1&lt;/span&gt;;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;Pues bien, en la propiedad&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;ServerClassName&lt;/span&gt;: ponemos &lt;span style=&quot;color: blue;&quot;&gt;TServerMethods1&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;Esto se escribe a mano, no hay ninguna lista desplegable, para evitar errores tontos que nos pueden llevar &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp;a un dolor de cabeza, mejor copia y pega.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglpkwCuaXIdnbuGxQeGvpra0P0LSHENatTpNaxggRbglWJ8agmSdYhGlew_v4Wx99CzE5A3Oq35uhm2iA6MKBaunlSy805WaaEBdM5j1jRMrB_Jmm2UqupVz1jy6Y7Pa1XqXFAeKH-hak/s1600/5+Cliente+Poner+DS+Provider+Connection.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;512&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglpkwCuaXIdnbuGxQeGvpra0P0LSHENatTpNaxggRbglWJ8agmSdYhGlew_v4Wx99CzE5A3Oq35uhm2iA6MKBaunlSy805WaaEBdM5j1jRMrB_Jmm2UqupVz1jy6Y7Pa1XqXFAeKH-hak/s640/5+Cliente+Poner+DS+Provider+Connection.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
No me cansaré de repetirlo: el &lt;span style=&quot;color: red;&quot;&gt;servidor tiene que estar ejecutándose&lt;/span&gt; para cambiar las siguientes propiedades.&lt;br /&gt;
&lt;br /&gt;
Ahora ya podemos añadir los &lt;span style=&quot;color: blue;&quot;&gt;ClientDataSet &lt;/span&gt;a nuestra tabla o consulta.&lt;br /&gt;
Primero debemos modificar la propiedad &lt;span style=&quot;color: blue;&quot;&gt;RemoteServer&lt;/span&gt;: que será el &lt;span style=&quot;color: blue;&quot;&gt;DsProviderConnection1&lt;/span&gt;&lt;br /&gt;
Luego modificamos la propiedad &lt;span style=&quot;color: blue;&quot;&gt;ProviderName &lt;/span&gt;apuntando a nuestra tabla o consulta, en nuestro caso &lt;span style=&quot;color: blue;&quot;&gt;DataSetProvider1&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
Recordad para simplificar, dejar todo conectado.&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;SQLConnection1.connected := TRUE;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;SQLConnection1.connected := TRUE;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;ClientDataSet1.Active := TRUE;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3N_jXP5_TXvpD3U-EJyi6mmpXLt8GHRP7tIt9iI7_IxU8gfMeFC3JC_U-__90TOVbmmljnJwrwJIp2_1MvkVq4M0LjoP-dxbTiQeRXBZZ1FtsZ8TwoQBoz_w8z9ctG3Yide4uzOUyPNI/s1600/6+Cliente+Poner+ClientDataSet.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;512&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3N_jXP5_TXvpD3U-EJyi6mmpXLt8GHRP7tIt9iI7_IxU8gfMeFC3JC_U-__90TOVbmmljnJwrwJIp2_1MvkVq4M0LjoP-dxbTiQeRXBZZ1FtsZ8TwoQBoz_w8z9ctG3Yide4uzOUyPNI/s640/6+Cliente+Poner+ClientDataSet.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora tan sólo vamos a la ventana principal de nuestra aplicación cliente (o a cualquier otra ventana), en nuestro ejemplo Unit3:&lt;br /&gt;
&lt;br /&gt;
Ponemos en el &lt;span style=&quot;color: blue;&quot;&gt;USES &lt;/span&gt;de Unit3 a&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;ClientModuleUnit1&lt;/span&gt;.&lt;br /&gt;
Ahora ponemos un &lt;span style=&quot;color: blue;&quot;&gt;DataSource &lt;/span&gt;en Unit3, y cambiamos su propiedad &lt;span style=&quot;color: blue;&quot;&gt;DataSet &lt;/span&gt;a&amp;nbsp;ClientModule1.ClientDataSet1.&lt;br /&gt;
&lt;br /&gt;
Luego ponemos una &lt;span style=&quot;color: blue;&quot;&gt;DBGrid&lt;/span&gt;. Cambiamos su propiedad &lt;span style=&quot;color: blue;&quot;&gt;DataSource &lt;/span&gt;a nuestro DataSource1 y si hemos dejado todo conectado nos aparecerán los datos inmediatamente, sin tener que ejecutar la aplicación.&lt;br /&gt;
&lt;br /&gt;
Y con eso hemos terminado esta explicación. Obviamente, esto se puede complicar mucho más, pero ya&amp;nbsp;debéis&amp;nbsp;tener claro los conceptos básicos.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;NOTA&lt;/span&gt;&lt;br /&gt;
Sobre todo en el caso de consultas que deseamos pasarle parámetros para mostrar resultados diferentes en nuestra DbGrid, recordad que no es conveniente usar CommandText. Básicamente, porque con ello hacemos vulnerable a nuestra aplicación a ataques de SQL.&lt;br /&gt;
&lt;br /&gt;
Es mejor, crear una función con parámetros en el servidor con la que podamos abrir y cerrar la consulta desde nuestra aplicación cliente SIN tener que enviar el código SQL a través de la red.&lt;br /&gt;
Es usar los TSqlServerMethod1 como ya he explicado.&lt;br /&gt;
&lt;br /&gt;
Si hay dudas de cómo hacer esto, me lo&amp;nbsp;hacéis&amp;nbsp;saber y escribo sobre ello.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;--- FIN PASO ADICIONAL PARA USAR BASES DE DATOS (2)&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #ffd966;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/1717599938538793398/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/03/ejemplo-aplicacion-con-base-de-datos-de.html#comment-form' title='8 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/1717599938538793398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/1717599938538793398'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/03/ejemplo-aplicacion-con-base-de-datos-de.html' title='Ejemplo: Aplicación con BASE DE DATOS de 3 de capas multihilo con DBX4 y Delphi XE - multi-threaded application with Database, Delphi XE and DataSnap DBX4'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVO-y5vWwzq9xyDy4GaOyCffSBcD4YM9epjxvd48VjD-10KLRyR70G2eeeS_Xo33MGJQdeIWYU6potIVSTBtEKsK77qijR1hljd7M17-TntoTDodKUU6lXuIZvoKKkNNtnDzoL6v8Q3l8/s72-c/Paso1.png" height="72" width="72"/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-7375810936470762598</id><published>2012-01-21T20:24:00.000+00:00</published><updated>2012-01-21T20:24:11.822+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Manager LITE"/><title type='text'>Gestores de bases de datos</title><content type='html'>Aquí os dejo un enlace para la descarga de las versiones gratuitas del mejor gestor de bases de datos que conozco: SQL Manager.&lt;br /&gt;
Hay una versión para cada base de datos y es gratis.&lt;br /&gt;
Esta versión gratuita tiene todo lo que necesitas:&amp;nbsp; tablas, procedimientos,&amp;nbsp; Triggers, Exceptions, Generadores, etc.&lt;br /&gt;
Es muy sencillo de usar y con una gran potencia.&lt;br /&gt;
&lt;a href=&quot;http://www.sqlmanager.net/en/tools/free&quot; target=&quot;_blank&quot;&gt;SQL Manager LITE&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/7375810936470762598/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/01/gestores-de-bases-de-datos.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/7375810936470762598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/7375810936470762598'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2012/01/gestores-de-bases-de-datos.html' title='Gestores de bases de datos'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-5850237514834480882</id><published>2011-11-27T13:25:00.001+00:00</published><updated>2011-11-27T13:41:12.813+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PNG transparentes con canal Alpha en Delphi XE Alpha channel transparent"/><title type='text'>Usar JPG y PNG transparentes con canal Alpha en Delphi XE</title><content type='html'>Para usar imágenes PNG (con canal Alpha), JPG, etc en Delphi no es necesario instalar componentes adicionales.&lt;br /&gt;
&lt;br /&gt;
La forma en que funcione correctamentes usar el componente TImageList, y luego desde nuestro TButton o desde cualquier otro, usar esas imágenes contenidas en el TImageList.&lt;br /&gt;
&lt;br /&gt;
Actualmente eso sólo es válido para casi todos los componentes como TButton, pero no sirve para unos pocos como TSpeedButton.&lt;br /&gt;
&lt;br /&gt;
Añadimos un TImageList y recordar que todas las imágenes contenidas &quot;deben&quot; tener las mismas dimensiones en pixels, de lo contrario pueden ocurrir efectos indeseados.&lt;br /&gt;
Si tenemos distintos tamaños en las imágenes, sólo hay que poner un TImageList por cada tipo de tamaño.&lt;br /&gt;
&lt;br /&gt;
Antes de añadir las imágenes debemos cambiar unas propiedades del TImageList:&lt;br /&gt;
- &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Heigth &lt;/span&gt;y &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Width&lt;/span&gt;: con las dimensiones exactas (en pixels) de las imágenes que va a contener.&lt;br /&gt;
- Para activar el canal Alpha en los PNG hay que cambiar las siguientes propiedades:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DrawingStyle&lt;/span&gt;: &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;dsTransparent&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; - &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ColorDepth&lt;/span&gt;: &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;cd32Bit&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Y ahora ya podemos añadir las imágenes que deseemos dentro del TImageList y nos saldrán perfectas en nuestros componentes.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/5850237514834480882/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/11/usar-png-transparentes-con-canal-alpha.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/5850237514834480882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/5850237514834480882'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/11/usar-png-transparentes-con-canal-alpha.html' title='Usar JPG y PNG transparentes con canal Alpha en Delphi XE'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-7269019751061305937</id><published>2011-11-19T19:55:00.001+00:00</published><updated>2011-11-19T19:59:34.134+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Comparar archivo texto fuente Compare source text file"/><title type='text'>Comparar dos archivos de código fuente</title><content type='html'>Si en algún momento necesitas comparar dos archivos de código fuente para observar los cambios, os recuerdo un programa magnífico y gratuito: WinMerge.(&lt;a href=&quot;http://winmerge.org/downloads/&quot;&gt;http://winmerge.org/downloads/&lt;/a&gt;)&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
No sólo sirve para Delphi, compara cualquier tipo de archivo de tipo texto (no binarios).&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/7269019751061305937/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/11/comparar-dos-archivos-de-codigo-fuente.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/7269019751061305937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/7269019751061305937'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/11/comparar-dos-archivos-de-codigo-fuente.html' title='Comparar dos archivos de código fuente'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-8347715317670348802</id><published>2011-11-17T00:46:00.001+00:00</published><updated>2011-11-17T00:52:43.666+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Word no puede completar guardar debido a un error de permiso de archivo"/><title type='text'>MS Word: Word no puede completar guardar debido a un error de permiso de archivo</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Arial, Verdana, Tahoma, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;Aunque este blog es de Delphi, haré una excepción - try .. except, je je - para los casos en los veo que la gente tiene un problema al que nadie le da una solución.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Arial, Verdana, Tahoma, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Arial, Verdana, Tahoma, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;Para todos aquellos a los que al grabar un archivo con Word les sale el siguiente mensaje&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Arial, Verdana, Tahoma, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&quot;Word no puede completar guardar debido a un error de permiso de archivo&quot;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Arial, Verdana, Tahoma, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;y si ya están hartos de no obtener respuesta, pues la solución es la siguiente:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Arial, Verdana, Tahoma, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Arial, Verdana, Tahoma, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;En Word 2003: Ir al menú &quot;herramientas&quot;, &quot;opciones&quot;, pestaña &quot;Guardar&quot;, sólo hay que desmarcar la casilla &quot;Permitir guardar en segundo plano&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Arial, Verdana, Tahoma, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Arial, Verdana, Tahoma, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;En el resto de versiones, puede cambiar un poco pero hay poca diferencia para encontrarlo.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: &#39;Segoe UI&#39;, Arial, Verdana, Tahoma, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px; line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/8347715317670348802/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/11/ms-word-word-no-puede-completar-guardar.html#comment-form' title='6 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/8347715317670348802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/8347715317670348802'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/11/ms-word-word-no-puede-completar-guardar.html' title='MS Word: Word no puede completar guardar debido a un error de permiso de archivo'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-8657504400126052275</id><published>2011-11-14T00:41:00.001+00:00</published><updated>2011-11-14T01:00:41.224+00:00</updated><title type='text'>Somos dinosaurios?</title><content type='html'>&lt;div&gt;
Hasta hace unos años estaba internet inundado de ejemplos de todo tipo sobre Delphi.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Eso ha desaparecido y lo único que se escribe sobre Delphi es la publicidad que expone Embarcadero, una y otra vez.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Actualmente páginas con código fuente interesante y &quot;fresco&quot; prácticamente no existen.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
He intentado poner mi granito de arena en este sentido, y a la vez que yo enseño lo poco que sé, esperaba vosotros también compartierais con los demás lo que&amp;nbsp;sabéis, o bien poniendo código en esta blog, o poniendo enlaces a vuestros blogs o web, o al menos dejando mensajes, para que los demás&amp;nbsp;supiéramos&amp;nbsp;que&amp;nbsp;existís.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Pero en lugar de conseguir que este blog sea un punto de encuentro para todos, lo que se ha hecho es entrar en este blog, aprender y/o copiar lo que se pueda y salir sin decir ni adiós.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Eso, no sólo en Delphi, sino en el resto de actividades de nuestras vidas no es como deberían ser las cosas.&lt;/div&gt;
&lt;div&gt;
Creo que todos deberíamos reflexionar porque este sistema de lo mio es mío y lo de los demás también es mío no nos lleva a un buen resultado ni con Delphi ni con nada.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
O todos &amp;nbsp;ponemos nuestro granito de arena para levantar Delphi y compartir todo tipo de código, o tanto Delphi como nosotros mismos estamos abocados a la desaparición, cual dinosaurios.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
La gran revolución de Delphi fue el innumerable código que había sobre cualquier tema, o eso regresa o nos limitaremos a mantener nuestras viejas aplicaciones hechas en Delphi 7 hasta que un día no den más de sí y en ese momento se acabará todo.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Escribid, compartid, haceos ver, tanto para mi como para el resto del mundo. Compartir lo que&amp;nbsp;sabéis&amp;nbsp;aunque os parezca que os quedaréis&amp;nbsp;vacíos, lo que os pasará es que os será devuelto con creces a través de otras decenas de código que otros también compartirán.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Espero que mi reflexión os haga pensar.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/8657504400126052275/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/11/somos-dinosaurios.html#comment-form' title='8 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/8657504400126052275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/8657504400126052275'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/11/somos-dinosaurios.html' title='Somos dinosaurios?'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-9109969237918989785</id><published>2011-10-12T19:11:00.000+01:00</published><updated>2011-10-12T19:11:18.988+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ventana Clave acceso access key window splash Delphi XE"/><title type='text'>Ventana de Clave de acceso o de Splash - access key window</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Si necesitas poner una ventana en tu aplicación para solicitar una clave de acceso, incluso una de splash este es un buen método.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Abre el código del proyecto (menú Project - View Source) y pon lo siguiente:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: monospace;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp; Application&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;Initialize&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp; // Esto es de XE, y te permite ocultar tu aplicación en la barra de tareas.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; Application&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;MainFormOnTaskbar&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw2&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp; // Creamos la ventana dónde se pedirá la clave&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; Application&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;CreateForm&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;TPtClave&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;,&lt;/span&gt;&amp;nbsp;PtClave&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp; // Creamos, si lo vamos a usar, el módulo de datos&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; Application&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;CreateForm&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;TClientModule1&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;,&lt;/span&gt;&amp;nbsp;ClientModule1&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp; // Abrimos la ventana de Clave en forma Modal&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; PtClave&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;ShowModal&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp; // Guardamos el resultado de nuestra ventana Clave en la variable Rdo&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp; // La ventana nos devolverá MrOK si se identificó correctamente&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp; Rdo&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp;PtClave&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;ModalResult&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp; // Dado que vamos a liberar la pantalla clave, guardamos los datos de usuario &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;que los podemos necesitar en nuestra apliación principal.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; UsuarioNombre&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;PtClave&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;EditUsuario&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp; // Liberamos la ventana de Clave&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; PtClave&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Free&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: monospace;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: monospace;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;font-weight: bold;&quot;&gt;&amp;nbsp;&lt;/span&gt;// si todo fue bien, creamos nuestra aplicación&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: monospace; font-weight: bold;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&amp;nbsp; if&lt;/span&gt;&amp;nbsp;Rdo&amp;nbsp;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;MrOK&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;then&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; Application&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;CreateForm&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;TPtPrincipal&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;,&lt;/span&gt;&amp;nbsp;PtPrincipal&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp; &amp;nbsp; // le pasamos a la aplicación el dato del usuario identificado, para &amp;nbsp; mostrarlo en un panel por ejemplo.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;PtPrincipal&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;PanelUsuario&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;caption&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;UsuarioNombre&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Application&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Run&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #000066; font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/9109969237918989785/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/10/ventana-de-clave-de-acceso-o-de-splash.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/9109969237918989785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/9109969237918989785'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/10/ventana-de-clave-de-acceso-o-de-splash.html' title='Ventana de Clave de acceso o de Splash - access key window'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-2183530071923848829</id><published>2011-10-01T13:31:00.000+01:00</published><updated>2012-03-28T22:41:51.154+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apagar encender pantalla Turn on off display Delphi XE"/><title type='text'>Controlar la pantalla y detener la aplicación - Control the display and delay the application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Con este ejemplo vemos dos temas:&lt;br /&gt;
- Controlar la pantalla de nuestro ordenador.&lt;br /&gt;
- Detener nuestra aplicación durante un tiempo, que es un tema del que parece haber muchas dudas.&lt;br /&gt;
&lt;br /&gt;
Poner un TButton en el Form y poco más.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #fcfcfc; font-family: monospace; white-space: pre;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;procedure&lt;/span&gt; TForm1.&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Button1Click&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;Sender: &lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;TObject&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-size: x-small; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;co1&quot; style=&quot;color: grey; font-size: x-small; font-style: italic;&quot;&gt;// Poner en standby la pantalla&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;TareasConPantalla &lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font-weight: bold; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000020; font-size: x-small;&quot;&gt; &amp;nbsp;// Pausamos 5 segundos&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;de2&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;  sleep &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(5*1&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc;&quot;&gt;000&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000020;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;co1&quot; style=&quot;color: grey; font-size: x-small; font-style: italic;&quot;&gt;// Apagar la pantalla&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;TareasConPantalla &lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000020; font-size: x-small;&quot;&gt; &amp;nbsp;// Pausamos 5 segundos&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;de1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000020;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;sleep &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc;&quot;&gt;5*1000&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000020;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;co1&quot; style=&quot;color: grey; font-size: x-small; font-style: italic;&quot;&gt;// Encender la pantalla&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font-weight: bold; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;TareasConPantalla &lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;-&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;procedure&lt;/span&gt; TForm1.&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;TareasConPantalla&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;Tarea:&lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;integer&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font-weight: bold; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-size: x-small; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;SendMessage&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;Application.&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Handle&lt;/span&gt;, WM_SYSCOMMAND, SC_MONITORPOWER, Tarea&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;end&lt;/span&gt;; &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/2183530071923848829/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/10/contolar-la-pantalla-y-detener-la.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/2183530071923848829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/2183530071923848829'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/10/contolar-la-pantalla-y-detener-la.html' title='Controlar la pantalla y detener la aplicación - Control the display and delay the application'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-6257450896805935645</id><published>2011-10-01T13:05:00.000+01:00</published><updated>2011-10-01T13:05:56.885+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sincronizar hora synchronize time Delphi XE"/><title type='text'>Sincronizar hora - synchronize time - Delphi XE</title><content type='html'>&lt;br /&gt;
Para aquellos que quieran sincronizar la hora con un servidor horario, esta es una buena fórmula.&lt;br /&gt;
&lt;br /&gt;
Útil para ponerlo en el inicio de Windows en todos los ordenadores de una red y así tenerlos todos con la misma hora.&lt;br /&gt;
&lt;br /&gt;
La sincronización, al contrario de la que efectua Windows, es instantánea.&lt;br /&gt;
Para mostrar algo más como se trabaja con las fechas y para darle algo más de utilidad, que tiene muchas, he puesto que si el desface supera los 5 minutos, que muestre un mensaje.&lt;br /&gt;
&lt;br /&gt;
Espero que os sea de utilidad.&lt;br /&gt;
&lt;br /&gt;
Antes de nada, en nuestro Form:&lt;br /&gt;
&amp;nbsp;- Añadir un componente &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TIdSNTP&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;- Añadir al uses:&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp;Dateutils&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #fcfcfc; font-family: monospace; white-space: pre;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;procedure&lt;/span&gt; SincronizarHora;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;kw2&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;var&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;SystemTimeIni, SystemTimeFin: TSystemTime;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;SegundosDeDiferencia:&lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;longInt&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font-weight: bold; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;ServidorHorario:&lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;String&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;MaxMinutosDesface:&lt;span class=&quot;kw4&quot; style=&quot;color: #993333;&quot;&gt;integer&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;  &lt;span class=&quot;co1&quot; style=&quot;color: grey; font-style: italic;&quot;&gt;// VARIABLES A DEFINIR&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;  ServidorHorario :=  &lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&#39;hora.rediris.es&#39;&lt;/span&gt; ;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font-weight: bold; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;  MaxMinutosDesface := &lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc;&quot;&gt;5&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;try&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;  GetLocalTime&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;SystemTimeIni&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;  idSNTP1.&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Active&lt;/span&gt; := &lt;span class=&quot;kw2&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;False&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font-weight: bold; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;  idSNTP1.&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Host&lt;/span&gt; := ServidorHorario;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;  idSNTP1.&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Active&lt;/span&gt; := &lt;span class=&quot;kw2&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;True&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;  idSNTP1.&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Active&lt;/span&gt; := &lt;span class=&quot;kw2&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;False&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000020;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000020;&quot;&gt;&lt;b&gt; idSNTP1.&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600; font-weight: bold;&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000020;&quot;&gt;&lt;b&gt; &amp;lt;&amp;gt; &lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000020;&quot;&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;     &lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;     &lt;span class=&quot;co1&quot; style=&quot;color: grey; font-style: italic;&quot;&gt;// Convertimos la hora devuelta por idSNTO a hora del sistema&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;     DateTimeToSystemTime&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;idSNTP1.&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;DateTime&lt;/span&gt;,SystemTimeFin&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;     &lt;span class=&quot;co1&quot; style=&quot;color: grey; font-style: italic;&quot;&gt;// Ponemos en hora el sistema&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font-weight: bold; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;     SetLocalTime&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;SystemTimeFin&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;     &lt;span class=&quot;co1&quot; style=&quot;color: grey; font-style: italic;&quot;&gt;// Indicarle a Windows el cambio&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;     PostMessage&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;HWND_BROADCAST,WM_TIMECHANGE,&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;,&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;     &lt;span class=&quot;co1&quot; style=&quot;color: grey; font-style: italic;&quot;&gt;// Calculamos el tiempo de desface&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;     SegundosDeDiferencia := MilliSecondsBetween &lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;SystemTimeToDateTime &lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;SystemTimeFin&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;                                       SystemTimeToDateTime &lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;SystemTimeIni&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc;&quot;&gt;1000&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font-weight: bold; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;     &lt;span class=&quot;co1&quot; style=&quot;color: grey; font-style: italic;&quot;&gt;// Si es superior a los minutos estimados, mostramos un mensaje.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;     &lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;if&lt;/span&gt; SegundosDeDiferencia &amp;gt; &lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc;&quot;&gt;60&lt;/span&gt; * MaxMinutosDesface&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;kw3&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000020;&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;showmessage&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000020;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&#39;Revisar pila interna del ordenador&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000020;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;     end&lt;/span&gt;; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: grey; font-style: italic;&quot;&gt;// END IF&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;except&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li2&quot; style=&quot;color: #006060; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font-weight: bold; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de2&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;    &lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;on&lt;/span&gt; E : Exception &lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;do&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;      &lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;ShowMessage&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&#39; Error al sincronizar hora: &#39;&lt;/span&gt;+&lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;chr&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: #cc66cc;&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;+E.&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Message&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #66cc66;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;end&lt;/span&gt;; // ENND TRY&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;li1&quot; style=&quot;color: #003030; font-family: &#39;Courier New&#39;, Courier, monospace; font-style: normal; font: normal normal normal 95%/normal &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;de1&quot; style=&quot;color: #000020; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;end&lt;/span&gt;; &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/6257450896805935645/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/10/sincronizar-hora-synchronize-time.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/6257450896805935645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/6257450896805935645'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/10/sincronizar-hora-synchronize-time.html' title='Sincronizar hora - synchronize time - Delphi XE'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-6262802582726470211</id><published>2011-09-25T01:07:00.000+01:00</published><updated>2011-09-26T18:58:22.698+01:00</updated><title type='text'>Hay alguien ahí??</title><content type='html'>Si os parece interesante el contenido del blog os agradecería dos cosas:&lt;br /&gt;
-&amp;nbsp;Que escribieseis vuestros comentarios.&lt;br /&gt;
- y que cuando os fuera posible&amp;nbsp;hicierais&amp;nbsp;clic sobre los anunciantes que también son importantes.&lt;br /&gt;
&lt;br /&gt;
Ambas son formas de mantener viva la ilusión por continuar con este blog empleando horas de sueño para que no se apague la llama de Delphi y ser de utilidad a compañeros.&lt;br /&gt;
&lt;br /&gt;
Gracias a todos.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/6262802582726470211/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/vosotros-tambien-me-podeis-ayudar.html#comment-form' title='17 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/6262802582726470211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/6262802582726470211'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/vosotros-tambien-me-podeis-ayudar.html' title='Hay alguien ahí??'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>17</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-6503519642868502638</id><published>2011-09-25T01:01:00.000+01:00</published><updated>2011-09-25T01:01:28.029+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delphi XE Firebird DataSnap DBX4 Crear Base de Datos Create DabaBase"/><title type='text'>Crear Base de Datos - DataBase Create</title><content type='html'>Nuestro siguiente ejemplo será una aplicación Cliente/Servidor con Firebird como motor de la base de datos, y para ello vamos a necesitar previamente&amp;nbsp;una base de datos con algunos datos.&lt;br /&gt;
&lt;br /&gt;
Para aquellos que no estén habituados con este tema, les explico brevemente como crear una base de datos con una tabla, un ejemplo muy básico, que luego podremos ir ampliando tan sólo repitiendo algunos de los pasos que se muestran a continuación.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;Cambiar Firebird por otra es un tema muy simple, aunque en mi opinión, ya es hora de que relancemos Firebird como la magnífica base de datos que es.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Yo uso un magnífico programa que te permite usar características avanzadas de Firebird &amp;nbsp;sin apenas conocimientos.&lt;br /&gt;
Se llama &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;SQL Manager Lite 2008&lt;/span&gt;. Funciona perfectamente con Firebird 2.5 y es GRATUITO.&lt;br /&gt;
Si no lo podeis conseguir avisadme y pongo un enlace para su descarga, porque el fabricante ya no saca más esta versión gratuita.&lt;br /&gt;
&lt;br /&gt;
En nuestro caso crearemos una base de datos llamada Demo.fdb en Unicode (UTF8)&lt;br /&gt;
&lt;br /&gt;
Si no&amp;nbsp;tenéis&amp;nbsp;un programa como este, lo mejor es ejecutar el siguiente script en vuestra base de datos:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;CREATE DATABASE &#39;127.0.0.1/gds_db:C:\Demo\Demo.fdb&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;USER &#39;SYSDBA&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;PASSWORD &#39;masterkey&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;PAGE_SIZE = 4096&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DEFAULT CHARACTER SET UTF8&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
Es importante usar&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt; UTF8 (unicode)&lt;/span&gt;, cualquier otra cosa es algo del pasado. Ya que estamos aprendiendo estas cosas nuevas, hay que dejar el pasado atrás, al menos de forma general, pueden haber casos, pero que sean la excepción.&lt;br /&gt;
&lt;br /&gt;
Para aquellos que no estén familiarizados con unicode, decirles que Delphi XE (y algunas versiones anteriores) ya lo implementa, y entre las ventajas más impactantes es que pueden definir variables como &quot;año&quot;, por lo que ya no hay que definir cosas como &quot;anno&quot;.&lt;br /&gt;
&lt;br /&gt;
Con respecto a la base de datos, podemos guardar datos como la palabra &quot;Año&quot;, y si lo ve un alemán o un chino, se les mostrará la palabra &quot;Año&quot;, y no un conjunto de símbolos raros.&lt;br /&gt;
&lt;br /&gt;
Un paso previo es definir un alias a nuestra base de datos, una interesante opción de Firebird.&lt;br /&gt;
Para ello buscamos el archivo &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;aliases.conf&lt;/span&gt; en la carpeta de firebird.&lt;br /&gt;
En mi caso, que uso Windows 7 x64 y Firebird x64 esa carpeta es:&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;C:\Program Files\Firebird\Firebird_2_5&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Mostrará un contenido como el siguiente, y añadimos al final nuestro alias.&lt;br /&gt;
#&lt;br /&gt;
# List of known database aliases&lt;br /&gt;
# ------------------------------&lt;br /&gt;
#&lt;br /&gt;
# Examples:&lt;br /&gt;
#&lt;br /&gt;
# &amp;nbsp; dummy = c:\data\dummy.fdb&lt;br /&gt;
# &lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;AliasDemo = &quot;C:\Demo\DEMO.FDB&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Eso nos permitirá usar el alias en lugar de la dirección completa de la base de datos lo que nos permite mejorar tanto en comodidad como en seguridad, ya que no expondremos la ruta de nuestra base de datos.&lt;br /&gt;
&lt;br /&gt;
Ahora registraremos nuestra base de datos en Delphi, e incluso podrémos crear desde Delphi las tablas, al menos de forma básica.&lt;br /&gt;
&lt;br /&gt;
Está claro que para generar una base de datos compleja hay que usar algún programa especializado como el que ya comenté (SQL Manager Lite 2008)&lt;br /&gt;
&lt;br /&gt;
Vamos a la pestaña &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DataExplorer&lt;/span&gt;, seleccionamos&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; Firebird&lt;/span&gt;, pulsamos el botón derecho y elegimos &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Add New Connection&lt;/span&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi05OnUSfX4WBclnfd7aRgDNhLrzhBoQS9Wi17ZKIeqNB0YxP97NtAmlXQ_Gi9MtSYlgJ3qEbBFqy9m7hY-KRmYjVAcHipRfGmis7dMwoaV7H-f0wwzF_lkSGv13JZkpYgJamOimFAVy3w/s1600/Seleccionar+BD.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi05OnUSfX4WBclnfd7aRgDNhLrzhBoQS9Wi17ZKIeqNB0YxP97NtAmlXQ_Gi9MtSYlgJ3qEbBFqy9m7hY-KRmYjVAcHipRfGmis7dMwoaV7H-f0wwzF_lkSGv13JZkpYgJamOimFAVy3w/s640/Seleccionar+BD.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ahora nos pregunta el nombre de la nueva conexión (no de la base de datos): escribimos &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ConexionDemo&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSOzsyYAvePMU-3Jva7ZjVkyRuzktz17y_NWD2H3O3bIqN9QoWUuV1m__fir86VlczDa8B-8itIT43PIoJ329m4NpChDBYe6zpD9O8Ei7uQinr5a5IXS5dSRkt77hxSGlBBp0UDRHNGGE/s1600/Nueva+conexi%25C3%25B3n.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSOzsyYAvePMU-3Jva7ZjVkyRuzktz17y_NWD2H3O3bIqN9QoWUuV1m__fir86VlczDa8B-8itIT43PIoJ329m4NpChDBYe6zpD9O8Ei7uQinr5a5IXS5dSRkt77hxSGlBBp0UDRHNGGE/s1600/Nueva+conexi%25C3%25B3n.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
Luego tenemos que cambiar los parámetros de esa conexión para indicarle que base de datos usamos.&lt;br /&gt;
Para ello pulsamos el botón derecho del ratón sobre nuestra conexión &amp;nbsp;&quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Conexión Demo&lt;/span&gt;&quot; y elegimos &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Modify Connection&lt;/span&gt;&quot;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr2uLk3e04OX9YVGcbEwNW9zYZCVrHQqnU0m2y3E1yBElgRmmEMszCnzjkvJ2L5M69YBCN4Fk-UCl3edi0NkfWraDP4ybLzs6cWWr1rdPOYSVOQ7_WgAfgErP17GqjtrD6YNwgsfZUSX8/s1600/Modifcar+conexion.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr2uLk3e04OX9YVGcbEwNW9zYZCVrHQqnU0m2y3E1yBElgRmmEMszCnzjkvJ2L5M69YBCN4Fk-UCl3edi0NkfWraDP4ybLzs6cWWr1rdPOYSVOQ7_WgAfgErP17GqjtrD6YNwgsfZUSX8/s1600/Modifcar+conexion.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
Y como hemos definido un alias, lo que ponemos es el nombre del alias:&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;AliasDemo&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Importante: el alias es tal cual lo hemos definido en aliases.conf, es decir, una sóla palabra, sin ningún tipo de ruta de acceso ni de extensión., en nuestro caso ponemos &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;AliasDemo&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
Si no hubiéramos definido un alias, tenemos que poner el nombre completo, con ruta y extensión, de la base de datos del tipo: &amp;nbsp;C:\Demo\DEMO.FDB&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX0Sk4ZE3gUUSuGfvFV7wqyOY88muSKvmf7kmZCpJoXs0eBdPfMy4O4dCQA7TcfIkTcZa59fQQ5D7ofB7yNEE9EmGtpOCpGU22AKFl8fpWzcRVv1sFvnDplwxpqRV-9e0I1Hz-sid3P5M/s1600/Poner+alias.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;212&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX0Sk4ZE3gUUSuGfvFV7wqyOY88muSKvmf7kmZCpJoXs0eBdPfMy4O4dCQA7TcfIkTcZa59fQQ5D7ofB7yNEE9EmGtpOCpGU22AKFl8fpWzcRVv1sFvnDplwxpqRV-9e0I1Hz-sid3P5M/s320/Poner+alias.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ahora podemos crear una tabla directamente desde Delphi. Para ello, entramos en nuestra conexión &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Conexión Demo&lt;/span&gt;&quot; y sobre &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Tables&lt;/span&gt;, pulsamos el botón derecho del ratón y elegimos &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;New Table&lt;/span&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieXHAhrb83kcCneaqHRIxhYGrZul2X2ew7uZwNavmK6mVBeist_SBqVtBM2JZo7eRlr_ZiJu1NVuI6jMe5I6nMlPckKqhaQut_ywJJq2CoQ2oiOLM9DvPp9hbObMdt9QwZzWPIFbPwcWo/s1600/Nueva+tabla.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieXHAhrb83kcCneaqHRIxhYGrZul2X2ew7uZwNavmK6mVBeist_SBqVtBM2JZo7eRlr_ZiJu1NVuI6jMe5I6nMlPckKqhaQut_ywJJq2CoQ2oiOLM9DvPp9hbObMdt9QwZzWPIFbPwcWo/s1600/Nueva+tabla.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ahora podemos&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; definir los distintos campos&lt;/span&gt; de nuestra tabla que en nuestro caso serán el código y el nombre de los clientes&lt;br /&gt;
Una vez definidos pulsamos el botón derecho sobre esta rejilla y elegimos &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Save Table&lt;/span&gt;&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRG9Glm1dXfyLutHXlzlLRhVYgiQa1E_7ntR6uPByJNzmYvViFHB96Bv92OWpAQMNdHYKHViqdtACMQv8CiqfLwJizh1yGZ6p28v0Ov7iTnTxKbXwQBzDeeWvl7BBNyDT6Pd2d7Lei8J4/s1600/Creado+Tabla.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRG9Glm1dXfyLutHXlzlLRhVYgiQa1E_7ntR6uPByJNzmYvViFHB96Bv92OWpAQMNdHYKHViqdtACMQv8CiqfLwJizh1yGZ6p28v0Ov7iTnTxKbXwQBzDeeWvl7BBNyDT6Pd2d7Lei8J4/s1600/Creado+Tabla.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp;En nuestro caso llamaremos a nuestra tabla &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Clientes &lt;/span&gt;y pulsamos el botón&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;OK&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQF-MG7tDCi9JWha_Jh5_ES5Zyf0oAFPD9vfjI1wFkutZekAcMPU7h4YtbdDaUwYBDD-_-Ot2HP4Weg5czdiAP67YXRtMaZQbBmkkPycKV8ShuDd4THOSiJd8vcYePRDWij_UVBe2jdcc/s1600/Poner+nombre+a+la+tabla.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQF-MG7tDCi9JWha_Jh5_ES5Zyf0oAFPD9vfjI1wFkutZekAcMPU7h4YtbdDaUwYBDD-_-Ot2HP4Weg5czdiAP67YXRtMaZQbBmkkPycKV8ShuDd4THOSiJd8vcYePRDWij_UVBe2jdcc/s1600/Poner+nombre+a+la+tabla.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
Ahora en el &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Data Explorer&lt;/span&gt;, si desplegamos &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Tables&lt;/span&gt;&quot; podemos ver que ya está disponible nuestra nueva tabla &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Clientes&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;span id=&quot;goog_253655695&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_253655696&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5xm6dztChN_xvckT_dPCgaktFaJLeeP16m2nFURdo0jDAB-eeA8Q2b7_oS0pp6vb6eR5MwM6iU-4-13u3ZCfittio4Xs41vR5n0G4-WTR7DengjwK9Ca121lSs47uhQb4pV5yxj1OZ-Y/s1600/Tabla+creada.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5xm6dztChN_xvckT_dPCgaktFaJLeeP16m2nFURdo0jDAB-eeA8Q2b7_oS0pp6vb6eR5MwM6iU-4-13u3ZCfittio4Xs41vR5n0G4-WTR7DengjwK9Ca121lSs47uhQb4pV5yxj1OZ-Y/s1600/Tabla+creada.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Bastará con hacer doble clic sobre nuestra tabla &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Clientes&lt;/span&gt;&quot; para que nos salga una rejilla de datos que nos permitirá introducir datos directamente en nuestra tabla.&lt;br /&gt;
Una vez que hayamos terminado recordad pulsar el botón derecho del ratón sobre la rejilla y pulsar&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; Update&lt;/span&gt; para que los cambios se graben en la base de datos, de lo contrario se perderán.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1EWPlkPLaoM3PND2WmmpuC8twPejGa9N0bEHqicrmso7kXJgQJdW-fEX5Nj4E4d-AimfVhskrXQlnoOq5DGH0kBTCSK_CHaWQz7Ez4_viW_4MixRgu97NrWQ8-d_SsxxKyaLW_LfEA1g/s1600/Grabar+registros.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;163&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1EWPlkPLaoM3PND2WmmpuC8twPejGa9N0bEHqicrmso7kXJgQJdW-fEX5Nj4E4d-AimfVhskrXQlnoOq5DGH0kBTCSK_CHaWQz7Ez4_viW_4MixRgu97NrWQ8-d_SsxxKyaLW_LfEA1g/s320/Grabar+registros.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Y ya tenemos una base de datos, con una tabla y datos en ella.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/6503519642868502638/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/crear-base-de-datos-database-create.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/6503519642868502638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/6503519642868502638'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/crear-base-de-datos-database-create.html' title='Crear Base de Datos - DataBase Create'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi05OnUSfX4WBclnfd7aRgDNhLrzhBoQS9Wi17ZKIeqNB0YxP97NtAmlXQ_Gi9MtSYlgJ3qEbBFqy9m7hY-KRmYjVAcHipRfGmis7dMwoaV7H-f0wwzF_lkSGv13JZkpYgJamOimFAVy3w/s72-c/Seleccionar+BD.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-7908752754926998474</id><published>2011-09-17T12:48:00.000+01:00</published><updated>2011-09-17T13:00:01.746+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Personaliza Rejilla - Custon Data Grid DbGrid"/><title type='text'>Personalizar Rejilla de Datos - Custom Data Grid</title><content type='html'>Esta procedimiento nos permite evitar que cada vez que pongamos una rejilla en un Form, tengamos que ir configurándola a nuestro gusto.&lt;br /&gt;
&lt;br /&gt;
Pon esta función al iniciar un Form, normalmente en el evento OnCreate.&lt;br /&gt;
&lt;br /&gt;
A modo de ejemplo, sólo he puesto el ancho de cada columna que se adapte a lo definido en el DataSet y la fuente al título de la rejilla pero podemos ir incluyendo todas las propiedades que queramos.&lt;br /&gt;
&lt;br /&gt;
Tengamos en cuenta que muchos de los valores ya los coge la rejilla del DataSet, aquí sólo debemos poner los que no queramos que sean los estándar sino personalizados a nuestro gusto.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #f0f0f0; color: #000066; font-family: monospace;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;procedure&lt;/span&gt;&amp;nbsp;InicializarRejilla&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;Rejilla&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;TDBGrid&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #f0f0f0; font-family: monospace;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp;i&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;integer&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp;i&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp;Rejilla&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Columns&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Count&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;do&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp; &amp;nbsp; Rejilla&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Columns&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp;&amp;nbsp;Rejilla&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;DataSource&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;DataSet&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;FieldByName&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;Rejilla&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Columns&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;FieldName&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;DisplayWidth&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp; Rejilla&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;TitleFont&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000066;&quot;&gt;FsBold&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/7908752754926998474/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/esta-procedimiento-nos-permite-evitar.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/7908752754926998474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/7908752754926998474'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/esta-procedimiento-nos-permite-evitar.html' title='Personalizar Rejilla de Datos - Custom Data Grid'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-2884653147934535313</id><published>2011-09-17T12:36:00.000+01:00</published><updated>2011-09-17T12:36:56.823+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Unique file name Delphi XE - Nombre de fichero único."/><title type='text'>Nombre de archivo único - Unique file name</title><content type='html'>Esta función nos devuelve un nombre de archivo único, muy útil cuando trabajamos con archivos temporales de cualquier tipo.&lt;br /&gt;
Podemos enviarle en Prefijo la cadena por la que queremos que comience el nombre.&lt;br /&gt;
Se usa la carpeta temporal de Windows, algo que podemos modificar si lo queremos crearlo en otra carpeta.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: auto; margin-right: auto; margin-top: 0px; width: 1824px;&quot;&gt;
&lt;div class=&quot;delphi&quot; style=&quot;background-color: #f0f0f0; border-bottom-color: rgb(208, 208, 208); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(208, 208, 208); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(208, 208, 208); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(208, 208, 208); border-top-style: solid; border-top-width: 1px; color: #000066; font-family: monospace;&quot;&gt;
&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;function&lt;/span&gt;&amp;nbsp;NombreFicheroUnico&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;Prefijo&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;var&lt;/span&gt;&amp;nbsp;NewTempName&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;,&lt;/span&gt;&amp;nbsp;PathName&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;array&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;color: #006600;&quot;&gt;MAX_PATH&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;]&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;color: #000066;&quot;&gt;Length&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;Prefijo&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Prefijo&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&#39;Tmp&#39;&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; GetTempPath&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;MAX_PATH&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy2&quot; style=&quot;color: #000066;&quot;&gt;@&lt;/span&gt;PathName&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;co1&quot; style=&quot;color: grey; font-style: italic;&quot;&gt;// busca el directorio temporal de Windows&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; GetTempFileName&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;PathName&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-weight: bold;&quot;&gt;PChar&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;(&lt;/span&gt;Prefijo&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot; style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sy2&quot; style=&quot;color: #000066;&quot;&gt;@&lt;/span&gt;NewTempName&lt;span class=&quot;br0&quot; style=&quot;color: #000066;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;co1&quot; style=&quot;color: grey; font-style: italic;&quot;&gt;//Devuelve el nombre de fichero único&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; result&amp;nbsp;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sy3&quot; style=&quot;color: #000066;&quot;&gt;=&lt;/span&gt;&amp;nbsp;NewTempName&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;sy1&quot; style=&quot;color: #000066;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/2884653147934535313/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/nombre-de-archivo-unico-unique-file.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/2884653147934535313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/2884653147934535313'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/nombre-de-archivo-unico-unique-file.html' title='Nombre de archivo único - Unique file name'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-3476862019896131372</id><published>2011-09-13T19:15:00.000+01:00</published><updated>2011-09-13T19:15:31.411+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ejemplo: Aplicación de 3 capas multihilo con DBX4 y Delphi XE - multi-threaded application with Delphi XE and DataSnap DBX4"/><title type='text'>Ejemplo: Aplicación de 3 capas multihilo con DBX4 y Delphi XE - multi-threaded application with Delphi XE and DataSnap DBX4</title><content type='html'>Haremos un ejemplo de aplicación cliente servidor muy sencilla y lo explicaré lo más detallada posible.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;u&gt;&lt;b&gt;APLICACIÓN SERVIDOR&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;u&gt;Paso 1 Servidor&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Abrimos Delphi y vamos a &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;File &lt;/span&gt;- &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;New &lt;/span&gt;- &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Other &lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVO-y5vWwzq9xyDy4GaOyCffSBcD4YM9epjxvd48VjD-10KLRyR70G2eeeS_Xo33MGJQdeIWYU6potIVSTBtEKsK77qijR1hljd7M17-TntoTDodKUU6lXuIZvoKKkNNtnDzoL6v8Q3l8/s1600/Paso1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVO-y5vWwzq9xyDy4GaOyCffSBcD4YM9epjxvd48VjD-10KLRyR70G2eeeS_Xo33MGJQdeIWYU6potIVSTBtEKsK77qijR1hljd7M17-TntoTDodKUU6lXuIZvoKKkNNtnDzoL6v8Q3l8/s640/Paso1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;u&gt;&lt;b&gt;Paso 2 Servidor&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
Ahora vamoa a&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp;New Item&lt;/span&gt; elegir &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Delphi Projects&lt;/span&gt;&quot; - &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DataSnap Server&lt;/span&gt;&quot; y hacer clic &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DataSnap Server&lt;/span&gt;&quot; y &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&quot;OK&lt;/span&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGJL8hND2QV8w1RUawZorIrLPs92e9xZsaEN4kT_-4C5cLtaMiurtzON17_53l5zQdSgbJdflrAqyWYYUOAE282_-gBL17zwa5U3PqQT7RmzXxnhX6BNZjc_UHitxOpngDmZ91uB4ioiU/s1600/Paso2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGJL8hND2QV8w1RUawZorIrLPs92e9xZsaEN4kT_-4C5cLtaMiurtzON17_53l5zQdSgbJdflrAqyWYYUOAE282_-gBL17zwa5U3PqQT7RmzXxnhX6BNZjc_UHitxOpngDmZ91uB4ioiU/s640/Paso2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;u&gt;Paso 3: Servidor&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Tipo de Proyecto&lt;br /&gt;
Seleccionar:&lt;br /&gt;
VCL Forms &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Application&lt;/span&gt;: Si se quiere que el servidor tenga una o más ventanas (es nuestro ejemplo)&lt;br /&gt;
Console Applicaton: El servidor aparecerá como una consola de comandos.&lt;br /&gt;
Service application: Si queremos que nuestro servidor se ejecute como un servicio en Windows.&lt;br /&gt;
&lt;br /&gt;
Elegimos y pulsamos &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;NEXT&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYhBWOV0l6Sbi-7FeIRQXkVCH2ip7eGGtm_4BL-KOTDoWZsdyHYL2TZen2FAT7GaNXexYg2PGk7205hvccHioNPuM9WaDLCx1ywgWsVwpGSJ41ACkDfd5eI2tzFGr3SklD_pvx9BkHloM/s1600/Paso3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYhBWOV0l6Sbi-7FeIRQXkVCH2ip7eGGtm_4BL-KOTDoWZsdyHYL2TZen2FAT7GaNXexYg2PGk7205hvccHioNPuM9WaDLCx1ywgWsVwpGSJ41ACkDfd5eI2tzFGr3SklD_pvx9BkHloM/s640/Paso3.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;u&gt;Paso 4: Servidor&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Características del Servidor&lt;br /&gt;
- &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Protocol&lt;/span&gt;s: TCP/IP para una aplicación estandar y HTTP sobre todo para aplicaciones web.&lt;br /&gt;
-&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; Autenticación:&lt;/span&gt;&lt;/span&gt; Si queremos que en nuestro servidor se utilice algún tipo de identificación. No es la autenticación de una base de datos, es un nuevo sistema para proteger el código. No la marcamos&lt;br /&gt;
- &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Server Methods Class&lt;/span&gt;. Nos genera una unidad&amp;nbsp;con dos ejemplos de como usar funciones para compartir con los clientes.&lt;br /&gt;
En nuestro ejemplo lo dejaremos todo con las&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; opciones por defecto&lt;/span&gt; y pulsamos &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;NEXT&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7PWistXTgpANQAypooZBlO9v25PZl1_BqGg45osxBV836POvouVhWxpam3GlP1t-sgenXSC3EZEtVCL1Pqkub0DGtcS9YzWMomw_gdZe0FbBsPC0TSohOYOh-6Nnru-KbsnZls9ab9v4/s1600/Paso4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7PWistXTgpANQAypooZBlO9v25PZl1_BqGg45osxBV836POvouVhWxpam3GlP1t-sgenXSC3EZEtVCL1Pqkub0DGtcS9YzWMomw_gdZe0FbBsPC0TSohOYOh-6Nnru-KbsnZls9ab9v4/s640/Paso4.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;u&gt;Paso 5: Servidor&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Número de Puerto&lt;br /&gt;
Nos dejará elegir el número de puerto que usará nuestra aplicación.&lt;br /&gt;
Nos permitirá chequear si el puerto está en uso e incluso buscar uno libre.&lt;br /&gt;
&lt;br /&gt;
&lt;span id=&quot;goog_327751334&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_327751335&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWA78OcOPOXXDn5ywdFa2KJjkPn1ZjNKuxd9U0tVyEa42NbQx9_uNN_eq6zwT0jlKPEZDtow0sde7IoCqtQFdfvPhv9bsdS-rjmF2t8PbsFA_EHrmn4rBwQji6UpS-KgPfpj5xeacLpBc/s1600/Paso5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWA78OcOPOXXDn5ywdFa2KJjkPn1ZjNKuxd9U0tVyEa42NbQx9_uNN_eq6zwT0jlKPEZDtow0sde7IoCqtQFdfvPhv9bsdS-rjmF2t8PbsFA_EHrmn4rBwQji6UpS-KgPfpj5xeacLpBc/s640/Paso5.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;u&gt;Paso 6: Servidor&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Clase de métodos de servidor&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TComponent&lt;/span&gt;: Cuando queremos que el servidor sólo exponga funciones, sin bases de datos.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TDataModule&lt;/span&gt;: Si queremos que nuestro servidor exponga bases de datos a través de los TDataSetProviders&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TDSServerModule&lt;/span&gt;: Es la versión más completa para bases de datos ya que nos implementa el interface IAppServer&lt;br /&gt;
Nosotros escogemos &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TDSServerModule &lt;/span&gt;y hacemos clic en &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Finish&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU-wmx7ENJ5jCX0GqQr6lDgVqImEehdNTgy5LzhzG2TV9oqGXi5tC-8jF7oir7RO_2g-5iodHDSN8iL92U2lp7h5q8SGDaEJ1uKcooO5_rotIrBFh1YN1DEgvDm4WpNz6-iyXAy828pps/s1600/Paso6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU-wmx7ENJ5jCX0GqQr6lDgVqImEehdNTgy5LzhzG2TV9oqGXi5tC-8jF7oir7RO_2g-5iodHDSN8iL92U2lp7h5q8SGDaEJ1uKcooO5_rotIrBFh1YN1DEgvDm4WpNz6-iyXAy828pps/s640/Paso6.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Ya tenemos nuestra versión básica de Servidor&lt;br /&gt;
Ahora nos aparece el proyecto con las distintas forms creadas&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ServerContainerUnit1&lt;/span&gt;: unidad para las características del servidor&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ServerMethodsUnit1&lt;/span&gt;: almacena los métodos que exportará el servidor, es decir, los que la aplicación cliente podrá usar.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Unit1&lt;/span&gt;: nuestro form principal&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhROKmhCvn14koIXnGDrsvCOXwt4efK2IaJUWv8TbwHZYf84buELdD_9Tb12Zn6VQSzsQAB6V8Y-UBUbgM-mwcbqcQ39fvxAKzsk4Op6zfJobNfA-v6NgShmvUNJxImBaOSSGoQ1N_VNiM/s1600/Paso7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhROKmhCvn14koIXnGDrsvCOXwt4efK2IaJUWv8TbwHZYf84buELdD_9Tb12Zn6VQSzsQAB6V8Y-UBUbgM-mwcbqcQ39fvxAKzsk4Op6zfJobNfA-v6NgShmvUNJxImBaOSSGoQ1N_VNiM/s640/Paso7.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora retocamos algo nuestro servidor:&lt;br /&gt;
Vamos a &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ServerContainerUnit1&lt;/span&gt;.pas en la pestaña de &quot;Diseño&quot;&lt;br /&gt;
&lt;br /&gt;
Al componente &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DSServer1 &lt;/span&gt;le ponemos la propiedad &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;AutoStart&lt;/span&gt;&quot; a &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;False&lt;/span&gt;, para así poder iniciar/parar el servidor de forma manual desde nuestro form principal.&lt;br /&gt;
&lt;br /&gt;
La propiedad &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;HideDsAdmin &lt;/span&gt;es útil cuando la aplicación está totalmente terminada porque si la ponemos a TRUE no serán visibles los métodos que el servidor publique. así desde otra aplicación cliente de otra persona no se podrían usar nuestros métodos. Pero en tiempo de desarrollo hay que dejarla a &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;FALSE&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Luego en el componente DSServerClass, en el evento &quot;On Get Class&quot; vemos que el asistente ha creado el siguiente código:&lt;br /&gt;
PersistentClass := ServerMethodsUnit1.&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TServerMethods1&lt;/span&gt;;&lt;br /&gt;
Es la manera de decir dónde están las cosas que el servidor va a compartir.&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;MUY IMPORTANTE&lt;/u&gt;&lt;/b&gt;: anotar ese &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TServerMethods1 &lt;/span&gt;ya que lo vamos a necesitar en el lado del cliente a la hora de configurarlo.&lt;br /&gt;
&lt;br /&gt;
El &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DSTCPServerTransport1 &lt;/span&gt;es donde configuramos el máximo hilos, el puerto, y una cosa muy importante: los filtros para el transporte de datos. De esto último hay un ejemplo de comprimir las transmisiones en este blog.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjafAswP_rpM8PavMrW4MRhzPOSjzi1vPItUYw6_nZV3QQD87hr8VVGs79DQP2rp9QP3RgdgCHcIpyqY-ryhl4Z-5Ir91_h6Tsj4djWgB7YuZZmxLAmIU0G_q1wCPgmvwgthFA9AHmlPhk/s1600/Paso8.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjafAswP_rpM8PavMrW4MRhzPOSjzi1vPItUYw6_nZV3QQD87hr8VVGs79DQP2rp9QP3RgdgCHcIpyqY-ryhl4Z-5Ir91_h6Tsj4djWgB7YuZZmxLAmIU0G_q1wCPgmvwgthFA9AHmlPhk/s640/Paso8.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Luego en el componente &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DSServerClass1 &lt;/span&gt;ponemos la propiedad &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;LifeCycle &lt;/span&gt;a &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;session&lt;/span&gt;&lt;br /&gt;
Los tipos posibles son&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Server&lt;/span&gt;: Un servidor para todos los clientes. El segundo que intenta acceder a un dato tiene que esperar.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Sesión&lt;/span&gt;. Cada cliente crea su servidor. Nadie espera salvo uno mismo si es multihilo. Guarda la memoria hasta que cierre sesión. Para iniciarse es mejor esta opción porque la Invocation puede hacer cosas que no esperamos.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Invocación&lt;/span&gt;. Mayor coste de proceso. No gasta memoria. No hay esperas. El problema que puede aparecer y que requiere de más atención es que como el TSQLConnection se cierra cuando no hay ningún acceso abierto, puede darse el caso de que las consultas nos devuelvan valores inesperados, como si acabásemos de entrar de nuevo.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbREEFhjcqkYUE4MzI1j5xxKQJ_-VYy5JjbVlf6yJsnfhHgbrI3HJHalkptBWMR6bf0flsj08hO8qszbamA8GKdFVxD755JCh1o3WaCuvukSZsQdxCBB1cz3bfcr5lEpDjR-Ba53-f2lc/s1600/Paso9.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbREEFhjcqkYUE4MzI1j5xxKQJ_-VYy5JjbVlf6yJsnfhHgbrI3HJHalkptBWMR6bf0flsj08hO8qszbamA8GKdFVxD755JCh1o3WaCuvukSZsQdxCBB1cz3bfcr5lEpDjR-Ba53-f2lc/s640/Paso9.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;La unidad ServerMethodUnit1&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
En la unidad ServerMethodsUnit1 ponemos todo lo que queremos que el servidor publique para los clientes: Funciones, TQuery, TTable, ...&lt;br /&gt;
&lt;br /&gt;
Si son function o procedure y las creamos de forma automática con SHIFT-CTRL-C recodar que se habrán creado en la zona Private y entonces no serán publicadas en el servidor.&lt;br /&gt;
&lt;b&gt;Recordar declarar&amp;nbsp;&amp;nbsp;function o procedure&amp;nbsp;en el en Public.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Si en el asistente de servidor hemos marcado la casilla de &quot;Sample Methods&quot; veremos que estarán creadas dos funciones de ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;function TServerMethods1.EchoString(Value: string): string;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; Result := Value;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;end;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;function TServerMethods1.ReverseString(Value: string): string;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; Result := StrUtils.ReverseString(Value);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;end;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Vamos a añadir nuestro ejemplo simple pero algo más útil: saber la hora que tiene el servidor.&lt;br /&gt;
Podría permitirnos sincronizar ordenadores o grabar en un registro la hora real del servidor y no la del pc desde donde lo ejecuta el cliente.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Function TServerMethods2.HoraEnServidor: TDateTime;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; result := now;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;end;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
En esta unidad en donde podríamos, por ejmplo, poner los &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TSQLQuery&lt;/span&gt; con sus&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TDAtaSetProvider &lt;/span&gt;para suministrar datos de nuestra base de datos a los clientes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora abrimos la &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;unit1 &lt;/span&gt;y le ponemos un &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TButton &lt;/span&gt;con el &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;caption &lt;/span&gt;&quot;iniciar&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq_3iqsa0JczIXKNAnmIVJZiHOVRvLpQtxs7UvXgMXd0aupvoGX75rUSUJCSXQOwjDjrOMkXfbSsNcJqeL4tYaIjZn9RXOulzj5EVeIB62CqR-wcZqFj9KDYWhUtuhjweP1P8QCH2q_K8/s1600/Paso10.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq_3iqsa0JczIXKNAnmIVJZiHOVRvLpQtxs7UvXgMXd0aupvoGX75rUSUJCSXQOwjDjrOMkXfbSsNcJqeL4tYaIjZn9RXOulzj5EVeIB62CqR-wcZqFj9KDYWhUtuhjweP1P8QCH2q_K8/s640/Paso10.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;Añadimos al &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;uses &lt;/span&gt;la unidad:&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ServerContainerUnit1&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
Y en el evento&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; &quot;on click&quot;&lt;/span&gt; del &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TButton &lt;/span&gt;ponemos:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;begin&amp;nbsp; if ServerContainer1.DSServer1.started then&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;begin&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ServerContainer1.DSServer1.Stop;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Button1.Caption := &#39;Iniciar&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;end&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; else&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;begin&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ServerContainer1.DSServer1.Start;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Button1.Caption := &#39;Parar&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;end;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;end;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwC_Wr95U61L0uDC8er-CG6z8sl9SaE-Fnc1HeBkmqe51FBN9-1Vm2XAQVU6-VQAGk0YTTEdkUUAYVhlTcIX9rbzp0BRFWQktKJZQn2AEHjGDQYfWI1zNTRSfaOHK8Sf5BiTDo9o9G21s/s1600/Paso11.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwC_Wr95U61L0uDC8er-CG6z8sl9SaE-Fnc1HeBkmqe51FBN9-1Vm2XAQVU6-VQAGk0YTTEdkUUAYVhlTcIX9rbzp0BRFWQktKJZQn2AEHjGDQYfWI1zNTRSfaOHK8Sf5BiTDo9o9G21s/s640/Paso11.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora grabamos todo el proyecto en una carpeta, mejor separando al servidor del cliente:&lt;br /&gt;
Proyecto\Servidor&lt;br /&gt;
Y grabamos el proyecto con el nombre &quot;servidor&quot;&lt;br /&gt;
&lt;br /&gt;
MUY IMPORTANTE: ejecutamos el servidor en modo &quot;sin depuración&quot; haciendo clic con el botón secundario del ratón sobre el proyecto Servidor y eligiendo &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Run Without Debugging&lt;/span&gt;&quot;, porque a la hora de configurar y ejecutar el cliente lo vamos a necesitar&lt;br /&gt;
&lt;br /&gt;
Dado que hemos creado un servidor con inicio manual, recordar una vez ejecutado el servidor hacer clic sobre el botón iniciar del servidor para que esté totalmente operativo.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIvx9FDuK24vFmagd5SOejvTAua0SoSeL4JBge_vr4PchsvhUY6MSBbUh8KD8stgdDZ-tuTJFVo-tR8xgNYekObpKCJYPoY7WZ5XJZ2GMiVhYqkk5xOfqfcp19VOX2CzHfRS8tp0LjOnA/s1600/Paso12.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIvx9FDuK24vFmagd5SOejvTAua0SoSeL4JBge_vr4PchsvhUY6MSBbUh8KD8stgdDZ-tuTJFVo-tR8xgNYekObpKCJYPoY7WZ5XJZ2GMiVhYqkk5xOfqfcp19VOX2CzHfRS8tp0LjOnA/s640/Paso12.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;u&gt;&lt;b&gt;&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;u&gt;&lt;b&gt;APLICACIÓN CLIENTE&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
Sobre el proyecto pulsamos el botón derecho del ratón y elegimos &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Add New Project&lt;/span&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRJp3LOs8OlxdbMnrQl9xb8Hdw-SwwgWiHvJf6X4XnYJ_Fiqjc8af8Uv9P3-SrkgGn65cEZ6n_FQGOrT1AjLgar772Kguo6dN2K9Qwm4BCfOC04teERLmEntwDmZ3UiWkw-JR-y8ndQTY/s1600/ClienteAddNewProject.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRJp3LOs8OlxdbMnrQl9xb8Hdw-SwwgWiHvJf6X4XnYJ_Fiqjc8af8Uv9P3-SrkgGn65cEZ6n_FQGOrT1AjLgar772Kguo6dN2K9Qwm4BCfOC04teERLmEntwDmZ3UiWkw-JR-y8ndQTY/s640/ClienteAddNewProject.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Hacemos clic sobre &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Delphi Projects&lt;/span&gt;&quot; y seleccionamos &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;VCL Form Application&lt;/span&gt;&quot; y &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;OK&lt;/span&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh51aY1Z0GkPqWI_LJuLE9GwvJlXmzWAu7aS56raebwsaJzoUJ-41F5_tqLCbPy4AVoZeo_yHXHIIkX2Ql2bXhcVlp0AzC-yj1D2KdxYcQC1ab2uRXa76NnyzXQyNlEXBAA8t_DQdpbe5s/s1600/ClienteVCLApplication.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh51aY1Z0GkPqWI_LJuLE9GwvJlXmzWAu7aS56raebwsaJzoUJ-41F5_tqLCbPy4AVoZeo_yHXHIIkX2Ql2bXhcVlp0AzC-yj1D2KdxYcQC1ab2uRXa76NnyzXQyNlEXBAA8t_DQdpbe5s/s640/ClienteVCLApplication.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
RECORDAR:&lt;br /&gt;
&amp;nbsp;- que el servidor tienen que estar ejecutándose e iniciado.&lt;br /&gt;
- El proyecto activo en Delphi (el que está en negrita a la derecha) sea el del cliente, porque de lo contrario lo que vamos a hacer a continuación lo pondrá en el proyecto del servidor y habremos hecho un lío.&lt;br /&gt;
&lt;br /&gt;
Ahora vamos al menú &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;File&lt;/span&gt;&quot;, &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&quot;,&quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Other&lt;/span&gt;&quot;, elegimos &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Delphi Projects&lt;/span&gt;&quot;, luego &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DataSnap Server&lt;/span&gt;&quot; y &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Data Snap Client Module&lt;/span&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2xoMJs8bO0A0Jdy7KsZ-ybMDxvA1rl2wrOs3Yt1N42jQxud6IQU7YFMox9zSHi7zH1hf0Ped-WC8AoGudeHineKNCKaKbDIa1CkVYi5fzLnrUiDn_J25yX7PVl9lfwSTLPaCSMoBp_0U/s1600/ClienteAddOther.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2xoMJs8bO0A0Jdy7KsZ-ybMDxvA1rl2wrOs3Yt1N42jQxud6IQU7YFMox9zSHi7zH1hf0Ped-WC8AoGudeHineKNCKaKbDIa1CkVYi5fzLnrUiDn_J25yX7PVl9lfwSTLPaCSMoBp_0U/s640/ClienteAddOther.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Nos pedirá el tipo de servidor:&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; Local o Remoto&lt;/span&gt;. La diferencia es que en el remoto pide nombre o IP del host y en el local no nos lo pide ya que pone &quot;localhost&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYFCY3ybgToUT9uow6mF4MQwQSE4IKzyosmKgaJbL3wfw36-hqKtw6WO_uj8lm7sPDcmEcNH58hXY64qZnKef2zoyZTHAD7AiMVnJssdk6duyBPkwbww3imGfOueP4cM58s4MCVEynwqU/s1600/ClienteLocalServer.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;314&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYFCY3ybgToUT9uow6mF4MQwQSE4IKzyosmKgaJbL3wfw36-hqKtw6WO_uj8lm7sPDcmEcNH58hXY64qZnKef2zoyZTHAD7AiMVnJssdk6duyBPkwbww3imGfOueP4cM58s4MCVEynwqU/s320/ClienteLocalServer.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ahora nos pide el tipo de servidor: en nuestro caso será sólo con &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DataSnap stand alone server&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-wx9cAnP9YO8SOU2fdePTLj5I5xpNLR0N39tVitW0Na8f6_-6YGjYeDphd7DLOncFMrYHBl6RUx72FpAULRmMsMhE5CwPpKI9_zRaRhSZZYGd__oLM6B8Nmn4G0oFCEOwCodYHyXfEBE/s1600/ClienteStandAlone.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;313&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-wx9cAnP9YO8SOU2fdePTLj5I5xpNLR0N39tVitW0Na8f6_-6YGjYeDphd7DLOncFMrYHBl6RUx72FpAULRmMsMhE5CwPpKI9_zRaRhSZZYGd__oLM6B8Nmn4G0oFCEOwCodYHyXfEBE/s320/ClienteStandAlone.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ahora nos pregunta que tipo de protocolo usaremos: en nuestro caso TCP/IP&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZebb_clINpvo7chDIk0zfx03s53ysHHlLalZzWKOBz1a0ICnZvtojtx69GeifkQkiG5-4mBYgA8ElA1rQyECVualAvZVholYZAq7fQ9ehtd4bFoCJCAJGVuThWzYmZjxr696ZkrDeocs/s1600/ClienteTcp.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;312&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZebb_clINpvo7chDIk0zfx03s53ysHHlLalZzWKOBz1a0ICnZvtojtx69GeifkQkiG5-4mBYgA8ElA1rQyECVualAvZVholYZAq7fQ9ehtd4bFoCJCAJGVuThWzYmZjxr696ZkrDeocs/s320/ClienteTcp.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Y ahora nos pide el puerto que le hemos puesto al servidor.&lt;br /&gt;
Es importante que el servidor se esté ejecutando, ya que de lo contrario no conectará y no nos dejará continuar.&lt;br /&gt;
&lt;br /&gt;
Si lo hemos hecho bien, y pulsamos el botón &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Test Connection&lt;/span&gt;&quot; nos mostrará un mensaje de &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;test connection succeeded&lt;/span&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
Y entonces podremos pulsar el botón &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;finish&lt;/span&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
Ahora grabamos el nuevo proyecto como &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;cliente&lt;/span&gt;&quot;, quedándonos algo como lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWM0J9h-EkdehAc38sbaSfRBamhld8FcSsGCN0EzrlNh2qYR9zx6UDvSjCeDCdrqbkObFZU6mQu4bSCq3a0s6uwiHPO8XpEhcSdAPdIzzX3QGbUJlk4nbPym0brGB28AYUHI8GcgclnaQ/s1600/ClienteTodoIniciado.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWM0J9h-EkdehAc38sbaSfRBamhld8FcSsGCN0EzrlNh2qYR9zx6UDvSjCeDCdrqbkObFZU6mQu4bSCq3a0s6uwiHPO8XpEhcSdAPdIzzX3QGbUJlk4nbPym0brGB28AYUHI8GcgclnaQ/s640/ClienteTodoIniciado.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora en la unit &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ClientModuleUnit1 &lt;/span&gt;nos aparecerá un &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;SQLConnection1&lt;/span&gt;. No debemos modificar nada de ese componente.&lt;br /&gt;
&lt;br /&gt;
Añadimos &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DSProviderConnection &lt;/span&gt;y cambiamos lo siguiente:&lt;br /&gt;
propiedad &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Sqlconnection &lt;/span&gt;apuntando a &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;SQLConnection1 &lt;/span&gt;(si no la hemos renombrado)&lt;br /&gt;
y lo más IMPORTANTE: la propiedad &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ServerClassName &lt;/span&gt;con &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TServerMethods1&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
IMPORTANTE: No es una propiedad con una lista&amp;nbsp;desplegable&amp;nbsp;ni nada parecido. Hay que escribirlo y te deja poner cualquier cosa, eso sí, si no está correcto no funcionará nada.&lt;br /&gt;
&lt;br /&gt;
Es algo que expliqué en la parte del servidor y lo repito de nuevo:&lt;br /&gt;
&lt;br /&gt;
En el componente DSServerClass de la unidad ServerContainerUnit1;, en el evento &quot;On Get Class&quot; vemos el siguiente código que se genera automáticamente con el asistente:&lt;br /&gt;
PersistentClass := ServerMethodsUnit1.&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TServerMethods1&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6n_FwZ_gtY-sIqzTl3jgwKqdnN0jMAWHysMHvv8WBNDk53VQULMo4MXwZETXm7L7xXisPfoAaDqpmgXn6yMmuXtF9vQVb5LyaB6k_2n2qlnaH0PKKHVldC1lGqeJ-7zrfOWlOpz5tLyU/s1600/ClienteProviderConnection.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;370&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6n_FwZ_gtY-sIqzTl3jgwKqdnN0jMAWHysMHvv8WBNDk53VQULMo4MXwZETXm7L7xXisPfoAaDqpmgXn6yMmuXtF9vQVb5LyaB6k_2n2qlnaH0PKKHVldC1lGqeJ-7zrfOWlOpz5tLyU/s640/ClienteProviderConnection.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Luego ponemos un &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TSQLServerMethod &lt;/span&gt;y cambiamos&lt;br /&gt;
propiedad &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Sqlconnection &lt;/span&gt;apuntando a &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;SQLConnection1&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
Ahora en propiedad &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ServerMethodName &lt;/span&gt;hacemos clic y si lo hemos hecho todo correcto y el servidor está funcionando, nos saldrá una lista con todas las funciones que el servidor está publicando.&lt;br /&gt;
En nuestro caso elegimos &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TServerMethods1.HoraEnServidor&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
Ahora hacemos doble clic en su propiedad Params y nos mostrará los parámetros de entrada salida del método elegido. En nuestro caso sólo tiene de salida por si lo queremos renombrar.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi92U5Fl0jQfEM3W_mzXA_V0M6k2iogzXeiI4QR2XrBmXcC3Yqkg7_MJK5qSliXt-NpoYhNRk-Lht1BR0FQF-lAloEXIa4LFRtYXRqly6D8H2DJSuRWDZeDx2LMycXchaBuFAcsODc42tU/s1600/ClienteServerMethod.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;348&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi92U5Fl0jQfEM3W_mzXA_V0M6k2iogzXeiI4QR2XrBmXcC3Yqkg7_MJK5qSliXt-NpoYhNRk-Lht1BR0FQF-lAloEXIa4LFRtYXRqly6D8H2DJSuRWDZeDx2LMycXchaBuFAcsODc42tU/s640/ClienteServerMethod.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Y ya sólo nos queda dar utilidad a nuestro cliente, pidiendo la hora a nuestro servidor y mostrándola.&lt;br /&gt;
&lt;br /&gt;
Ahora abrimos la unidad&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;unit3&lt;/span&gt;&lt;br /&gt;
En la clausula &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;uses &lt;/span&gt;añadimos: ClientModuleUnit1;&lt;br /&gt;
&lt;br /&gt;
Ponemos un &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TButton&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
En el evento &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;onclick &lt;/span&gt;del TButton ponemos&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;procedure TForm3.Button1Click(Sender: TObject);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;// &amp;nbsp;Así sería si tuviese parámetros de entrada, lo pongo para que veais el funcionamiento de las llamadas.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;// &amp;nbsp;ClientModule1.SqlServerMethod1.ParamByName(&#39;LoQueSea&#39;).Text := &#39;ValorEnviado&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; ClientModule1.SqlServerMethod1.ExecuteMethod;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; Showmessage (FormatDateTime&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (&#39;dd/mm/yy &amp;nbsp;hh:nn&#39;,ClientModule1.SqlServerMethod1.ParamByName(&#39;ReturnParameter&#39;).Value));&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;end;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Y ya tenemos una aplicación cliente servidor.&lt;br /&gt;
Si están interesados también podemos hacer lo mismo pero con bases de datos que es algo más complejo pero más apasionante.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/3476862019896131372/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/ejemplo-aplicacion-de-3-capas-multihilo.html#comment-form' title='15 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/3476862019896131372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/3476862019896131372'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/ejemplo-aplicacion-de-3-capas-multihilo.html' title='Ejemplo: Aplicación de 3 capas multihilo con DBX4 y Delphi XE - multi-threaded application with Delphi XE and DataSnap DBX4'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVO-y5vWwzq9xyDy4GaOyCffSBcD4YM9epjxvd48VjD-10KLRyR70G2eeeS_Xo33MGJQdeIWYU6potIVSTBtEKsK77qijR1hljd7M17-TntoTDodKUU6lXuIZvoKKkNNtnDzoL6v8Q3l8/s72-c/Paso1.png" height="72" width="72"/><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-2789901379555836693</id><published>2011-09-08T20:06:00.001+01:00</published><updated>2011-09-08T20:21:53.151+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Filtros Filters DataSnap DBX4 ZLibCompression DbxCompressionFilter"/><title type='text'>Filtros de comunicaciones en DataSnap -Filters communications DataSnap</title><content type='html'>En nuestras aplicaciones Cliente-Servidor y gracias al DataSnap 4 (DBX4) podemos realizar operaciones con los datos transmitidos entre ellas de una forma muy sencilla.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
El ejemplo siguiente se corresponde con la compresión de los datos transmitidos para reducir el ancho de banda necesario para nuestras aplicaciones. También se pueden poner cifrados, algo que veremos más adelante.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;u&gt;Paso 1: Aplicación Servidor&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
En la unidad &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ServerContainerUnit &lt;/span&gt;debemos tener el componente &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DsServer&lt;/span&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Entonces añadimos, si es que no lo tenemos ya, el componente&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DSTCPServerTransport&lt;/span&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Ponemos su propiedad &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Server &lt;/span&gt;apuntando al &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DsServer&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Una vez hecho eso, hacemos clic en su propiedad &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Filters&lt;/span&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Nos sale una ventana pequeña y hacemos clic en el botón&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; &quot;Add New&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Hacemos clic sobre el nuevo item que ha aparecido.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Sobre su propiedad &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;FilterId &lt;/span&gt;escogemos &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ZLibCompression&lt;/span&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;u&gt;Paso 2. Aplicación Cliente&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
Abrimos a la unidad &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;ClientModuleUnit&lt;/span&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Añadimos en la clausula uses&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;DbxCompressionFilter&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Y listo.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/2789901379555836693/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/blog-post.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/2789901379555836693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/2789901379555836693'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/blog-post.html' title='Filtros de comunicaciones en DataSnap -Filters communications DataSnap'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-6507700167328702942</id><published>2011-09-08T09:36:00.000+01:00</published><updated>2011-09-08T09:36:51.286+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="TEnum String Delphi XE"/><title type='text'>Convertir variable TEnum a String: Convert TEnum to String</title><content type='html'>&lt;br /&gt;
&lt;div id=&quot;abw&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; border-top-color: rgb(255, 51, 0); border-top-style: solid; border-top-width: 3px; margin-bottom: 0.75em; margin-left: auto; margin-right: auto; margin-top: 0px; padding-bottom: 0px; padding-left: 15px; padding-right: 15px; padding-top: 0px; position: relative; text-align: left; width: 930px;&quot;&gt;
&lt;div class=&quot;clear&quot; id=&quot;abm&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; zoom: 1;&quot;&gt;
&lt;div id=&quot;abc&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: -336px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; width: 930px;&quot;&gt;
&lt;div id=&quot;articlebody&quot; style=&quot;margin-bottom: 1.5em; margin-left: 0px; margin-right: 351px; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: static;&quot;&gt;
&lt;div style=&quot;font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;&quot;&gt;
Si necesitamos usar el nombre de una variable TEnum en lugar de su valor, esta es una forma sencilla.&lt;/div&gt;
&lt;div style=&quot;font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;&quot;&gt;
Voy a poner un ejemplo práctico para hacerlo algo más interesante:&lt;/div&gt;
&lt;div style=&quot;font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;&quot;&gt;
Le pasaremos un campo de nuestra base de datos y nos devolverá la cadena de su propiedad DataType.&lt;/div&gt;
&lt;div style=&quot;font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;&quot;&gt;
Para cualquier otra utilidad, basta con cambiar en la línea GetEnumName el&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;display: inline !important; font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TFieldType &lt;/span&gt;por nuestra TEnum y&amp;nbsp;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;div style=&quot;display: inline !important; font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;Campo.DataType&lt;/span&gt; por el valor que queremos comprobar.&lt;/div&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;u&gt;Paso 1:&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;&quot;&gt;
En nuestro form hay que incluir en el&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; uses TypInfo&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;u&gt;Paso 2:&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;function Enum2Str (Campo:TField): String;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;begin&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;result := GetEnumName(TypeInfo(TFieldType),integer(Campo.DataType));&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;end;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: inherit; font-size: 12px; font-style: inherit; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: inherit;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/6507700167328702942/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/convertir-variable-tenum-string-convert.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/6507700167328702942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/6507700167328702942'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/convertir-variable-tenum-string-convert.html' title='Convertir variable TEnum a String: Convert TEnum to String'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2376419844319975738.post-9218777701897989862</id><published>2011-09-07T20:36:00.000+01:00</published><updated>2011-09-07T20:36:51.148+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="connection close gracefully Delphi XE Datasnap"/><title type='text'>Connection close gracefully</title><content type='html'>Mensaje &quot;connection close gracefully&quot;&lt;br /&gt;
&lt;br /&gt;
Este mensaje suele darse porque ha habido cambios en la aplicación servidor y en la aplicación cliente tiene la conexión abierta (&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;TSQLConnection&lt;/span&gt;&lt;/span&gt;).&lt;br /&gt;
&lt;br /&gt;
Para solucionarlo vamos al componente&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt; TSQLConnection&lt;/span&gt; de la aplicación cliente y ponemos la propiedad Active = False, normalmente puesta en el ClientModuleUnit.&lt;br /&gt;
&lt;br /&gt;
A continuación volvemos a dejarla como estaba: Active = TRUE.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://trabajandocondelphixe.blogspot.com/feeds/9218777701897989862/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/connection-close-gracefully.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/9218777701897989862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2376419844319975738/posts/default/9218777701897989862'/><link rel='alternate' type='text/html' href='http://trabajandocondelphixe.blogspot.com/2011/09/connection-close-gracefully.html' title='Connection close gracefully'/><author><name>Antonio Viera</name><uri>http://www.blogger.com/profile/01508118892209420497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total><georss:featurename>Vía de Servicio Dársena Pesquera, 2, 38180 Santa Cruz de Tenerife, España</georss:featurename><georss:point>28.478348692223165 -16.2158203125</georss:point><georss:box>27.589830692223163 -17.4792478125 29.366866692223166 -14.9523928125</georss:box></entry></feed>