topic
stringlengths
1
63
text
stringlengths
1
577k
Consulta sobre Get "" SOLUCIONADO ""
¿Identificó las características <1/2> de Workshop.exe? Luego use TAB para ver si están "cayendo" en los GETS correctos. Publique el .RC que lo hace más fácil. Regards, saludos.
Consulta sobre Get "" SOLUCIONADO ""
Saludos Antonio. Como dice João, asegurate que, en el WindosStyle (en el editor de recursos), los Gets tengan definido el TabStop como YES.
Consulta sobre Get "" SOLUCIONADO ""
Muchas gracias Karinha y Francisco. Es un archivo RES, si tiene activado los TAbStop estan activados en YES. El Enter desde el primer Get, me envía directo al botón de validación, solo con el mouse puedo ingresar el dato del segundo Get. Saludos. Antonio.
Consulta sobre Get "" SOLUCIONADO ""
¿Qué sucede cuando usa <TAB> en los recursos? ¿"Saltar" correctamente? Es decir, directamente en el Editor de recursos. Esto es imposible con WrorkShop.exe. el mejor. Regards, saludos.
Consulta sobre Get "" SOLUCIONADO ""
Hola Karinha. Muchas gracias por responder. Uso Pelles C, recurso RES, si al hacer el Test, salta correctamente desde Primer Get, Segundo Get y Botón Validar. Muchos Saludos. Antonio.
Consulta sobre Get "" SOLUCIONADO ""
Se me ocurre lo siguiente. El campo [b:18bm7nt3]Cod_usu1[/b:18bm7nt3] tenga por ejemplo una longitud de 5 posiciones, al llenar las 5 posiciones pasa directamente al [b:18bm7nt3]Cla_usu1[/b:18bm7nt3] (segundo get) y el cliente pulsa intro para pasar al segundo get pensando que esta en el primer get pero al estar en el segundo pasa al botón. Una solución se me ocurre que pongas más posiciones al [b:18bm7nt3]Cod_usu1[/b:18bm7nt3] para que el usuario tenga obligación de pulsar intro. No recuerdo si desde el rc cambiando alguna configuración del get se espera a pulsar intro aunque se llene el campo.
Consulta sobre Get "" SOLUCIONADO ""
Hola Amigo Karinha Muchas gracias por tu ayuda. Ya lo solucione, al parecer era un poco compleja con recursos, asi es que cambie a coordenadas "DEFINE DIALOG oDlg2 SIZE 350,250 PIXEL TRUEPIXEL FONT oFont2 STYLE nOr( WS_POPUP, WS_VISIBLE, WS_DLGFRAME )". Ahora funciona perfecto. Muchas gracias por todo. Saludos Antonio. [quote="karinha":1hy85cn3]Holá, post el .prg y el .RES / .RC para testes en el Mega Upload que simulo en el WorkShop.exe. Regards, saludos.[/quote:1hy85cn3]
Consulta sobre Get "" SOLUCIONADO ""
[quote="remtec":18es48yo]Hola Amigos Tengo un problema que no me había dado cuenta, es la secuencia de los GETs, al dar ENTER. . Cuando ingresa, toma el foco el ID 110, al dar ENTER, debiera pasar al ID 120, pero inmediatamente toma el foco el Botón Id 604, que va a validar los 2 Gets. Como puedo corregir, para que mediante el ENTER, pase de los 2 Gets y luego al botón Aceptar (Id 604)? En el recurso el índice de los tab Index, están secuencia en los gets. Muchos saludos Antonio. Codigo: [code=fw:18es48yo]<div class="fw" id="{CB}" style="font-family: monospace;"><br />                 <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"#1007"</span>     <span style="color: #0000ff;">Title</span> <span style="color: #ff0000;">" "</span><br /><br />                <span style="color: #0000ff;">REDEFINE</span> BITMAP oBmp1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">601</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"#8022"</span> TRANSPARENT <span style="color: #0000ff;">OF</span> oDlg<br />                <span style="color: #0000ff;">REDEFINE</span> BITMAP oBmp1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">600</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"#8023"</span> TRANSPARENT <span style="color: #0000ff;">OF</span> oDlg<br /><br />                <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oSay1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">603</span> <span style="color: #0000ff;">PROMPT</span> OemToAnsi<span style="color: #000000;">&#40;</span>alltrim<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"INFORMES DE CAJA"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> oFont1  COLORS RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">56</span>, <span style="color: #000000;">76</span>, <span style="color: #000000;">170</span><span style="color: #000000;">&#41;</span><br /><br />            <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">Get</span> oCod_usu1 <span style="color: #0000ff;">Var</span> Cod_usu1 <span style="color: #0000ff;">Id</span> <span style="color: #000000;">110</span> <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">Picture</span> <span style="color: #ff0000;">"@!"</span> COLORS RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">9</span>, <span style="color: #000000;">43</span>, <span style="color: #000000;">47</span><span style="color: #000000;">&#41;</span><br />            <br />            <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">Get</span> oCla_usu1 <span style="color: #0000ff;">Var</span> Cla_usu1 <span style="color: #0000ff;">Id</span> <span style="color: #000000;">120</span> <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">Picture</span> <span style="color: #ff0000;">"@!"</span> COLORS RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">9</span>, <span style="color: #000000;">43</span>, <span style="color: #000000;">47</span><span style="color: #000000;">&#41;</span><br />            <br /><br />            <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">Button</span> <span style="color: #0000ff;">Id</span> <span style="color: #000000;">605</span> <span style="color: #0000ff;">Of</span> oDlg Border ;<br />                <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>Ing_1:=<span style="color: #000000;">0</span>,Ing_2:=<span style="color: #000000;">0</span>,oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>        <span style="color: #B900B9;">// Boton Salida</span><br />        <br /><br />                <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">Button</span> <span style="color: #0000ff;">Id</span> <span style="color: #000000;">604</span> <span style="color: #0000ff;">Of</span> oDlg ;<br />              <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>!Valida_usu<span style="color: #000000;">&#40;</span>Cod_usu1,Cla_usu1<span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>MsgStop<span style="color: #000000;">&#40;</span>Mensa<span style="color: #000000;">&#41;</span>, Ing_1:=<span style="color: #000000;">0</span>, Ing_2:=<span style="color: #000000;">0</span>,.F.<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .T.<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>           <span style="color: #B900B9;">// Aqui Boton Acepta</span><br /><br /><br /><br />                            <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span>  <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span>!GETKEYSTATE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">27</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:18es48yo] FWH 22.03 Harbour Pelles C[/quote:18es48yo]
Consulta sobre Get "" SOLUCIONADO ""
Hola Garbi Muchas gracias por responder. El cliente si usa el TAB, va en secuencia correcta con los Get, hasta el boton validad. Pero el usar el ENTER, que es su requerimiento, desde el primer Get, el Boton coma el Focus. Quedo atento a alguna sugerencia. Saludos Antonio FWH 22.03 Harbour - Pelles C
Consulta sobre Get "" SOLUCIONADO ""
Holá, post el .prg y el .RES / .RC para testes en el Mega Upload que simulo en el WorkShop.exe. Regards, saludos.
Consulta sobre Get "" SOLUCIONADO ""
Hola amigo Remtec. Me alegro que lo has solucionado, pero yo creo que deberíamos ahondar porque no funciona con recursos, ya que creo es mucho más práctico. Ahora que tienes tiempo, si puedes postear el prg y el. Rc lo probaríamos, Joao también se ha ofrecido. Un saludo Jose. Enviado desde mi POCOPHONE F1 mediante Tapatalk
Consulta sobre Get "" SOLUCIONADO ""
Perfecto amigo. Asi es como debe ser. <!-- s:mrgreen: --><img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green" /><!-- s:mrgreen: --> Saludos Jose.
Consulta sobre Get "" SOLUCIONADO ""
Amigo Jose Muchas gracias por tu ayuda. Que tengas un buen día. Muchos Saludos. Antonio.
Consulta sobre Index
Amigos del foro: Nuevamente acudo a ustedes pues no encuentro la respuesta. En los MainFrame como AS/400 al ordenar por un campo alfanumerico quedan de la siguiente forma: 2A261 2F5010 244910 246110 Peroooooo en FW los mismos artículos al crear un índice quedan así 244910 246110 2A261 2F5010 En el primer caso las letras de la segunda columna van antes que los dígitos pero en FW el caso es al reves, los dígitos van antes que las letras. Existe alguna función para que el índice me quede exactamente igual que el MainFrame ?? Saludos
Consulta sobre Index
Armando, Por lo que veo, están en orden descendiente. Añade DESCEND( clave ) en tu índice. Saludos, José Luis Capel <!-- w --><a class="postlink" href="http://www.capelblog.com">www.capelblog.com</a><!-- w -->
Consulta sobre Index
José Luis: Te agrdezco infinitamente el consejo pero, si miras nuevamente veras que no, no estan en orden decreciente. 244910 246110 2A261 2F5010 Sin embargo he probado según tu consejo y tampoco funciona. Un abrazo, Armando
Consulta sobre Index
Armando, Ups... cierto.. me fijé en la columna de abajo en vez de la de arriba. Saludos, José Luis Capel
Consulta sobre Index
Hola, Que yo sepa no existe ninguna forma, pero por una razón lógica, FW lo esta acciendo correctamente. Es en los Mainframe donde el orden es incorrecto. Al ordenar un campo alfanumérico el orden tiene que ir de izquierda a derecha según su código ascii, por eso lo ordena de esa forma: 24... 24... 2A.. 2F... Lo considero que no debe hacer es o bien tener en cuenta las longitudes de las cadenas, o bien ordenar antes letras que números Puedes grabarlos justificandolos a la derecha, pero quedara: [code:cb789w5k] 2A261 244910 246110 2F5010[/code:cb789w5k]
Consulta sobre Index
Armando: prueba a hacer el indice en este modo: INDEX ON PADL( ALLTRIM( tucampo ), 6) TO tu_indice...... Seguramente lo ordena en el modo que quieres. 2A261 2F5010 244910 246110
Consulta sobre MsgRun (Solucionado)
A los compañeros del foro Si alguien pudiera ayudarme [code=fw:320ruvt7]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// si son eliminaciones</span><br />      <span style="color: #00C800;">case</span> pnOperacion == <span style="color: #000000;">3</span> .and. msgyesno<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Esta seguro de eliminar el Registro ?"</span>, oApp:<span style="color: #000000;">cEmpresa</span> <span style="color: #000000;">&#41;</span><br /><br />      cRuta := <span style="color: #ff0000;">".<span style="color: #000000;">\d</span>atos<span style="color: #000000;">\E</span>MPR"</span> + alltrim<span style="color: #000000;">&#40;</span>cId<span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\"</span><br /><br />      AEVAL( Directory( cRuta + "</span>*.*<span style="color: #ff0000;">" ), { |aFile| MsgRun( "</span>Eliminando Archivos: <span style="color: #ff0000;">" + Upper(AllTrim(cRuta + aFile[ F_NAME ])), oApp:cEmpresa, { fErase( cRuta + aFile[ F_NAME ] ) } ) } )<br /></span></div>[/code:320ruvt7] Y este es el error [code=fw:320ruvt7]<div class="fw" id="{CB}" style="font-family: monospace;">Application<br />===========<br />   Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">P</span>:\Fuentes\xHarbour\InvFis32\BIN\InvFis32.Exe <span style="color: #000000;">&#40;</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">Size</span>: <span style="color: #000000;">4</span>,<span style="color: #000000;">049</span>,<span style="color: #000000;">408</span> bytes<br />   Compiler version: <span style="color: #000000;">xHarbour</span> <span style="color: #000000;">1.2</span><span style="color: #000000;">.3</span> Intl. <span style="color: #000000;">&#40;</span>SimpLex<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#40;</span>Build <span style="color: #000000;">20150419</span><span style="color: #000000;">&#41;</span><br />   FiveWin  Version: <span style="color: #000000;">FWHX</span> <span style="color: #000000;">14.12</span><br />   Windows version: <span style="color: #000000;">6.1</span>, Build <span style="color: #000000;">7601</span> Service Pack <span style="color: #000000;">1</span><br /><br />   Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">6</span> mins <span style="color: #000000;">52</span> secs <br />   Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">18</span>/<span style="color: #000000;">03</span>/<span style="color: #000000;">2017</span>, <span style="color: #000000;">20</span>:<span style="color: #000000;">31</span>:<span style="color: #000000;">46</span><br />   Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1004</span>  <span style="color: #00C800;">Class</span>: <span style="color: #ff0000;">'ARRAY'</span> has no exported <span style="color: #00C800;">method</span>: <span style="color: #000000;">EVAL</span><br />   Args:<br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = A   <span style="color: #000000;">&#123;</span> ... <span style="color: #000000;">&#125;</span> length: <span style="color: #000000;">1</span><br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = O   TDIALOG<br /><br />Stack Calls<br />===========<br />   Called <span style="color: #0000ff;">from</span>:  => EVAL<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\MIOS\rutinas.prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>MSGRUN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">355</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>TDIALOG:<span style="color: #000000;">TDIALOG</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">90</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => TDIALOG:<span style="color: #00C800;">DISPLAY</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">893</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => DIALOGBOXINDIRECT<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">286</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\MIOS\rutinas.prg => MSGRUN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">362</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\catalogo.prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>F_EMPRESAS<span style="color: #000000;">&#40;</span> <span style="color: #000000;">400</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => AEVAL<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\catalogo.prg => F_EMPRESAS<span style="color: #000000;">&#40;</span> <span style="color: #000000;">400</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\util.prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>XCATALOGO<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1219</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">BUTTON</span>.PRG => TBUTTONBMP:<span style="color: #0000ff;">CLICK</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">175</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TBUTTON:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1687</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\BUTTONB.PRG => TBUTTONBMP:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">214</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3345</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => SENDMESSAGE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #000000;">COMMAND</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">403</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">906</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => DIALOGBOX<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">286</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\util.prg => XCATALOGO<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1248</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\catalogo.prg => CATALOGO<span style="color: #000000;">&#40;</span> <span style="color: #000000;">71</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\main.prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>F_MENU<span style="color: #000000;">&#40;</span> <span style="color: #000000;">234</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">MENU</span>.PRG => TMENU:<span style="color: #000000;">COMMAND</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">561</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => TWINDOW:<span style="color: #000000;">COMMAND</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1097</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3345</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => WINRUN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => TWINDOW:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1050</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">Source</span>\main.prg => MAIN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">206</span> <span style="color: #000000;">&#41;</span></div>[/code:320ruvt7] De antemano muchas gracias
Consulta sobre MsgRun (Solucionado)
Amigos Lo pude solucionar de esta forma [code=fw:34qul1et]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// si son eliminaciones</span><br />      <span style="color: #00C800;">case</span> pnOperacion == <span style="color: #000000;">3</span> .and. msgyesno<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Esta seguro de eliminar el Registro ?"</span>, oApp:<span style="color: #000000;">cEmpresa</span> <span style="color: #000000;">&#41;</span><br /><br />      cRuta := <span style="color: #ff0000;">".<span style="color: #000000;">\d</span>atos<span style="color: #000000;">\E</span>MPR"</span> + alltrim<span style="color: #000000;">&#40;</span>cId<span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\"</span><br /><br /><br />      aFiles := Directory(cRuta + "</span>*.*<span style="color: #ff0000;">" )<br />      EliminaEmpresa(cRuta)<br /><br />      if dirremove(cRuta) != 0<br />         MsgStop("</span>No fue posible eliminar el directorio, verifique...<span style="color: #ff0000;">", oApp:cEmpresa)<br />      endif<br /><br />      if empr->(rec_lock(5))<br />         empr->(dbDelete()); empr->(dbUnlock())<br />      endif<br /><br />  endcase<br />return(nil)<br /><br />FUNCTION EliminaEmpresa(cRuta)<br />   LOCAL i, cNomArc<br />   FOR i := 1 TO Len(aFiles)<br />      cNomArc := aFiles[i][F_NAME]<br />      MsgRun( "</span>Eliminando Archivos: <span style="color: #ff0000;">" + cRuta + cNomArc, oApp:cEmpresa, ;<br />              {|| fErase( cRuta + cNomArc ) } )<br />   NEXT<br />RETURN nil</span></div>[/code:34qul1et]
Consulta sobre MySql y autoincrement
Hola a todos amigos. Mi consulta es sobre mysql y muy sencilla: ¿Habrá alguna manera de aumentar el valor de un campo autoincremental SIN tener que hacer un insert ? La unica manera que he conseguido es insertando y eliminando de seguido el registro nuevo, pero no me gusta mucho eso. Quedo al pendiente de sus respuestas.
Consulta sobre MySql y autoincrement
Creo que es lo que necesitas [url:1eiwlrgt]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=38739&p=231087&hilit=armando+auto&sid=5db78336e37be21038cbb3b107caca0a&sid=cf20c46ba5b844a354872609b9349f82#p231087[/url:1eiwlrgt]
Consulta sobre MySql y autoincrement
Use the new value in the next insert. Example: Autoinc field name is `ID` and the present value is 89. You want to use 101 onwards from the next record onwards. Solution: When you insert the next record: INSERT INTO mytable ID,..... VALUES ( 101, .... ) New record will be inserted with value of 101 for ID and subsequent inserts will be incremented from 101 onwards. Hope I am clear.
Consulta sobre MySql y autoincrement
Another way is [code=fw:3q1cz4xl]<div class="fw" id="{CB}" style="font-family: monospace;">ALTER TABLE tblname AUTO_INCREMENT = <span style="color: #000000;">52</span>;</div>[/code:3q1cz4xl]
Consulta sobre MySql y autoincrement
Hola a todos amigos, Gracias por la colaboracion en sus respuestas. Pero creo que no me explique bien sobre lo que quiero. Lo que me gustaria hacer (si se puede) es que un campo autoincrement se vaya incrementando SIN HACER UN INSERT. Quiero llevar un contador, y por los momentos lo hago asi: [code=fw:1paif9rb]<div class="fw" id="{CB}" style="font-family: monospace;">       cTabla:= _cPrefijo+<span style="color: #ff0000;">'_docventatemp'</span><br /><br />      cQuery:=<span style="color: #ff0000;">''</span><br />      cQuery:=<span style="color: #ff0000;">"SELECT * FROM "</span>+ cTabla  + <span style="color: #ff0000;">" FOR UPDATE; "</span><br />      oQuery:= _oSqlConex:<span style="color: #000000;">Query</span><span style="color: #000000;">&#40;</span> cQuery <span style="color: #000000;">&#41;</span><br /><br />      nNumeroTemporal:=oQuery:<span style="color: #000000;">numerotemp_documento</span><span style="color: #000000;">+1</span><br /><br />      cQuery:=<span style="color: #ff0000;">''</span><br />      cQuery:=<span style="color: #ff0000;">"Update "</span>+cTabla+<span style="color: #ff0000;">" Set "</span><br />      cQuery +=<span style="color: #ff0000;">"numerotemp_documento:="</span>+alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nNumeroTemporal<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"; "</span><br />      _oSqlConex:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> cQuery    <span style="color: #000000;">&#41;</span><br /> </div>[/code:1paif9rb] Es una tabla de un solo registro. Asi me funciona perfecto, pero por esos caprichos de nosotros los programadores, me gustaria con un campo autoincremental. Por eso quisiera saber si hay alguna manera de hacerlo sin necesidad de insertar un registro cada vez que necesite un nuevo numero, pero al parecer no se puede. Para que incremente hay que insertar obligatoriamente una nueva fila a la tabla.
Consulta sobre MySql y autoincrement
Hola, A mi se me ocurre algo sin tener que hacer ningún query previo e incrementar en una variable. No se si entendí tu idea, pero esto debería funcionar: [code=fw:jd87la60]<div class="fw" id="{CB}" style="font-family: monospace;">cQuery:=<span style="color: #ff0000;">"UPDATE TUTABLA SET CAMPO=CAMPO + 1 "</span> <span style="color: #B900B9;">// No pongo ningún Where ya que comentas que es solo un registro.</span><br /> </div>[/code:jd87la60] Espero te sirva la idea. Saludos,
Consulta sobre MySql y autoincrement
Saludos colega... Gracias por tu colaboracion. En mi caso, hago un SELECT previo porque alli uso la clausula FOR UPDATE que es la que me va a BLOQUEAR el registro y no permitir que nadie mas accese la tabla al mismo tiempo y pueda duplicarse el valor del consecutivo. Sin embargo, con tu idea puedo ahorrarme un par de lineas de codigo. Gracias amigo.
Consulta sobre OpenComm()
Hola a todos. Estoy intentando conectar con un puerto serie para recibir datos. Me he encontrado esta función en un programa de ejemplo. El primer parámetro lo tengo claro, pero los otros dos no (1024 y 128), ¿puede alguien decirme qué significan y si son obligatorios y opcionales) nComm := OpenComm( "COM5", 1024, 128 ) Gracias por adelantado, Fernando Las Palmas de Gran Canaria
Consulta sobre OpenComm()
del archivo de ayuda func.chm [quote:28qnebff] OpenComm() Open the communication port to start using it Syntax: OpenComm( <cCommName> [,<nSizeIn>] [,<nSizeOut>] ) --> nIdComm Parameters: <cCommName> The name of the comm device to open in a format like "COM" + N or "LPT" + N <nSizeIn> The size in bytes of the receiving queue. This parameter is ignored for "LPT" devices. By default FiveWin assigns 1024. <nSizeOut> The size in bytes of the transmission queue. This parameter is ignored for "LPT" devices. By default FiveWin assigns 128. Returns: <nIdComm> A numeric identifier for that opened device. 0 if there was an error. If the function fails, it may return one of the following error values: Value Meaning IE_BADID The device identifier is invalid or unsupported. IE_BAUDRATE The device's baud rate is unsupported. IE_BYTESIZE The specified byte size is invalid. IE_DEFAULT The default parameters are in error. IE_HARDWARE The hardware is not available (is locked by another device). IE_MEMORY The function cannot allocate the queues. IE_NOPEN The device is not open. IE_OPEN The device is already open. If this function is called with both queue sizes set to zero, the return value is IE_OPEN if the device is already open or IE_MEMORY if the device is not open.indows allows COM ports 1 through 9 and LPT ports 1 through 3. If the device driver does not support a communications port number, the OpenComm function will fail. The communications device is initialized to a default configuration. The SetCommState function should be used to initialize the device to alternate values. The receiving and transmission queues are used by interrupt-driven device drivers. LPT ports are not interrupt driven--for these ports, the cbInQueue and cbOutQueue parameters are ignored and the queue size is set to zero. Sample: SAMPLES\\TestComm.prg Source Code: SOURCE\\WINAPI\\Comm.c See also: CloseComm() WriteComm() ReadComm() BuildCommDcb() SetCommState() FlushComm() GetCommError() [/quote:28qnebff]
Consulta sobre OpenComm()
Carlos, muchas gracias por tu pronta respuesta y haberme aclarado el tema. Una pregunta: ¿dónde se encuentra ese archivo func.chm al que haces referencia? He estado buscando el los directorios de FWH y Harbour y no lo veo.
Consulta sobre OpenComm()
[url:rcjr902o]http&#58;//wiki&#46;fivetechsoft&#46;com/doku&#46;php?id=fivewin_function_opencomm[/url:rcjr902o]
Consulta sobre OpenComm()
[img:z1l9f75d]https&#58;//i&#46;imgur&#46;com/MwC8VGr&#46;png[/img:z1l9f75d]
Consulta sobre OpenComm()
Carlos y Antonio, muchas gracias de nuevo.
Consulta sobre Pelles C
Amigos del foro : He decidido dar el paso de cambiarme a Pelles C para elaborar mis diálogos Hasta ahora he utilizado el workshop partiendo de un archivo rc y compilo com Verce 5.3 y con la opcion de generar una Dll a partir del rc Empecé a incursionar con el Pelles C 6.00 pero tengo dudas : 1.- Quise generar un archivo rc dentro del Pelles C pero al hacer el mismo procedimiento con el Verce, me aparecian errores como que no encontraba el archivo res. 2.- Tomando en cuenta que el Pelles C puedo crear directamente Dlls, hice lo siguiente : Nuevo proyecto Entre en [color=#FF0000:3dv45nbe]Template Projects [/color:3dv45nbe]y me fui a la opcion de Win32 dll wizard Intenté también con [color=#FF0000:3dv45nbe]Empty projects[/color:3dv45nbe] con Win32 dinamic library (dll) pero no conseguí ningun resultado Finalmente lo que hice fue copia una dll de las que tengo, elimine todos los dialogos y metí uno, compilé y funcionó Tengo mis dudas yo creo que algo me hace falta o tal vez deba de configurar alguna cosa Si alguien tuviera la bondad de orientarme al respecto, mucho se los agradeceré De antemano muchas gracias Saludos
Consulta sobre Pelles C
Juan, mira este topico. Tal vez te sea de ayuda. viewtopic.php?f=6&t=14830&hilit=convertir+a+dll+de+32+bits saludos
Consulta sobre Pelles C
FranciscoA Te agradezco profundamente tu ayuda, funcionó perfecto Saludos
Consulta sobre Report
Hola a todos Necesito hacer un reporte que tenga dos filas de titulos y dos filas de datos, ¿hay alguna manera de hacerlo?. Me explico, el reporte es demasiado largo , incluso para ponerlo apaisado, asi que la solución es ponerlo en dos filas por ejemplo Fila 1 codigo Cliente Enero Febrero Marzo Abril Marzo Junio Zona Grupo Fila 2 Nombre Julio Agosto Septiembre Octubre Noviembre Diciembre Agente Cobrador En Clipper era sencillo hacerlo, pero aqui se me complica un poco el asunto con el Report. Un saludo Pedro
Consulta sobre Report
Hola Pedro, COLUMN TITLE "Linea1-Titulo"[b:8s3w76dg],[/b:8s3w76dg]"Linea2-Titulo" ; DATA Fichero->Campo1[b:8s3w76dg] ,[/b:8s3w76dg] ; Fichero->Campo2 Un saludo
Consulta sobre Report
Gracias lo probaré tal como me lo has dicho, a ver si me da resultado Un abrazo Pedro
Consulta sobre Ribbon
Gente; En un Ribbonbar deseo agregar un say y lo hice de esta manera: [code=fw:kojddrfm]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; ADD GROUP aO<span style="color: #000000;">&#91;</span>_GrpFlt<span style="color: #000000;">&#93;</span> RIBBON aO<span style="color: #000000;">&#91;</span>_Ribbon<span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">TO</span> OPTION <span style="color: #000000;">1</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Filtros"</span> WIDTH <span style="color: #000000;">320</span><br /><br />&nbsp; &nbsp;@<span style="color: #000000;">14</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Filtrar por..."</span> <span style="color: #0000ff;">OF</span> aO<span style="color: #000000;">&#91;</span>_GrpFlt<span style="color: #000000;">&#93;</span> CSIZE <span style="color: #000000;">60</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> TRANSPARENT<br />&nbsp;</div>[/code:kojddrfm] Pero el filtro sale con fondo color gris. Luego lo cambíe por: [code=fw:kojddrfm]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; ADD GROUP aO<span style="color: #000000;">&#91;</span>_GrpFlt<span style="color: #000000;">&#93;</span> RIBBON aO<span style="color: #000000;">&#91;</span>_Ribbon<span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">TO</span> OPTION <span style="color: #000000;">1</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Filtros"</span> WIDTH <span style="color: #000000;">320</span><br /><br />&nbsp; &nbsp;@<span style="color: #000000;">14</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Filtrar por..."</span> <span style="color: #0000ff;">OF</span> aO<span style="color: #000000;">&#91;</span>_GrpFlt<span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">COLOR</span> CLR_BLACK, aO<span style="color: #000000;">&#91;</span>_Ribbon<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nClrPaneRB</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> TRANSPARENT<br />&nbsp;</div>[/code:kojddrfm] Pero no es el color de fondo del Grupo, y se ve así: [url:kojddrfm]http&#58;//img857&#46;imageshack&#46;us/i/ribbon&#46;jpg/[/url:kojddrfm] Cual sería la forma correcta? gracias
Consulta sobre Ribbon
agrego imagen [url:22pmylgc]http&#58;//img217&#46;imageshack&#46;us/img217/5428/ribbont&#46;jpg[/url:22pmylgc]
Consulta sobre Ribbon
you must not use command say [b:avwuimis]but the command RBTN[/b:avwuimis] then you must set the type SAYBUTTON it show a say
Consulta sobre Ribbon
Thank Silvio
Consulta sobre SQL
Hola nuevamente, mi consulta es la siguiente llego a mi manos un manual de la libreria FcOdbc, sera asi tan facil de trabajar con bases SQL <!-- m --><a class="postlink" href="http://www.fcsodbc.com/">http://www.fcsodbc.com/</a><!-- m --> Saludos Jose
Consulta sobre SQL
Existen dos librerias de Manuel Exposito: Eagle1 y Condor1. Que premiten el uso de SQL, muy facilmente. Saludos, José Mª
Consulta sobre Servidor Embebido Mysql (resuelto)
Estoy probando compilar una aplicacion pequeña para un servidor embebido de Mysql con FWHMariadb/Mysql y tengo estos errores: Error: Unresolved external 'mysql_set_character_set' referenced from C:\FWH\LIB\FIVEH.LIB|FWMARIA Error: Unresolved external 'mysql_hex_string' referenced from C:\FWH\LIB\FIVEH.LIB|FWMARIA Error: Unresolved external 'mysql_set_server_option' referenced from C:\FWH\LIB\FIVEH.LIB|FWMARIA He creado las carpetas que se pide y conectado con esta sintaxis: [code=fw:3e5oivax]<div class="fw" id="{CB}" style="font-family: monospace;"><br />maria_Embedded<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"E:<span style="color: #000000;">\C</span>amionesCs<span style="color: #000000;">\d</span>ata<span style="color: #000000;">\m</span>ysqlsrv<span style="color: #000000;">\c</span>DataFolder<span style="color: #000000;">\"</span>, "</span>camiones<span style="color: #ff0000;">", "</span>E:\CamionesCs\<span style="color: #00C800;">data</span>\mysqlsrv\cLangFolder<span style="color: #ff0000;">" )<br /></span></div>[/code:3e5oivax] La base de datos se llama camiones y las ubicaciones estarían correctas. Gracias desde ya por vuestra ayuda.
Consulta sobre Servidor Embebido Mysql (resuelto)
[quote="jose_murugosa":1ed2eb3t]Estoy probando compilar una aplicacion pequeña para un servidor embebido de Mysql con FWHMariadb/Mysql y tengo estos errores: Error: Unresolved external 'mysql_set_character_set' referenced from C:\FWH\LIB\FIVEH.LIB|FWMARIA Error: Unresolved external 'mysql_hex_string' referenced from C:\FWH\LIB\FIVEH.LIB|FWMARIA Error: Unresolved external 'mysql_set_server_option' referenced from C:\FWH\LIB\FIVEH.LIB|FWMARIA He creado las carpetas que se pide y conectado con esta sintaxis: [code=fw:1ed2eb3t]<div class="fw" id="{CB}" style="font-family: monospace;"><br />maria_Embedded<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"E:<span style="color: #000000;">\C</span>amionesCs<span style="color: #000000;">\d</span>ata<span style="color: #000000;">\m</span>ysqlsrv<span style="color: #000000;">\c</span>DataFolder<span style="color: #000000;">\"</span>, "</span>camiones<span style="color: #ff0000;">", "</span>E:\CamionesCs\<span style="color: #00C800;">data</span>\mysqlsrv\cLangFolder<span style="color: #ff0000;">" )<br /></span></div>[/code:1ed2eb3t] La base de datos se llama camiones y las ubicaciones estarían correctas. Gracias desde ya por vuestra ayuda.[/quote:1ed2eb3t] Que es servidor embebido?
Consulta sobre Servidor Embebido Mysql (resuelto)
Prueba con [quote:2sl3ror6] "E:\CamionesCs\data\mysqlsrv\cLangFolder\" [/quote:2sl3ror6]
Consulta sobre Servidor Embebido Mysql (resuelto)
FWHMySql/MariaDB permite utilizar MariaDB o MySql como servidores embebidos, es decir el servidor está incluído el servidor de bases de datos en tu aplicación y maneja las bases de datos mysql/Mariadb que están en un directorio local o en la aplicación. Sirve, entre otras cosas, para crear una aplicación con tablas locales (como las antiguas dbfs) pero almacenadas como bases de datos mysql/mariadb, sin necesidad de instalar el servidor. A su vez estas bases son perfectamente portables a un servidor mariadb/mysql instalado en una red o en la nube o cualquier parte y cambiando un par de lineas de código la aplicación podrá funcionar sin problemas con ellas.
Consulta sobre Servidor Embebido Mysql (resuelto)
Tambien quizás te falte la libreria libmysqlD.lib
Consulta sobre Servidor Embebido Mysql (resuelto)
[quote="cnavarro":r5xpjncq]Prueba con [quote:r5xpjncq] "E:\CamionesCs\data\mysqlsrv\cLangFolder\" [/quote:r5xpjncq][/quote:r5xpjncq] Gracias por tu respuesta Cristóbal, no me había dado cuenta que faltaba la contrabarra, que claramente dice la documentación que debe colocarse, pero de todos modos me repite el mismo error <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->. Sigo investigado.....
Consulta sobre Servidor Embebido Mysql (resuelto)
Como he comentado antes tendrás que sustituir la libreria LIBMYSQL.LIB por LIBMYSQLD.LIB en el caso de embedded Evidentemente, en este caso, no hace falta tener funcionando ningún servidor Mysql En FW seria algo asi [code=fw:1pm9jaor]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oServer , oQuery, aTables, aTmp<br />   <span style="color: #00C800;">local</span> aStruc <br />   <span style="color: #00C800;">local</span> cDataFolder  := <span style="color: #ff0000;">"C:<span style="color: #000000;">\m</span>ysql<span style="color: #000000;">\d</span>ata<span style="color: #000000;">\"</span><br />   local cLangFolder  := "</span>C:\xampp\mysql\share\spanish\<span style="color: #ff0000;">"<br />   local cDataBase    := "</span>fwh<span style="color: #ff0000;">"<br />   <br />   FWCONNECT oServer HOST cDataFolder LANGFOLDER cLangFolder DATABASE cDataBase<br /><br />   //oServer  := maria_Embedded( cDataFolder, cDataBase, cLangFolder )<br /><br />   ? oServer:cDB<br />   aTables := oServer:ListTables()<br />   XBROWSER aTables<br /><br />   oServer:Close()<br />Return nil<br /><br /></span></div>[/code:1pm9jaor] Es decir, para usar con un servidor Mysql [img:1pm9jaor]https&#58;//s12&#46;postimg&#46;org/g9ebfcmjh/Fivedit50&#46;png[/img:1pm9jaor] Y para usar en modo Embedded [img:1pm9jaor]https&#58;//s12&#46;postimg&#46;org/tw8d0886l/Fivedit51&#46;png[/img:1pm9jaor]
Consulta sobre Servidor Embebido Mysql (resuelto)
Sigo sin poder construir una pequeña aplicacion con embedded server. Seguramente se debe a que estoy malentendiendo u omitiendo algo. 1) estoy usando la versión de Mysql última 5.7.19 2) para descargar libmysqld.dll lo que hice fue utilizar la libmysqld.dll que está en la clase tdolphin. 3) corrí implib libmysqld.lib libmysqld.dll para crear libmysqld.lib 4)linke la lib con mi aplicación en lugar de libmysql.lib 5) coloque el el directorio del ejecutable libmysqld.dll 6)cree un directorio data en el que copie el errmsg.sys para no necesitar tener un directorio de lenguaje. 7)cree un directorio camiones, donde alojar las tablas del sistema. Hasta ahí todo bien. las tablas deben estar en MyISAM o InnoDB? Como creo la base de datos en el servidor embebido? Es posible copiar una base de datos de un servidor a uno embebido Lo intenté y el programa se cuelga
Consulta sobre Servidor Embebido Mysql (resuelto)
Seguramente el problema lo tengas con la version de la lib libmysqld.lib que utilices, eso suele ser un problema En las ultimas versiones de Fwh esta lib se proporciona ya construida en la carpeta LIB
Consulta sobre Servidor Embebido Mysql (resuelto)
Gracias nuevamente por estar!! Bueno usé la lib que viene con fwh, pero no está la dll el resultado fué otro error que me gusta mas, este: [url=https&#58;//imgbb&#46;com/:tqvhahvh][img:tqvhahvh]https&#58;//image&#46;ibb&#46;co/dc9D9k/Sin_t_tulo&#46;png[/img:tqvhahvh][/url:tqvhahvh] Creo que el problema ahora es con la dll, que no coincide con la lib, y que no se suministra en fwh 17.06 Podrían enviárrme la correcta por favor para probar y considerar incluirla en próximas versiones? Y una observación más.... podrían poner el link a servidores embebidos también en el foro en español porque allí falta y creo que el de los ejemplos también.
Consulta sobre Servidor Embebido Mysql (resuelto)
Muchas gracias Cristobal por tu mail, ahora funciona perfectamente!! He hecho diversas pruebas con rowsets, lista de tablas, importar de dbf al server embedded y todo exitoso. Gracias!!!! FWHMariadb/Mysql sigue mostrando excelentes resultados <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Consulta sobre Servidor Embebido Mysql (resuelto)
Jose, me alegra que lo estés disfrutando
Consulta sobre SetKey
Amigos del foro Por favor si alguien me puede ayudar Parto de un browse principal de articulos de inventario con una barra de iconos, uno de los cuales filtra la base de datos. Cuando en el dialogo de establecer las opciones para el filtro tecleo parte del codigo y pulso F2, siempre me manda al primer registro en el browser, no en el mas cercano o el que busco si meto el modelo de inventario completo. Que es lo que estoy haciendo mal ? De antemano gracias por su ayuda Saludos [code=fw:2wn95d8g]<div class="fw" id="{CB}" style="font-family: monospace;"><br /># include <span style="color: #ff0000;">"Fivewin.ch"</span><br /># include <span style="color: #ff0000;">"Inkey.ch"</span><br /><br /><span style="color: #00C800;">STATIC</span> oBar<br /><br /><span style="color: #00C800;">FUNCTION</span> CamPre<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">LOCAL</span> oDlg, oIco<br />    <span style="color: #00C800;">LOCAL</span> olbx<br /><br />    <br />    USE fam <span style="color: #0000ff;">INDEX</span> famcve <span style="color: #00C800;">NEW</span><br />    USE cat <span style="color: #0000ff;">INDEX</span> catmod, catfm <span style="color: #00C800;">NEW</span><br />    <br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oIco FILENAME <span style="color: #ff0000;">"logo3.ico"</span><br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Mantenimiento de artículos"</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"ActArt"</span> <span style="color: #0000ff;">ICON</span> oIco<br />      oDlg:<span style="color: #000000;">lHelpIcon</span> := .F.<br /><br />    <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">LISTBOX</span> olbx ;<br />        FIELDS cat->modelo, cat->desc1, cat->famil, cat->unidad, ;<br />                 cat->moneda, TRANSFORM<span style="color: #000000;">&#40;</span>cat->prepub,<span style="color: #ff0000;">"99,999,999.99"</span><span style="color: #000000;">&#41;</span>, ;<br />                 TRANSFORM<span style="color: #000000;">&#40;</span>cat->premin,<span style="color: #ff0000;">"99,999,999.99"</span><span style="color: #000000;">&#41;</span> ;<br />        HEAD <span style="color: #ff0000;">"MODELO"</span>, <span style="color: #ff0000;">"DESCRIPCION"</span>, <span style="color: #ff0000;">"LINEA"</span>, <span style="color: #ff0000;">"UNIDAD"</span>, <span style="color: #ff0000;">"MONEDA"</span>, <span style="color: #ff0000;">"PRECIO PUB."</span>, ;<br />              <span style="color: #ff0000;">"PRECIO MIN."</span> ;<br />        FIELDSIZES <span style="color: #000000;">119</span>, <span style="color: #000000;">322</span>, <span style="color: #000000;">62</span>, <span style="color: #000000;">66</span>, <span style="color: #000000;">70</span>, <span style="color: #000000;">90</span>, <span style="color: #000000;">90</span> ;<br />        <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"cat"</span> ;<br />        <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> ;<br />        <span style="color: #0000ff;">OF</span> oDlg ;<br />        <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">LEFT</span> DBLCLICK<span style="color: #000000;">&#40;</span> Procesa<span style="color: #000000;">&#40;</span> oLbx <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />        oLbx:<span style="color: #000000;">aJustify</span> = <span style="color: #000000;">&#123;</span> .f., .f., .f., .f., .f., .t.,.t. <span style="color: #000000;">&#125;</span><br />        oLbx:<span style="color: #000000;">cToolTip</span> := <span style="color: #ff0000;">"Seleccione con doble click o con Enter"</span><br />        oLbx:<span style="color: #000000;">bKeydown</span> := <span style="color: #000000;">&#123;</span>|nKey| IIF<span style="color: #000000;">&#40;</span>nKey = <span style="color: #000000;">13</span>, Procesa<span style="color: #000000;">&#40;</span> Olbx <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />        oLbx:<span style="color: #000000;">nClrForeHead</span> = nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">255</span>,<span style="color: #000000;">255</span><span style="color: #000000;">&#41;</span><br />        oLbx:<span style="color: #000000;">nClrBackHead</span> = nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">177</span>,<span style="color: #000000;">83</span>,<span style="color: #000000;">197</span><span style="color: #000000;">&#41;</span><br />        <br />    <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />        <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span>  barra<span style="color: #000000;">&#40;</span> oDlg, oLbx <span style="color: #000000;">&#41;</span><br />        CLOSE DATABASES<br />        <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span>       <br /><br /><span style="color: #B900B9;">// --------------------------------------------------------</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> BARRA<span style="color: #000000;">&#40;</span>oDlg, oLbx<span style="color: #000000;">&#41;</span><br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">32</span>,<span style="color: #000000;">32</span> 3DLOOK <span style="color: #0000ff;">OF</span> oDlg<br /><br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar ;<br />        FILENAME <span style="color: #ff0000;">"filtro.bmp"</span> ;<br />        <span style="color: #0000ff;">ADJUST</span> ;    <br />        NOBORDER TOOLTIP <span style="color: #ff0000;">"Filtra"</span> ;<br />        <span style="color: #0000ff;">ACTION</span> filtra<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    --------<br />    --------<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//-------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> Filtra<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">LOCAL</span> oDlg, oBAce<br />    <span style="color: #00C800;">LOCAL</span> oGet1, oGet2, oGet3<br />    <span style="color: #00C800;">LOCAL</span> cCodIni, cCodFin, cFamil<br />    <br />    cCodIni := cCodFin := SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">16</span><span style="color: #000000;">&#41;</span><br />    cFamil := SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#41;</span><br />    <br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"CamPre"</span><br />      oDlg:<span style="color: #000000;">lHelpIcon</span> := .F.<br />    <br />    <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet1 <span style="color: #0000ff;">VAR</span> cCodIni <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">update</span> ;<br />        <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@!"</span>        <br />        oGet1:<span style="color: #000000;">bGotFocus</span> := <span style="color: #000000;">&#123;</span>||SetKey<span style="color: #000000;">&#40;</span> VK_F2, <span style="color: #000000;">&#123;</span> || VerCodIni<span style="color: #000000;">&#40;</span> oGet1, @cCodIni, oDlg <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />        oGet1:<span style="color: #000000;">bLostFocus</span> := <span style="color: #000000;">&#123;</span>||SetKey<span style="color: #000000;">&#40;</span> VK_F2, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /><br />    -------<br />    -------<br />    <br />    <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />    <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//-------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> VerCodIni<span style="color: #000000;">&#40;</span> oGet1, cCodIni, oDlg <span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">LOCAL</span> oDlgIni, oLbx<br />        <br />    <span style="color: #0000ff;">SELECT</span> cat<br />    cat-><span style="color: #000000;">&#40;</span>DBSEEK<span style="color: #000000;">&#40;</span>TRIM<span style="color: #000000;">&#40;</span>cCodIni<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgIni <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Catálogo de artículos"</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"BrwCat"</span><br />      oDlgIni:<span style="color: #000000;">lHelpIcon</span> := .F.<br /><br />    <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">LISTBOX</span> olbx ;<br />        FIELDS cat->modelo, cat->desc1, ;<br />                 cat->famil ;<br />        HEAD <span style="color: #ff0000;">"MODELO"</span>, PADC<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"DESCRIPCION"</span>,<span style="color: #000000;">45</span>,<span style="color: #ff0000;">" "</span><span style="color: #000000;">&#41;</span>, ;<br />              <span style="color: #ff0000;">"LINEA"</span> ;<br />        <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"cat"</span> ;<br />        <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> ;<br />        <span style="color: #0000ff;">OF</span> oDlgIni ;<br />        <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">LEFT</span> DBLCLICK<span style="color: #000000;">&#40;</span> cCodIni := cat->modelo, oGet1:<span style="color: #000000;">varput</span><span style="color: #000000;">&#40;</span>cCodIni<span style="color: #000000;">&#41;</span>, ;<br />                                oGet1:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oDlgIni:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />        oLbx:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">&#123;</span>|nKey| ;<br />            IIF<span style="color: #000000;">&#40;</span>nKey = <span style="color: #000000;">13</span>,<span style="color: #000000;">&#40;</span>cCodIni:=cat->modelo,oGet1:<span style="color: #000000;">varput</span><span style="color: #000000;">&#40;</span>cCodIni<span style="color: #000000;">&#41;</span>, ;<br />                 oGet1:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,oDlgIni:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />        oLbx:<span style="color: #000000;">cToolTip</span> := <span style="color: #ff0000;">"Seleccione con Enter o con Doble click"</span><br />        <br />    <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgIni <span style="color: #0000ff;">CENTERED</span><br />        KEYBOARD CHR<span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span><br />        <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//-------------------------------------------------------------------//</span><br /><br /><br /> </div>[/code:2wn95d8g]
Consulta sobre SetKey
Juan, Es posible que cuando pulsas F2, cCodIni sigue valiendo aún Space( 16 ), puesto que aún no has validado el Get. Prueba esto por si pudiese servir: [code=fw:1ixoam60]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet1 <span style="color: #0000ff;">VAR</span> cCodIni <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">update</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@!"</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #00C800;">Self</span>:<span style="color: #000000;">Assign</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oGet1:<span style="color: #000000;">bGotFocus</span> := <span style="color: #000000;">&#123;</span>||SetKey<span style="color: #000000;">&#40;</span> VK_F2, <span style="color: #000000;">&#123;</span> || VerCodIni<span style="color: #000000;">&#40;</span> oGet1, @cCodIni, oDlg <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oGet1:<span style="color: #000000;">bLostFocus</span> := <span style="color: #000000;">&#123;</span>||SetKey<span style="color: #000000;">&#40;</span> VK_F2, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:1ixoam60] Saludos!
Consulta sobre SetKey
triumvirato Muchísimas gracias por tu respuesta, funcionó perfectamente Saludos
Consulta sobre Sql
Hola amigos, mi consulta es la siguiente llego a mi manos un manual de la libreria FcOdbc, sera asi tan facil de trabajar con bases SQL <!-- m --><a class="postlink" href="http://www.fcsodbc.com/">http://www.fcsodbc.com/</a><!-- m --> Saludos Jose
Consulta sobre Sql
Te lo aseguro, es muy facil. La estamos usando hace varios meses y esta muy buena. Y el soporte de Freddy es excelente
Consulta sobre Sql
Amigo Jose y que tan rapida es, sera muy lenta saludos
Consulta sobre Sql
En realidad hay varias (muchas) formas de atacar bases de datos SQL y todas son bastante rapidas, dependiendo claro, del diseño que hayas hecho de tu BD. FiveWin incluye nativamente 3 clases que te permiten manejar SQLs directamente: TODBC TDBODBC TRDDODBC Definitivamente mi favorita, y que se puede utilizar con OLE desde xHarbour, es via ADO (Activex Data Objects) ampliamente recomendable y bastante rapida. Y luego estan las clases de terceros de paga: Eagle / Condor La que mencionas de Freddy Mediator SQL RDD
Consulta sobre Sql
José, Yo estoy utilizando ADO para atacar SqlServer. Ado es un buen sistema, relativamente fácil, estable y de amplio abanico de bases de datos. En <!-- w --><a class="postlink" href="http://www.capelblog.com">www.capelblog.com</a><!-- w --> tienes dos clases básicas y una serie de ejemplos (entre ellos un ABM completo) para atacar un SqlServer. Saludos, José Luis Capel
Consulta sobre Sql
renee e jlcapel Como estão fazendo com LISTBOX via ADO mauricio
Consulta sobre Sql
[quote="mauricioajordao":1o09dh11]renee e jlcapel Como estão fazendo com LISTBOX via ADO mauricio[/quote:1o09dh11] Tienes que hacer unas modificaciones en las datas: bLogicLen y bSkipped. en la pagina de JL Capel tienes un ejemplo.
Consulta sobre Sql
OK renee qual a Pagina .. WWW ?????? eu estou a modificar a tcbrowse , mas preciso ver exemplos OK.. mauricio (brasil)
Consulta sobre Sql
Mauricio, [quote:2gf1h0pk] qual a Pagina .. WWW ?????? [/quote:2gf1h0pk] <!-- w --><a class="postlink" href="http://www.capelblog.com">www.capelblog.com</a><!-- w --> Saludos, José Luis Capel
Consulta sobre Sql
MUITO OBRIGADO MAURICIO
Consulta sobre Sql
joao Qual o PRG USa LISTBOX Mauricio
Consulta sobre TDolphin
Hola Gente: Una consulta sobre TDolphin: Con CheckError puedo capturar un error al agregar un registro con clave primaria duplicada, o un registro que intenta romper la integridad referencial? O el control es manual desde el programa? Si es posible capturar el error, alguien tiene un ejemplo? Gracias de antemano
Consulta sobre TDolphin
Las claves primarias para que no se dupliquen puedes controlarlas al diseñar las tablas, por lo menos yo lo hago asi, al igual en mi PRG uso una busqueda por si acaso, aca te dejo un ejemplo sencillo..espero te sirva y sea sobre lo que hablas, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> // PARA VALIDAR NO SE REPITA CAMPO CLAVE FUNCTION existe( cQuery, aVar, cVar ) // cVar CONTROLA EL CAMPO POR EL CUAL SE HACE LA VALIDACION, ES DECIR ES EL CAMPO CLAVE // cQuery LA CONSULTA // aVar ES EL VALOR ENTRADO... LOCAL lRet := .f. // CONTROLA EL RETORNO SI EXISTE aVar IF !EMPTY( cValToChar( aVar ) ) // SE ESCRIBIO ALGO EN EL CAMPO CLAVE IF cQuery:Seek( aVar, cVar ) > 0 // SI ENCUENTRA EL VALOR, EXISTE MSGALERT( "Valor ya Registrado...", oDatos:cTitMsg ) ELSE lRet := .t. ENDIF ELSE MSGALERT("Campo no puede quedar Vacio", oDatos:cTitMsg) ENDIF RETURN( lRet )
Consulta sobre TDolphin
Gracias José Luis por la respuesta. Exactamente así lo hago, pero el control es manual. Si la base de datos tiene definida una clave primaria, o un campo con valor unico, previamente a grabar tengo que verificar que los datos sean correctos mediante un seek o find. Igualmente para cuando son datos que afectarían a la integridad referencial de la base no? Porque sino, da un error en tiempo de ejecución... Seguiré mirando...
Consulta sobre TDolphin
Para el uso de claves primarias, si no son externas, utilizo un archivo que lleve esa clave y un triggers sobre la base de datos que contiene dicha clave, evitando la duplicidad. Saludos
Consulta sobre TDolphin
Hola te dejo un ejemplo usando el servidor de pruebas de dolphin el primer ejemplo muestra como el error es producido sin procesarlo y la salida del sistema las otras dos forma te muestro como procesar el error Dolphin tiene 2 formas diferentes de manejar los errores 1) controlados por el mismo dolphin y puedes capturar el error usando TRY/CATCH 2) controlarlo por una funcion propia EJEMPLO 1 (sin procesal el error) [code=fw:3ma1jjvk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"tdolphin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br />   <span style="color: #00C800;">local</span> oServer<br />   <span style="color: #00C800;">local</span> aColumns := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"id"</span>, <span style="color: #ff0000;">"name"</span>, <span style="color: #ff0000;">"last"</span> <span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">local</span> aValues  := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">8</span>, <span style="color: #ff0000;">"name 8"</span>, <span style="color: #ff0000;">"last 8"</span> <span style="color: #000000;">&#125;</span> <br />   <br />   CONNECT oServer HOST <span style="color: #ff0000;">"dolphintest.sitasoft.net"</span> ;<br />                   USER <span style="color: #ff0000;">"test_dolphin"</span> ;<br />                   PASSWORD <span style="color: #ff0000;">"123456"</span> ;<br />                   PORT <span style="color: #000000;">3306</span> ;<br /><br />   <br />   SELECTDB <span style="color: #ff0000;">"dolphin_man"</span><br />   <br />   oServer:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DELETE FROM test WHERE id=8"</span> <span style="color: #000000;">&#41;</span>;<br />   <br />   INSERTMYSQL <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"test"</span> COLUMNS acolumns VALUES aValues<br />   <br />   ? <span style="color: #ff0000;">"insertado"</span>, <span style="color: #ff0000;">"ahora producimos el error y saldra el programa"</span><br />   <br />   <span style="color: #B900B9;">//se produce el error y sale el programa</span><br />   INSERTMYSQL <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"test"</span> COLUMNS acolumns VALUES aValues<br />         <br />   oServer:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:3ma1jjvk] EJEMPLO 2 (usando TRY/CATCH) [code=fw:3ma1jjvk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"tdolphin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br />   <span style="color: #00C800;">local</span> oServer<br />   <span style="color: #00C800;">local</span> aColumns := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"id"</span>, <span style="color: #ff0000;">"name"</span>, <span style="color: #ff0000;">"last"</span> <span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">local</span> aValues  := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">8</span>, <span style="color: #ff0000;">"name 8"</span>, <span style="color: #ff0000;">"last 8"</span> <span style="color: #000000;">&#125;</span> <br />   <span style="color: #00C800;">local</span> oError<br />   <br />   CONNECT oServer HOST <span style="color: #ff0000;">"dolphintest.sitasoft.net"</span> ;<br />                   USER <span style="color: #ff0000;">"test_dolphin"</span> ;<br />                   PASSWORD <span style="color: #ff0000;">"123456"</span> ;<br />                   PORT <span style="color: #000000;">3306</span> <br /><br />   <br />   SELECTDB <span style="color: #ff0000;">"dolphin_man"</span><br />    <br />   oServer:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DELETE FROM test WHERE id=8"</span> <span style="color: #000000;">&#41;</span>;<br />    <br />   INSERTMYSQL <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"test"</span> COLUMNS acolumns VALUES aValues<br />   <br />   ? <span style="color: #ff0000;">"insertado"</span>, <span style="color: #ff0000;">"ahora producimos el error y lo capturamos con TRY/CATCH"</span><br />   <br />   <span style="color: #00C800;">TRY</span> <br />      INSERTMYSQL <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"test"</span> COLUMNS acolumns VALUES aValues<br />   CATCH oError<br />      ShowError<span style="color: #000000;">&#40;</span> oError <span style="color: #000000;">&#41;</span>   <br />   END<br />         <br />   oServer:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> ShowError<span style="color: #000000;">&#40;</span> oError <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"   Descripción:  "</span> + oError:<span style="color: #000000;">Description</span>+CRLF+;<br />            <span style="color: #ff0000;">"      Sub Code:  "</span> + STR<span style="color: #000000;">&#40;</span>oError:<span style="color: #000000;">SubCode</span><span style="color: #000000;">&#41;</span>+CRLF+;<br />            <span style="color: #ff0000;">"      Severity:  "</span> + STR<span style="color: #000000;">&#40;</span>oError:<span style="color: #000000;">Severity</span><span style="color: #000000;">&#41;</span>+CRLF+;<br />            <span style="color: #ff0000;">"     SubSystem:  "</span> + oError:<span style="color: #000000;">SubSystem</span>+CRLF+;<br />            <span style="color: #ff0000;">"     Operation:  "</span> + oError:<span style="color: #000000;">Operation</span> <span style="color: #000000;">&#41;</span><br />            <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:3ma1jjvk] EJEMPLO 3 (funcion propia) [code=fw:3ma1jjvk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"tdolphin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br />   <span style="color: #00C800;">local</span> oServer<br />   <span style="color: #00C800;">local</span> aColumns := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"id"</span>, <span style="color: #ff0000;">"name"</span>, <span style="color: #ff0000;">"last"</span> <span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">local</span> aValues  := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">8</span>, <span style="color: #ff0000;">"name 8"</span>, <span style="color: #ff0000;">"last 8"</span> <span style="color: #000000;">&#125;</span> <br />   <br />   CONNECT oServer HOST <span style="color: #ff0000;">"dolphintest.sitasoft.net"</span> ;<br />                   USER <span style="color: #ff0000;">"test_dolphin"</span> ;<br />                   PASSWORD <span style="color: #ff0000;">"123456"</span> ;<br />                   PORT <span style="color: #000000;">3306</span> ;<br />                   <span style="color: #0000ff;">ON</span> ERROR VerificaError<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">Self</span>, nError, lInternal, cExtra <span style="color: #000000;">&#41;</span><br /><br />   <br />   SELECTDB <span style="color: #ff0000;">"dolphin_man"</span><br />    <br />   oServer:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DELETE FROM test WHERE id=8"</span> <span style="color: #000000;">&#41;</span>;<br />    <br />   INSERTMYSQL <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"test"</span> COLUMNS acolumns VALUES aValues<br />   <br />   ? <span style="color: #ff0000;">"insertado"</span>, <span style="color: #ff0000;">"ahora producimos el error y NO saldra el programa"</span><br />   <br />   <span style="color: #B900B9;">//se produce el error y sale el programa</span><br />   INSERTMYSQL <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"test"</span> COLUMNS acolumns VALUES aValues<br />         <br />   oServer:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> VerificaError<span style="color: #000000;">&#40;</span> oServer, nError, lInternal, cExtra <span style="color: #000000;">&#41;</span><br /><br />   ? <span style="color: #ff0000;">"SE PRODUJO UN ERROR EN LA SENTENCIA"</span>, ;<br />     <span style="color: #ff0000;">"Codigo del Error:"</span> + Str<span style="color: #000000;">&#40;</span> nError <span style="color: #000000;">&#41;</span>,;<br />     <span style="color: #ff0000;">"Descripcion: "</span> + oServer:<span style="color: #000000;">ErrorTxt</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" "</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! Empty<span style="color: #000000;">&#40;</span> cExtra <span style="color: #000000;">&#41;</span>, cExtra, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span>, ;<br />     <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lInternal, <span style="color: #ff0000;">"Error Interno"</span>, <span style="color: #ff0000;">"Error desde MySql"</span> <span style="color: #000000;">&#41;</span><br />     <br />   <span style="color: #B900B9;">//si queremos q el programa salga podriamos generar el objeto error y obligarlo a salir</span><br />   <span style="color: #B900B9;">//para mejor ejemplo consulta la funcion Dolphin_DefError</span><br />   <br />   <span style="color: #B900B9;">//descomentar la siguiente linea para generar el objeto error y obligar la salida del programa</span><br />   <span style="color: #B900B9;">//Dolphin_DefError( oServer, nError, lInternal, cExtra )</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:3ma1jjvk]
Consulta sobre TDolphin
Muchas gracias por las respuestas! Clarísimo!! Un abrazo.
Consulta sobre TDolphin
Daniel: Incorporé la opción de la función propia y el resultado es excelente, si bien es apropiado que haga los controles básicos por programa para que los mensajes sean en castellano y sea más amigable, el incorporar la función me permite seguir ejecutando el programa y usar todo el poder de MySql. Muchas gracias por el aporte!
Consulta sobre TDolphin
Hola Daniel. Tienes un manual que explique desde cero todas las funciones de tdolphin ? Saludos
Consulta sobre TDolphin
Hola No, es lamentable pues me considero totalmente inepto para construir un manual, algunos se han ofrecido a redactarlo, pero sin exito alguno <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
Consulta sobre TDolphin
Hola Daniel. Si eso nos pasa a muchos. Sin embargo, he intentado usar tu propuesta de tdolphin, sin exito, basicamente por que sigo pensando como se usan las tablas DBF. Tengo un proyecto nuevo para desarrollar y quisiera hacerlo con tdolphin desde cero, pero requiero conocer todas las habilidsades de la herramienta antes de iniciar el proyecto y no estar haciendo preguntas cada vez que se presenta un problema. Cual seria tu recomendacion para iniciar desde cero ? Saludos
Consulta sobre TDolphin
Hola aprovecho este hilo para hacer una consulta a Daniel sobre uno de los ejemplos, es sobre el archivo testfile.prg. Logro compilarlo y ejecutarlo pero no se que tipo de archivo debo abrir. Y de paso les consuto otra duda, estoy haciendo un pequeño ABM de clientes relacionados con la tabla de localidades y a su vez esta con la tabla de provincias, y la duda que tengo es si como hacer las relaciones y mostrarlos en un browse. Estoy buscandolo en los samples pero aun no lo encontre no se si esta ese ejemplo. Saludos desde Argentina a todo el foro Marcelo.
Consulta sobre TDolphin
Testfile es un pequeño ejemplo de como podemos subir y descargar cualquier tipo de archivo en una tabla, importante que tengamos una columna con el nombre del archivo o la extension para poder determinar como abrirlo una vez lo bajemos de la base de datos, aqui les pongo el testfile modificado para mi proyecto. [code=fw:9bhjso88]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"recursos.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbcompat.ch"</span><br /><br />#ifndef __XHARBOUR__<br /><span style="color: #00D7D7;">#define</span> CurDrive &nbsp;hb_curdrive<br />#endif<br /><br /><br /><span style="color: #00C800;">FUNCTION</span> Menu_Anexo<span style="color: #000000;">&#40;</span> cDoc <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oWnd3<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oMenu<br /><br />&nbsp; &nbsp;cDocu := cDoc<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2007</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Cargar Archivo"</span> <span style="color: #0000ff;">ACTION</span> LoadFile<span style="color: #000000;">&#40;</span> cDoc <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Listar Archivos"</span> <span style="color: #0000ff;">ACTION</span> DataBrowse<span style="color: #000000;">&#40;</span> cDoc <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">RETURN</span> oMenu<br /><br /><span style="color: #B900B9;">//--------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> LoadFile1<span style="color: #000000;">&#40;</span> cDocu <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">LOCAL</span> cFile := cGetFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"*.*"</span>, <span style="color: #ff0000;">"Seleccione un Archivo"</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> uData<br /><span style="color: #00C800;">LOCAL</span> oDlg<br /><br /><span style="color: #00C800;">TRY</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ! Empty<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; ??? <span style="color: #ff0000;">"Leyendo Archivo"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; uData = D_ReadFile<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; ??? <span style="color: #ff0000;">"Archivo leido"</span><br /><br />&nbsp; &nbsp; &nbsp; nTamb := len<span style="color: #000000;">&#40;</span> udata <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nTamk := int<span style="color: #000000;">&#40;</span> nTamb / <span style="color: #000000;">1024</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nTam := nTamb / <span style="color: #000000;">&#40;</span> <span style="color: #000000;">1024</span> * <span style="color: #000000;">1024</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nTam > <span style="color: #000000;">6</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"No puede subir el archivo que intenta anexar tiene "</span>+alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> nTam,<span style="color: #000000;">6</span>,<span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">"MB"</span>+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">", El limite maximo por archivo es 5 MB"</span>+CRLF+CRLF+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"Si necesita subir un archivo mas grande dividalo en varios archivos"</span>,<span style="color: #ff0000;">"Atencion"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ??? &nbsp;<span style="color: #ff0000;">"Identificando tamaños"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> nTamb > <span style="color: #000000;">&#40;</span> <span style="color: #000000;">1024</span> * <span style="color: #000000;">1024</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cTam := alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> nTam, <span style="color: #000000;">6</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">" MBytes"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;elseif nTamb > <span style="color: #000000;">1024</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cTam := alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> nTamk, <span style="color: #000000;">6</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">" KBytes"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cTam := alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> nTamk, <span style="color: #000000;">6</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">" Bytes"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;??? <span style="color: #ff0000;">"Haciendo consulta para verificar existencia"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oQryU := oServer:<span style="color: #000000;">Query</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Select id, filename, tam from files where filename ='"</span>+ GetOnlyName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> +<span style="color: #ff0000;">"' and numdoc ='"</span>+cDocu+<span style="color: #ff0000;">"'"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oQryU:<span style="color: #000000;">LastREc</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> msgyesno<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Esta seguro de Reemplazar el Archivo "</span>+CRLF+CRLF+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GetOnlyName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" que ya existe ?"</span>,<span style="color: #ff0000;">"Atencion"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oServer:<span style="color: #000000;">SqlQuery</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"update files set file = load_file('/xampp/mysql/bin/files/"</span>+GetOnlyName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"') where filename ='"</span>+ GetOnlyName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> +<span style="color: #ff0000;">"' and numdoc = '"</span>+cDocu+<span style="color: #ff0000;">"'"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> msgyesno<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Esta seguro de Anexar el Archivo "</span>+CRLF+CRLF+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GetOnlyName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" ?"</span>,<span style="color: #ff0000;">"Atencion"</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> conexion_ftp<span style="color: #000000;">&#40;</span>cFile<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oServer:<span style="color: #000000;">Insert</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"files"</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"numdoc"</span>, <span style="color: #ff0000;">"filename"</span>, <span style="color: #ff0000;">"tam"</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> cDocu, GetOnlyName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span>, cTam &nbsp;<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oServer:<span style="color: #000000;">SqlQuery</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"update files set file = load_file('/xampp/mysql/bin/files/"</span>+GetOnlyName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"') where filename ='"</span>+ GetOnlyName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> +<span style="color: #ff0000;">"' and numdoc = '"</span>+cDocu+<span style="color: #ff0000;">"'"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Endif</span><br />&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oQryU:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Archivo Guardado Satisfactoriamente !!"</span><span style="color: #000000;">&#41;</span>&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span>&nbsp; <br /><br />&nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />CATCH oErr<br /><br />&nbsp; &nbsp; &nbsp;ShowError<span style="color: #000000;">&#40;</span> oErr <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br />END<br /><br /><span style="color: #00C800;">RETURN</span><br /><br /><span style="color: #B900B9;">//--------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> LoadFile<span style="color: #000000;">&#40;</span> cDocu <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> oDlg, aGet1, aGet2, cDescrip:= space<span style="color: #000000;">&#40;</span><span style="color: #000000;">80</span><span style="color: #000000;">&#41;</span>, cFile:=space<span style="color: #000000;">&#40;</span><span style="color: #000000;">120</span><span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">/* LOCAL cFile := cGetFile( "Imagen Bitmap (*.bmp)| *.bmp|" + &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Imagen JPEG &nbsp; (*.jpg)| *.jpg|" + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Imagen GIF &nbsp; &nbsp;(*.gif)| *.gif|" &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Word &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(*.doc*)| *.doc*|" + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Excel &nbsp; &nbsp; &nbsp; &nbsp; (*.xls*)| *.xls*|" + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"PowerPoint &nbsp; &nbsp;(*.ppt*)| *.ppt*|" + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Adobe PDF &nbsp; &nbsp; (*.pdf)| *.pdf|" + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Archivo Texto (*.txt)| *.txt|" + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Todos &nbsp; &nbsp; &nbsp; &nbsp; (*.*)| *.*" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ,"Seleccione un Archivo", 4 )<br /><br />&nbsp; */</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"BUSCAFILE"</span> <span style="color: #0000ff;">FONT</span> oFontb <span style="color: #B900B9;">// TRANSPARENT</span><br /><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> aGet1 <span style="color: #0000ff;">VAR</span> cDescrip <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@X"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> aGet2 <span style="color: #0000ff;">VAR</span> cFile <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@X"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> &nbsp;READONLY<br /><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBot1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">301</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"FOLDER_ADD_16"</span> TOOLTIP <span style="color: #ff0000;">"Buscar Archivo"</span> <span style="color: #0000ff;">OF</span> oDlg &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cFile := cGetFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Imagen Bitmap (*.bmp)| *.bmp|"</span> + &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Imagen JPEG &nbsp; (*.jpg)| *.jpg|"</span> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Imagen GIF &nbsp; &nbsp;(*.gif)| *.gif|"</span> &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Word &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(*.doc*)| *.doc*|"</span> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Excel &nbsp; &nbsp; &nbsp; &nbsp; (*.xls*)| *.xls*|"</span> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"PowerPoint &nbsp; &nbsp;(*.ppt*)| *.ppt*|"</span> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Adobe PDF &nbsp; &nbsp; (*.pdf)| *.pdf|"</span> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Archivo Texto (*.txt)| *.txt|"</span> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Todos &nbsp; &nbsp; &nbsp; &nbsp; (*.*)| *.*"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ,<span style="color: #ff0000;">"Seleccione un Archivo"</span>, <span style="color: #000000;">9</span> <span style="color: #000000;">&#41;</span> , ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iif<span style="color: #000000;">&#40;</span>empty<span style="color: #000000;">&#40;</span> cDescrip <span style="color: #000000;">&#41;</span>, cDescrip := padr<span style="color: #000000;">&#40;</span>GetOnlyName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">80</span><span style="color: #000000;">&#41;</span> ,<span style="color: #000000;">&#41;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aGet1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aGet2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> , oBot2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBot2 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">1</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span> msgrun<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Subiendo el Archivo a la base de datos ......"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"Por favor espere"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span>|| Sube_archivo<span style="color: #000000;">&#40;</span> cDocu, cFile, cDescrip <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">WHEN</span> ! empty<span style="color: #000000;">&#40;</span> cDescrip <span style="color: #000000;">&#41;</span> .and. file<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br /><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBot3 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">2</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">Action</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><br /><span style="color: #00C800;">Return</span><br /><br /><span style="color: #B900B9;">//--------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> Sube_archivo<span style="color: #000000;">&#40;</span> cDocu, cFile , cDescrip <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> uData<br /><span style="color: #00C800;">LOCAL</span> oDlg<br /><br /><span style="color: #00C800;">TRY</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ! Empty<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; ??? <span style="color: #ff0000;">"Leyendo Archivo"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// uData := D_ReadFile( cFile )</span><br /><br />&nbsp; &nbsp; &nbsp; uData &nbsp;:= memoread<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; ??? <span style="color: #ff0000;">"Archivo leido"</span><br /><br />&nbsp; &nbsp; &nbsp; nTamb := len<span style="color: #000000;">&#40;</span> udata <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nTamk := int<span style="color: #000000;">&#40;</span> nTamb / <span style="color: #000000;">1024</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nTam := nTamb / <span style="color: #000000;">&#40;</span> <span style="color: #000000;">1024</span> * <span style="color: #000000;">1024</span> <span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nTam > nMaxFSize <span style="color: #B900B9;">//2</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"No puede subir el archivo que intenta anexar, tiene "</span>+alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> nTam,<span style="color: #000000;">6</span>,<span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">"MB, "</span>+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"El limite maximo por archivo es "</span>+alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> nMaxFSize,<span style="color: #000000;">6</span>,<span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" MB"</span>+CRLF+CRLF+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"Si necesita subir un archivo mas grande dividalo en varios archivos"</span>,<span style="color: #ff0000;">"Atencion"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ??? &nbsp;<span style="color: #ff0000;">"Identificando tamaños"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> nTamb > <span style="color: #000000;">&#40;</span> <span style="color: #000000;">1024</span> * <span style="color: #000000;">1024</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cTam := alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> nTam, <span style="color: #000000;">6</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">" MBytes"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;elseif nTamb > <span style="color: #000000;">1024</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cTam := alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> nTamk, <span style="color: #000000;">6</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">" KBytes"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cTam := alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> nTamk, <span style="color: #000000;">6</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">" Bytes"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ! oServer:<span style="color: #000000;">Insert</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"files"</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"numdoc"</span>, <span style="color: #ff0000;">"filename"</span>,<span style="color: #ff0000;">"file"</span>, <span style="color: #ff0000;">"tam"</span>,<span style="color: #ff0000;">"descripcion"</span>,<span style="color: #ff0000;">"fecha"</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> cDocu, GetOnlyName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span>, uData, cTam, cDescrip, date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// &nbsp; if conexion_ftp(cFile)</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp;oServer:Insert( "files", { "numdoc", "filename", "tam" }, { cDocu, GetOnlyName( cFile ), cTam &nbsp;} )</span><br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #B900B9;">//&nbsp; &nbsp; &nbsp; &nbsp;oServer:SqlQuery("update files set file = load_file('c:/xampp/mysql/bin/files/"+GetOnlyName( cFile )+"') where filename ='"+ GetOnlyName( cFile ) +"' and numdoc = '"+cDocu+"'")</span><br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; <br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No se pudo subir el archivo a la Base de Datos"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span>&nbsp; &nbsp; <br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />CATCH oErr<br /><br />&nbsp; &nbsp; &nbsp;ShowError<span style="color: #000000;">&#40;</span> oErr <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br />END<br /><br /><span style="color: #00C800;">RETURN</span><br /><br /><span style="color: #B900B9;">//-------------------------------------------//</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">FUNCTION</span> GetOnlyName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nRat<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ! Empty<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nRat = RAt<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"<span style="color: #000000;">\"</span>, cFile )<br />&nbsp; &nbsp; &nbsp; cFile = SubStr( cFile, nRat + 1 )<br />&nbsp; &nbsp;ENDIF<br /><br />RETURN cFile<br /><br />//--------------------------------------------//<br /><br />Function DataBrowse( cDocu )<br /><br />&nbsp; &nbsp;LOCAL oQry<br />&nbsp; &nbsp;LOCAL oDlg<br />&nbsp; &nbsp;LOCAL oBrw<br /><br /><br />&nbsp; &nbsp;oQry = oServer:Query( "</span><span style="color: #0000ff;">SELECT</span> <span style="color: #0000ff;">id</span>, descripcion, filename,tam,fecha <span style="color: #0000ff;">FROM</span> files <span style="color: #0000ff;">where</span> numdoc = <span style="color: #ff0000;">'"+cDocu+"'</span> <span style="color: #0000ff;">order by</span> <span style="color: #0000ff;">ID</span> <span style="color: #0000ff;">desc</span><span style="color: #ff0000;">" )<br /><br /><br />&nbsp; &nbsp;DEFINE DIALOG oDlg TITLE "</span>Historial Anexos<span style="color: #ff0000;">" SIZE 850, 400 FONT oFontb// TRANSPARENT<br /><br />&nbsp; &nbsp;@ 0, 0 XBROWSE oBrw OF oDLg FIELDS oQry:id, oQry:fecha,oQry:descripcion, AllTrim( oQry:filename ), oQry:tam ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HEADERS "</span><span style="color: #0000ff;">ID</span><span style="color: #ff0000;">","</span>Fecha<span style="color: #ff0000;">","</span>Descripcion<span style="color: #ff0000;">","</span>Archivo<span style="color: #ff0000;">","</span>Tamaño<span style="color: #ff0000;">";<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLSIZES 50,80,290,290,80 ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JUSTIFY .F.,.F.,.F., .F.,AL_RIGHT ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LINES ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ON DBLCLICK SaveToTMP( oQry:Id, oQry )<br /><br /><br />&nbsp; &nbsp;oBrw:SetDolphin( oQry, .f., .f. )<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;oBrw:bPopUp &nbsp; &nbsp; &nbsp; &nbsp;:= { |o| ColMenu( o, oQry , oBrw ) }<br />&nbsp; &nbsp;oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW //MARQSTYLE_HIGHLWIN7<br />&nbsp; &nbsp;oBrw:bKeyDown &nbsp; &nbsp; &nbsp;:= {|nKey| iif(nKey==13, SaveToTMP( oQry:Id, oQry ),) }<br />&nbsp; &nbsp;oBrw:CreateFromCode()<br /><br />&nbsp; &nbsp;oDlg:oClient = oBrw<br /><br />&nbsp; &nbsp;ACTIVATE DIALOG oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ON INIT ( oDlg:Resize() ) ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CENTERED<br /><br />&nbsp; &nbsp;oQry:End()<br /><br />RETURN<br /><br />//------------------------------------------------//<br /><br />static function ColMenu( oCol, oQry, oBrw )<br /><br />&nbsp; &nbsp;local oPop<br /><br />&nbsp; &nbsp;MENU oPop POPUP 2007<br />&nbsp; &nbsp; &nbsp; MENUITEM "</span>Guardar en carpeta<span style="color: #ff0000;">" ACTION SaveToDisk( oCol:oBrw:aCols[ 1 ]:Value, oQry )<br />&nbsp; &nbsp; &nbsp; MENUITEM "</span>Eliminar registro<span style="color: #ff0000;">" &nbsp;ACTION iif( msgnoyes("</span>Quiere eliminar este registro<span style="color: #ff0000;">","</span>Precaucion<span style="color: #ff0000;">"), ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( oQry:Delete(), oQry:Refresh(), oBrw:Refresh() ) ,)<br /><br />&nbsp; &nbsp;ENDMENU<br /><br />return oPop<br /><br />//------------------------------------------------//<br /><br />Static Function SaveToDisk( uValue, oQry )<br /><br />&nbsp; &nbsp;LOCAL nHandle<br />&nbsp; &nbsp;LOCAL cDir := cGetDir( "</span>Seleccione una Carpeta<span style="color: #ff0000;">",;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CurDrive() + "</span>:\<span style="color: #ff0000;">" + GetCurDir() + "</span>\<span style="color: #ff0000;">" )<br />&nbsp; &nbsp;LOCAL oQryFind<br /><br />&nbsp; &nbsp;IF ! Empty( cDir )<br /><br />&nbsp; &nbsp; &nbsp; oQry:Seek( uValue, "</span><span style="color: #0000ff;">id</span><span style="color: #ff0000;">", , , , .F. )<br /><br />&nbsp; &nbsp; &nbsp; cursorwait()<br /><br />&nbsp; &nbsp; &nbsp; oQryFind = TDolphinQry():New( "</span><span style="color: #0000ff;">select</span> file <span style="color: #0000ff;">from</span> files <span style="color: #0000ff;">where</span> <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">" + ClipValue2Sql( uValue ), oQry:oServer )<br /><br />&nbsp; &nbsp; &nbsp; nHandle := FCreate( cDir + "</span>\<span style="color: #ff0000;">" + AllTrim( oQry:filename ) )<br /><br />&nbsp; &nbsp; &nbsp; IF FError() # 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MsgInfo( "</span>Error grabando Archivo <span style="color: #ff0000;">" + cDir + "</span>\<span style="color: #ff0000;">" + AllTrim( oQry:filename ) )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RETURN<br />&nbsp; &nbsp; &nbsp; ENDIF<br /><br />&nbsp; &nbsp; &nbsp; FWrite( nHandle, oQryFind:file, Len( oQryFind:file ) )<br />&nbsp; &nbsp; &nbsp; FClose( nHandle )<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; cursorarrow()<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; cFilename := alltrim(oQry:filename)<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; MsgInfo( "</span>Archivo Guardado en la Carpeta: <span style="color: #ff0000;">" + cDir )<br /><br />&nbsp; &nbsp; &nbsp; oQryFind:End()<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; if Msgyesno("</span>Desea Abrir el Archivo ?<span style="color: #ff0000;">")<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; open_archivo( cDir, cFilename )<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; endif<br /><br />&nbsp; &nbsp;ENDIF<br /><br />RETURN<br /><br />//------------------------------------------------//<br /><br />Static Function SaveToTMP( uValue, oQry )<br /><br />&nbsp; &nbsp;LOCAL nHandle, hWnd:=GetActiveWindow()<br />&nbsp; &nbsp;LOCAL cDir := GetEnv("</span>TEMP<span style="color: #ff0000;">")<br /><br />&nbsp; &nbsp;LOCAL oQryFind<br /><br />&nbsp; &nbsp;oQry:Seek( uValue, "</span><span style="color: #0000ff;">id</span><span style="color: #ff0000;">", , , , .F. )<br /><br />&nbsp; &nbsp;cursorwait()<br /><br />&nbsp; &nbsp;oQryFind = TDolphinQry():New( "</span><span style="color: #0000ff;">select</span> file <span style="color: #0000ff;">from</span> files <span style="color: #0000ff;">where</span> <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">" + ClipValue2Sql( uValue ), oQry:oServer )<br /><br />&nbsp; &nbsp; cFilename := AllTrim( oQry:filename )<br /><br />//&nbsp; if ! cFileExt( cFilename ) $ "</span>JPG,JIF,GIF,BMP,DIB,RLE,TGA,PCX<span style="color: #ff0000;">"<br /><br />&nbsp; &nbsp; &nbsp;nHandle := FCreate( cDir + "</span>\<span style="color: #ff0000;">" + cFilename )<br /><br />&nbsp; &nbsp; &nbsp;IF FError() # 0<br /><br />&nbsp; &nbsp; &nbsp; // &nbsp; MsgInfo( "</span>Error grabando Archivo <span style="color: #ff0000;">" + cDir + "</span>\<span style="color: #ff0000;">" + AllTrim( oQry:filename ) )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RETURN<br /><br />&nbsp; &nbsp; &nbsp;ENDIF<br /><br />&nbsp; &nbsp; &nbsp;FWrite( nHandle, oQryFind:file, Len( oQryFind:file ) )<br />&nbsp; &nbsp; &nbsp;FClose( nHandle )<br /><br />// &nbsp; ENDIF<br /><br />&nbsp; &nbsp; cursorarrow()<br /><br />&nbsp; &nbsp; cImage := oQryFind:file<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;oQryFind:End()<br /><br />&nbsp; &nbsp; open_archivo( cDir, cFilename, cImage )<br /><br />RETURN<br /><br />//-----------------------------------------//<br /><br />Function open_archivo( cDir, cFilename, cImage )<br />hWnd:=GetActiveWindow()<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; do case<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; // &nbsp;case cFileExt( cFilename ) == "</span>PDF<span style="color: #ff0000;">"<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; &nbsp; Main_Pdf( cDir+"</span>\<span style="color: #ff0000;">"+cFilename )<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &nbsp;cFileExt( cFilename ) $ "</span>XLSX,DOCX,PPTX<span style="color: #ff0000;">"<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp; ShellExecute(hWnd,"</span>open<span style="color: #ff0000;">","</span>excel.exe<span style="color: #ff0000;">",'"</span><span style="color: #ff0000;">'+cDir+"<span style="color: #000000;">\"</span>+cFilename+'</span><span style="color: #ff0000;">"',,1)<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShellExecute(,"</span>Open<span style="color: #ff0000;">",'"</span><span style="color: #ff0000;">'+cDir+"<span style="color: #000000;">\"</span>+cFilename+'</span><span style="color: #ff0000;">"',,,3)<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case cFileExt( cFilename ) $ "</span>JPG,JIF,GIF,BMP,DIB,RLE,TGA,PCX,PDF<span style="color: #ff0000;">"<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp;VerImagen( cDir, cFilename, cImage )<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShellExecute(,"</span>Open<span style="color: #ff0000;">",'"</span><span style="color: #ff0000;">'+cDir+"<span style="color: #000000;">\"</span>+cFilename+'</span><span style="color: #ff0000;">"',,,3)<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;otherwise<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShellExecute(,"</span>Open<span style="color: #ff0000;">",'"</span><span style="color: #ff0000;">'+cDir+"<span style="color: #000000;">\"</span>+cFilename+'</span><span style="color: #ff0000;">"',,,3)<br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; endcase<br />&nbsp; &nbsp; &nbsp; &nbsp; <br /><br />Return<br /><br />//-----------------------------------------//<br /><br />function Main_pdf(cFile)<br /><br />&nbsp; &nbsp;local oWnd, oActiveX<br /><br />&nbsp; &nbsp;DEFINE WINDOW oWnd TITLE "</span>Controles Visor PDF<span style="color: #ff0000;">" //TRANSPARENT<br /><br />&nbsp; &nbsp;oActiveX = TActiveX():New( oWnd, "</span>AcroPDF.PDF<span style="color: #000000;">.1</span><span style="color: #ff0000;">" ) // Use "</span>AcroPDF.PDF<span style="color: #000000;">.1</span><span style="color: #ff0000;">" for Acrobat Reader 7<br /><br />&nbsp; &nbsp;oWnd:oClient = oActiveX // To fill the entire window surface<br /><br />&nbsp; &nbsp;oActiveX&#058;Do( "</span>LoadFile<span style="color: #ff0000;">", cFile &nbsp;)<br />&nbsp; &nbsp;oActiveX&#058;Do( "</span>SetCurrentPage<span style="color: #ff0000;">", 1 )<br /><br />&nbsp; &nbsp;ACTIVATE WINDOW oWnd<br /><br />return nil<br /><br /><br />//-----------------------------------------//<br /><br />Static FUNCTION ShowError( oError )<br /><br />&nbsp; cErr:= "</span> Error: <span style="color: #000000;">No</span> se pudo Subir el Archivo !!<span style="color: #ff0000;">"+CRLF+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"</span> Descripción &nbsp;: <span style="color: #ff0000;">" + oError:Description+CRLF+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"</span> SubSystem &nbsp; &nbsp;: <span style="color: #ff0000;">" + oError:SubSystem+CRLF+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"</span> Error Number : <span style="color: #ff0000;">" + Str( oError:SubCode )+CRLF+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"</span> Severity &nbsp; &nbsp; : <span style="color: #ff0000;">" + Str( oError:Severity )+CRLF<br /><br />&nbsp; &nbsp; mSginfo( cErr )<br /><br />RETURN NIL<br /><br />//-----------------------------------------------//<br /><br /></span></div>[/code:9bhjso88] Slds
Consulta sobre TDolphin
Para aclarar la las funciones para subir archivos a la base es sube_archivo() para descargarlos uso la funcion savetotmp() Para ver todos los archivos en la tabla uso la funcion databrowse() Aqui esta el ejempo con todo lo necesario, en el anterior hay funciones par subir y bajar los archivos via ftp al servidor por una dificultad que se me presento con la funcion D_ReadFile() al final lo solucione usando memoread() [code=fw:37z3j2my]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"recursos.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbcompat.ch"</span><br /><br />#ifndef __XHARBOUR__<br /><span style="color: #00D7D7;">#define</span> CurDrive &nbsp;hb_curdrive<br />#endif<br /><br /><br /><span style="color: #00C800;">FUNCTION</span> Menu_Anexo<span style="color: #000000;">&#40;</span> cDoc <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oWnd3<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oMenu<br /><br />&nbsp; &nbsp;cDocu := cDoc<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2007</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Cargar Archivo"</span> <span style="color: #0000ff;">ACTION</span> LoadFile<span style="color: #000000;">&#40;</span> cDoc <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Listar Archivos"</span> <span style="color: #0000ff;">ACTION</span> DataBrowse<span style="color: #000000;">&#40;</span> cDoc <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">RETURN</span> oMenu<br /><br /><span style="color: #B900B9;">//--------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> LoadFile<span style="color: #000000;">&#40;</span> cDocu <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> oDlg, aGet1, aGet2, cDescrip:= space<span style="color: #000000;">&#40;</span><span style="color: #000000;">80</span><span style="color: #000000;">&#41;</span>, cFile:=space<span style="color: #000000;">&#40;</span><span style="color: #000000;">120</span><span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">/* LOCAL cFile := cGetFile( "Imagen Bitmap (*.bmp)| *.bmp|" + &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Imagen JPEG &nbsp; (*.jpg)| *.jpg|" + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Imagen GIF &nbsp; &nbsp;(*.gif)| *.gif|" &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Word &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(*.doc*)| *.doc*|" + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Excel &nbsp; &nbsp; &nbsp; &nbsp; (*.xls*)| *.xls*|" + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"PowerPoint &nbsp; &nbsp;(*.ppt*)| *.ppt*|" + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Adobe PDF &nbsp; &nbsp; (*.pdf)| *.pdf|" + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Archivo Texto (*.txt)| *.txt|" + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Todos &nbsp; &nbsp; &nbsp; &nbsp; (*.*)| *.*" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ,"Seleccione un Archivo", 4 )<br /><br />&nbsp; */</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"BUSCAFILE"</span> <span style="color: #0000ff;">FONT</span> oFontb <span style="color: #B900B9;">// TRANSPARENT</span><br /><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> aGet1 <span style="color: #0000ff;">VAR</span> cDescrip <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@X"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> aGet2 <span style="color: #0000ff;">VAR</span> cFile <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@X"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> &nbsp;READONLY<br /><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBot1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">301</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"FOLDER_ADD_16"</span> TOOLTIP <span style="color: #ff0000;">"Buscar Archivo"</span> <span style="color: #0000ff;">OF</span> oDlg &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cFile := cGetFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Imagen Bitmap (*.bmp)| *.bmp|"</span> + &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Imagen JPEG &nbsp; (*.jpg)| *.jpg|"</span> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Imagen GIF &nbsp; &nbsp;(*.gif)| *.gif|"</span> &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Word &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(*.doc*)| *.doc*|"</span> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Excel &nbsp; &nbsp; &nbsp; &nbsp; (*.xls*)| *.xls*|"</span> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"PowerPoint &nbsp; &nbsp;(*.ppt*)| *.ppt*|"</span> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Adobe PDF &nbsp; &nbsp; (*.pdf)| *.pdf|"</span> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Archivo Texto (*.txt)| *.txt|"</span> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Todos &nbsp; &nbsp; &nbsp; &nbsp; (*.*)| *.*"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ,<span style="color: #ff0000;">"Seleccione un Archivo"</span>, <span style="color: #000000;">9</span> <span style="color: #000000;">&#41;</span> , ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iif<span style="color: #000000;">&#40;</span>empty<span style="color: #000000;">&#40;</span> cDescrip <span style="color: #000000;">&#41;</span>, cDescrip := padr<span style="color: #000000;">&#40;</span>GetOnlyName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">80</span><span style="color: #000000;">&#41;</span> ,<span style="color: #000000;">&#41;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aGet1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aGet2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> , oBot2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBot2 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">1</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span> msgrun<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Subiendo el Archivo a la base de datos ......"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"Por favor espere"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span>|| Sube_archivo<span style="color: #000000;">&#40;</span> cDocu, cFile, cDescrip <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">WHEN</span> ! empty<span style="color: #000000;">&#40;</span> cDescrip <span style="color: #000000;">&#41;</span> .and. file<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br /><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBot3 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">2</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">Action</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><br /><span style="color: #00C800;">Return</span><br /><br /><span style="color: #B900B9;">//--------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> Sube_archivo<span style="color: #000000;">&#40;</span> cDocu, cFile , cDescrip <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> uData<br /><span style="color: #00C800;">LOCAL</span> oDlg<br /><br /><span style="color: #00C800;">TRY</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ! Empty<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; ??? <span style="color: #ff0000;">"Leyendo Archivo"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// uData := D_ReadFile( cFile )</span><br /><br />&nbsp; &nbsp; &nbsp; uData &nbsp;:= memoread<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; ??? <span style="color: #ff0000;">"Archivo leido"</span><br /><br />&nbsp; &nbsp; &nbsp; nTamb := len<span style="color: #000000;">&#40;</span> udata <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nTamk := int<span style="color: #000000;">&#40;</span> nTamb / <span style="color: #000000;">1024</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nTam := nTamb / <span style="color: #000000;">&#40;</span> <span style="color: #000000;">1024</span> * <span style="color: #000000;">1024</span> <span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nTam > nMaxFSize <span style="color: #B900B9;">//2</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"No puede subir el archivo que intenta anexar, tiene "</span>+alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> nTam,<span style="color: #000000;">6</span>,<span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">"MB, "</span>+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"El limite maximo por archivo es "</span>+alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> nMaxFSize,<span style="color: #000000;">6</span>,<span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" MB"</span>+CRLF+CRLF+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"Si necesita subir un archivo mas grande dividalo en varios archivos"</span>,<span style="color: #ff0000;">"Atencion"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ??? &nbsp;<span style="color: #ff0000;">"Identificando tamaños"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> nTamb > <span style="color: #000000;">&#40;</span> <span style="color: #000000;">1024</span> * <span style="color: #000000;">1024</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cTam := alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> nTam, <span style="color: #000000;">6</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">" MBytes"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;elseif nTamb > <span style="color: #000000;">1024</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cTam := alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> nTamk, <span style="color: #000000;">6</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">" KBytes"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cTam := alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> nTamk, <span style="color: #000000;">6</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">" Bytes"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ! oServer:<span style="color: #000000;">Insert</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"files"</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"numdoc"</span>, <span style="color: #ff0000;">"filename"</span>,<span style="color: #ff0000;">"file"</span>, <span style="color: #ff0000;">"tam"</span>,<span style="color: #ff0000;">"descripcion"</span>,<span style="color: #ff0000;">"fecha"</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> cDocu, GetOnlyName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span>, uData, cTam, cDescrip, date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; <br />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No se pudo subir el archivo a la Base de Datos"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span>&nbsp; &nbsp; <br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />CATCH oErr<br /><br />&nbsp; &nbsp; &nbsp;ShowError<span style="color: #000000;">&#40;</span> oErr <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br />END<br /><br /><span style="color: #00C800;">RETURN</span><br /><br /><span style="color: #B900B9;">//-------------------------------------------//</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">FUNCTION</span> GetOnlyName<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nRat<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ! Empty<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nRat = RAt<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"<span style="color: #000000;">\"</span>, cFile )<br />&nbsp; &nbsp; &nbsp; cFile = SubStr( cFile, nRat + 1 )<br />&nbsp; &nbsp;ENDIF<br /><br />RETURN cFile<br /><br />//--------------------------------------------//<br /><br />Function DataBrowse( cDocu )<br /><br />&nbsp; &nbsp;LOCAL oQry<br />&nbsp; &nbsp;LOCAL oDlg<br />&nbsp; &nbsp;LOCAL oBrw<br /><br /><br />&nbsp; &nbsp;oQry = oServer:Query( "</span><span style="color: #0000ff;">SELECT</span> <span style="color: #0000ff;">id</span>, descripcion, filename,tam,fecha <span style="color: #0000ff;">FROM</span> files <span style="color: #0000ff;">where</span> numdoc = <span style="color: #ff0000;">'"+cDocu+"'</span> <span style="color: #0000ff;">order by</span> <span style="color: #0000ff;">ID</span> <span style="color: #0000ff;">desc</span><span style="color: #ff0000;">" )<br /><br /><br />&nbsp; &nbsp;DEFINE DIALOG oDlg TITLE "</span>Historial Anexos<span style="color: #ff0000;">" SIZE 850, 400 FONT oFontb// TRANSPARENT<br /><br />&nbsp; &nbsp;@ 0, 0 XBROWSE oBrw OF oDLg FIELDS oQry:id, oQry:fecha,oQry:descripcion, AllTrim( oQry:filename ), oQry:tam ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HEADERS "</span><span style="color: #0000ff;">ID</span><span style="color: #ff0000;">","</span>Fecha<span style="color: #ff0000;">","</span>Descripcion<span style="color: #ff0000;">","</span>Archivo<span style="color: #ff0000;">","</span>Tamaño<span style="color: #ff0000;">";<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLSIZES 50,80,290,290,80 ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JUSTIFY .F.,.F.,.F., .F.,AL_RIGHT ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LINES ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ON DBLCLICK SaveToTMP( oQry:Id, oQry )<br /><br /><br />&nbsp; &nbsp;oBrw:SetDolphin( oQry, .f., .f. )<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;oBrw:bPopUp &nbsp; &nbsp; &nbsp; &nbsp;:= { |o| ColMenu( o, oQry , oBrw ) }<br />&nbsp; &nbsp;oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW //MARQSTYLE_HIGHLWIN7<br />&nbsp; &nbsp;oBrw:bKeyDown &nbsp; &nbsp; &nbsp;:= {|nKey| iif(nKey==13, SaveToTMP( oQry:Id, oQry ),) }<br />&nbsp; &nbsp;oBrw:CreateFromCode()<br /><br />&nbsp; &nbsp;oDlg:oClient = oBrw<br /><br />&nbsp; &nbsp;ACTIVATE DIALOG oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ON INIT ( oDlg:Resize() ) ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CENTERED<br /><br />&nbsp; &nbsp;oQry:End()<br /><br />RETURN<br /><br />//------------------------------------------------//<br /><br />static function ColMenu( oCol, oQry, oBrw )<br /><br />&nbsp; &nbsp;local oPop<br /><br />&nbsp; &nbsp;MENU oPop POPUP 2007<br />&nbsp; &nbsp; &nbsp; MENUITEM "</span>Guardar en carpeta<span style="color: #ff0000;">" ACTION SaveToDisk( oCol:oBrw:aCols[ 1 ]:Value, oQry )<br />&nbsp; &nbsp; &nbsp; MENUITEM "</span>Eliminar registro<span style="color: #ff0000;">" &nbsp;ACTION iif( msgnoyes("</span>Quiere eliminar este registro<span style="color: #ff0000;">","</span>Precaucion<span style="color: #ff0000;">"), ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( oQry:Delete(), oQry:Refresh(), oBrw:Refresh() ) ,)<br /><br />&nbsp; &nbsp;ENDMENU<br /><br />return oPop<br /><br />//------------------------------------------------//<br /><br />Static Function SaveToTMP( uValue, oQry )<br /><br />&nbsp; &nbsp;LOCAL nHandle, hWnd:=GetActiveWindow()<br />&nbsp; &nbsp;LOCAL cDir := GetEnv("</span>TEMP<span style="color: #ff0000;">")<br /><br />&nbsp; &nbsp;LOCAL oQryFind<br /><br />&nbsp; &nbsp;oQry:Seek( uValue, "</span><span style="color: #0000ff;">id</span><span style="color: #ff0000;">", , , , .F. )<br /><br />&nbsp; &nbsp;cursorwait()<br /><br />&nbsp; &nbsp;oQryFind = TDolphinQry():New( "</span><span style="color: #0000ff;">select</span> file <span style="color: #0000ff;">from</span> files <span style="color: #0000ff;">where</span> <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">" + ClipValue2Sql( uValue ), oQry:oServer )<br /><br />&nbsp; &nbsp; cFilename := AllTrim( oQry:filename )<br /><br />//&nbsp; if ! cFileExt( cFilename ) $ "</span>JPG,JIF,GIF,BMP,DIB,RLE,TGA,PCX<span style="color: #ff0000;">"<br /><br />&nbsp; &nbsp; &nbsp;nHandle := FCreate( cDir + "</span>\<span style="color: #ff0000;">" + cFilename )<br /><br />&nbsp; &nbsp; &nbsp;IF FError() # 0<br /><br />&nbsp; &nbsp; &nbsp; // &nbsp; MsgInfo( "</span>Error grabando Archivo <span style="color: #ff0000;">" + cDir + "</span>\<span style="color: #ff0000;">" + AllTrim( oQry:filename ) )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RETURN<br /><br />&nbsp; &nbsp; &nbsp;ENDIF<br /><br />&nbsp; &nbsp; &nbsp;FWrite( nHandle, oQryFind:file, Len( oQryFind:file ) )<br />&nbsp; &nbsp; &nbsp;FClose( nHandle )<br /><br />// &nbsp; ENDIF<br /><br />&nbsp; &nbsp; cursorarrow()<br /><br />&nbsp; &nbsp; cImage := oQryFind:file<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;oQryFind:End()<br /><br />&nbsp; &nbsp; open_archivo( cDir, cFilename, cImage )<br /><br />RETURN<br /><br />//-----------------------------------------//<br /><br />Function open_archivo( cDir, cFilename, cImage )<br />hWnd:=GetActiveWindow()<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; do case<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; // &nbsp;case cFileExt( cFilename ) == "</span>PDF<span style="color: #ff0000;">"<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; &nbsp; Main_Pdf( cDir+"</span>\<span style="color: #ff0000;">"+cFilename )<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &nbsp;cFileExt( cFilename ) $ "</span>XLSX,DOCX,PPTX<span style="color: #ff0000;">"<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp; ShellExecute(hWnd,"</span>open<span style="color: #ff0000;">","</span>excel.exe<span style="color: #ff0000;">",'"</span><span style="color: #ff0000;">'+cDir+"<span style="color: #000000;">\"</span>+cFilename+'</span><span style="color: #ff0000;">"',,1)<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShellExecute(,"</span>Open<span style="color: #ff0000;">",'"</span><span style="color: #ff0000;">'+cDir+"<span style="color: #000000;">\"</span>+cFilename+'</span><span style="color: #ff0000;">"',,,3)<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case cFileExt( cFilename ) $ "</span>JPG,JIF,GIF,BMP,DIB,RLE,TGA,PCX,PDF<span style="color: #ff0000;">"<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp;VerImagen( cDir, cFilename, cImage )<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShellExecute(,"</span>Open<span style="color: #ff0000;">",'"</span><span style="color: #ff0000;">'+cDir+"<span style="color: #000000;">\"</span>+cFilename+'</span><span style="color: #ff0000;">"',,,3)<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;otherwise<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShellExecute(,"</span>Open<span style="color: #ff0000;">",'"</span><span style="color: #ff0000;">'+cDir+"<span style="color: #000000;">\"</span>+cFilename+'</span><span style="color: #ff0000;">"',,,3)<br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; endcase<br />&nbsp; &nbsp; &nbsp; &nbsp; <br /><br />Return<br /><br />//-----------------------------------------//<br /><br />function Main_pdf(cFile)<br /><br />&nbsp; &nbsp;local oWnd, oActiveX<br /><br />&nbsp; &nbsp;DEFINE WINDOW oWnd TITLE "</span>Controles Visor PDF<span style="color: #ff0000;">" //TRANSPARENT<br /><br />&nbsp; &nbsp;oActiveX = TActiveX():New( oWnd, "</span>AcroPDF.PDF<span style="color: #000000;">.1</span><span style="color: #ff0000;">" ) // Use "</span>AcroPDF.PDF<span style="color: #000000;">.1</span><span style="color: #ff0000;">" for Acrobat Reader 7<br /><br />&nbsp; &nbsp;oWnd:oClient = oActiveX // To fill the entire window surface<br /><br />&nbsp; &nbsp;oActiveX&#058;Do( "</span>LoadFile<span style="color: #ff0000;">", cFile &nbsp;)<br />&nbsp; &nbsp;oActiveX&#058;Do( "</span>SetCurrentPage<span style="color: #ff0000;">", 1 )<br /><br />&nbsp; &nbsp;ACTIVATE WINDOW oWnd<br /><br />return nil<br /><br /><br />//-----------------------------------------//<br /><br />Static FUNCTION ShowError( oError )<br /><br />&nbsp; cErr:= "</span> Error: <span style="color: #000000;">No</span> se pudo Subir el Archivo !!<span style="color: #ff0000;">"+CRLF+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"</span> Descripción &nbsp;: <span style="color: #ff0000;">" + oError:Description+CRLF+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"</span> SubSystem &nbsp; &nbsp;: <span style="color: #ff0000;">" + oError:SubSystem+CRLF+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"</span> Error Number : <span style="color: #ff0000;">" + Str( oError:SubCode )+CRLF+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"</span> Severity &nbsp; &nbsp; : <span style="color: #ff0000;">" + Str( oError:Severity )+CRLF<br /><br />&nbsp; &nbsp; mSginfo( cErr )<br /><br />RETURN NIL<br /><br />//-----------------------------------------------//<br /><br /></span></div>[/code:37z3j2my] Slds
Consulta sobre TDolphin
Hola Nicanor, muchas gracias por tu explicación y por el código, ya me estoy poniendo a verlo y analizarlo. Creo encontrarle una buena aplicación al mismo. Te cuento que estoy iniciandome con Dolphin y todo me es nuevo. Un abrazo a la distancia. Marcelo
Consulta sobre TDolphin
Creo que en el codigo falta esto. Slds [code=fw:1twnza7a]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #B900B9;">//------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ColMenu<span style="color: #000000;">&#40;</span> oCol, oQry, oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oPop<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2007</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Guardar en carpeta"</span> <span style="color: #0000ff;">ACTION</span> SaveToDisk<span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span>, oQry <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Eliminar registro"</span> &nbsp;<span style="color: #0000ff;">ACTION</span> iif<span style="color: #000000;">&#40;</span> msgnoyes<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Quiere eliminar este registro"</span>,<span style="color: #ff0000;">"Precaucion"</span><span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> oQry:<span style="color: #000000;">Delete</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oQry:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ,<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">return</span> oPop<br /><br /><span style="color: #B900B9;">//------------------------------------------------//</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">Function</span> SaveToDisk<span style="color: #000000;">&#40;</span> uValue, oQry <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nHandle<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cDir := cGetDir<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Seleccione una Carpeta"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CurDrive<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">":<span style="color: #000000;">\"</span> + GetCurDir() + "</span>\<span style="color: #ff0000;">" )<br />&nbsp; &nbsp;LOCAL oQryFind<br /><br />&nbsp; &nbsp;IF ! Empty( cDir )<br /><br />&nbsp; &nbsp; &nbsp; oQry:Seek( uValue, "</span><span style="color: #0000ff;">id</span><span style="color: #ff0000;">", , , , .F. )<br /><br /> &nbsp; &nbsp; &nbsp;cursorwait()<br /><br />&nbsp; &nbsp; &nbsp; oQryFind = TDolphinQry():New( "</span><span style="color: #0000ff;">select</span> file <span style="color: #0000ff;">from</span> files <span style="color: #0000ff;">where</span> <span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">" + ClipValue2Sql( uValue ), oQry:oServer )<br /><br />&nbsp; &nbsp; &nbsp; nHandle := FCreate( cDir + "</span>\<span style="color: #ff0000;">" + AllTrim( oQry:filename ) )<br /><br />&nbsp; &nbsp; &nbsp; IF FError() # 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MsgInfo( "</span>Error grabando Archivo <span style="color: #ff0000;">" + cDir + "</span>\<span style="color: #ff0000;">" + AllTrim( oQry:filename ) )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RETURN<br />&nbsp; &nbsp; &nbsp; ENDIF<br /><br />&nbsp; &nbsp; &nbsp; FWrite( nHandle, oQryFind:file, Len( oQryFind:file ) )<br />&nbsp; &nbsp; &nbsp; FClose( nHandle )<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; cursorarrow()<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; cFilename := alltrim(oQry:filename)<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; MsgInfo( "</span>Archivo Guardado en la Carpeta: <span style="color: #ff0000;">" + cDir )<br /><br />&nbsp; &nbsp; &nbsp; oQryFind:End()<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; if Msgyesno("</span>Desea Abrir el Archivo ?<span style="color: #ff0000;">")<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; open_archivo( cDir, cFilename )<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; endif<br /><br />&nbsp; &nbsp;ENDIF<br /><br />RETURN<br /><br />//------------------------------------------------//<br /><br /><br /></span></div>[/code:1twnza7a]
Consulta sobre TDolphin
Hola buenas tardes, tengo una consulta, estoy queriendo crear las tablas desde código usando el ejemplo bldtbls.prg de la carpeta samples. El tema es que se me cuelga la app. Es una tabla de clientes, relacionada a la tabla de localidades y esta ultima a la tabla de provincias. La pregunta es si esta bien o hay algo que yo no vea que este haciendo mal. Desde ya gracias Saludos desde Argentina. [code=fw:18ev2kde]<div class="fw" id="{CB}" style="font-family: monospace;"><br />PROCEDURE CreaBD<span style="color: #000000;">&#40;</span>oServer<span style="color: #000000;">&#41;</span><br />          <span style="color: #00C800;">LOCAL</span> cQuery<br />          <span style="color: #00C800;">LOCAL</span> aQuery    := Array<span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span><br />          *-----------------------------------------------------------------<br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = <span style="color: #ff0000;">"DROP TABLE IF EXISTS provincia"</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> = <span style="color: #ff0000;">"DROP TABLE IF EXISTS localidad"</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> = <span style="color: #ff0000;">"DROP TABLE IF EXISTS clientes"</span><br />          *-----------------------------------------------------------------<br />          <span style="color: #B900B9;">//provincia</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> =  <span style="color: #ff0000;">"CREATE TABLE provincia("</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"pcia_id INT NOT NULL AUTO_INCREMENT, "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"nombre VARCHAR(50)  NOT NULL, "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"PRIMARY KEY (pcia_id)) ENGINE = InnoDB"</span><br />          *-----------------------------------------------------------------<br />          <span style="color: #B900B9;">//localidad</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> = <span style="color: #ff0000;">"CREATE TABLE localidad("</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"loc_id INT NOT NULL AUTO_INCREMENT, "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"nombre VARCHAR(50)  NOT NULL, "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"codigo_postal VARCHAR(4), "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"pcia_id INT, "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"PRIMARY KEY (loc_id) INDEX (pcia_id),"</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"FOREIGN KEY (pcia_id) REFERENCES provincia (pcia_id), "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"ON DELETE NO ACTION, "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"ON UPDATE CASCADE) ENGINE = InnoDB"</span><br />          *-----------------------------------------------------------------<br />          <span style="color: #B900B9;">//clientes</span><br />          cQuery = <span style="color: #ff0000;">"CREATE TABLE clientes("</span><br />          cQuery += <span style="color: #ff0000;">"id INT NOT NULL AUTO_INCREMENT, "</span><br />          cQuery += <span style="color: #ff0000;">"nombre VARCHAR(100)  NOT NULL, "</span><br />          cQuery += <span style="color: #ff0000;">"direccion VARCHAR(50), "</span><br />          cQuery += <span style="color: #ff0000;">"loc_id INT, "</span><br />          cQuery += <span style="color: #ff0000;">"saldo DECIMAL(15), "</span><br />          cQuery += <span style="color: #ff0000;">"PRIMARY KEY (id) INDEX (loc_id), "</span><br />          cQuery += <span style="color: #ff0000;">"FOREIGN KEY (loc_id) REFERENCES localidad (loc_id), "</span><br />          cQuery += <span style="color: #ff0000;">"ON DELETE NO ACTION, "</span><br />          cQuery += <span style="color: #ff0000;">"ON UPDATE CASCADE) ENGINE = InnoDB"</span><br />          *-----------------------------------------------------------------<br />          <span style="color: #B900B9;">//we dont need transaction here</span><br />          oServer:<span style="color: #000000;">MultiQuery</span><span style="color: #000000;">&#40;</span> aQuery, .F., <span style="color: #000000;">&#123;</span>| nIdx | Qout<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Query "</span> + StrZero<span style="color: #000000;">&#40;</span> nIdx, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" OK"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />          oServer:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> cQuery <span style="color: #000000;">&#41;</span><br />          *-----------------------------------------------------------------<br /><span style="color: #00C800;">RETURN</span><br /> </div>[/code:18ev2kde]
Consulta sobre TDolphin
Hola sabes cual es el ultimo query que logra ejecutar antes de la ruptura?
Consulta sobre TDolphin
Hola Daniel, el ultimo query es el 4 ese si se ejecutaba, el quinto no lo hacia porque habia un error en la linea donde creo la relacion, habia de mas unas comas (gracias Mauricio de Maussion) quien vio tal detalle. Gracias Daniel, y sigo avanzando de a poquito. Pego el codigo nuevamente por si a alguien le pasa lo mismo. Saludos Marcelo [code=fw:ol9g047d]<div class="fw" id="{CB}" style="font-family: monospace;"><br />PROCEDURE CreaBD<span style="color: #000000;">&#40;</span>oServer<span style="color: #000000;">&#41;</span><br />          <span style="color: #00C800;">LOCAL</span> cQuery<br />          <span style="color: #00C800;">LOCAL</span> aQuery := Array<span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span><br />          *-----------------------------------------------------------------<br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"DROP TABLE IF EXISTS provincia"</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"DROP TABLE IF EXISTS localidad"</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"DROP TABLE IF EXISTS clientes"</span><br />          *-----------------------------------------------------------------<br />          <span style="color: #B900B9;">//provincia</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"CREATE TABLE provincia("</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"pcia_id INT UNSIGNED NOT NULL AUTO_INCREMENT, "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"nombre VARCHAR(50) NOT NULL, "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"PRIMARY KEY (pcia_id)) ENGINE = InnoDB"</span><br />          *-----------------------------------------------------------------<br />          <span style="color: #B900B9;">//localidad</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"CREATE TABLE localidad("</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"loc_id INT UNSIGNED NOT NULL AUTO_INCREMENT, "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"nombre VARCHAR(50) NOT NULL, "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"cod_pos VARCHAR(4), "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"pcia_id INT UNSIGNED, "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"PRIMARY KEY (loc_id), INDEX (pcia_id),"</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"FOREIGN KEY (pcia_id) REFERENCES provincia (pcia_id) "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"ON DELETE NO ACTION "</span><br />          aQuery<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">"ON UPDATE CASCADE) ENGINE = InnoDB"</span><br />          *-----------------------------------------------------------------<br />          <span style="color: #B900B9;">//clientes</span><br />          cQuery := <span style="color: #ff0000;">"CREATE TABLE clientes("</span><br />          cQuery += <span style="color: #ff0000;">"id INT UNSIGNED NOT NULL AUTO_INCREMENT, "</span><br />          cQuery += <span style="color: #ff0000;">"nombre VARCHAR(100) NOT NULL, "</span><br />          cQuery += <span style="color: #ff0000;">"direccion VARCHAR(50), "</span><br />          cQuery += <span style="color: #ff0000;">"loc_id INT UNSIGNED, "</span><br />          cQuery += <span style="color: #ff0000;">"saldo DECIMAL(15), "</span><br />          cQuery += <span style="color: #ff0000;">"PRIMARY KEY (id), INDEX (loc_id), "</span><br />          cQuery += <span style="color: #ff0000;">"FOREIGN KEY (loc_id) REFERENCES localidad (loc_id) "</span><br />          cQuery += <span style="color: #ff0000;">"ON DELETE NO ACTION "</span><br />          cQuery += <span style="color: #ff0000;">"ON UPDATE CASCADE) ENGINE = InnoDB"</span><br />          *-----------------------------------------------------------------<br />          <span style="color: #B900B9;">//we dont need transaction here</span><br />          oServer:<span style="color: #000000;">MultiQuery</span><span style="color: #000000;">&#40;</span> aQuery, .F., <span style="color: #000000;">&#123;</span>| nIdx | Qout<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Query "</span> + StrZero<span style="color: #000000;">&#40;</span> nIdx, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" OK"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />          oServer:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> cQuery <span style="color: #000000;">&#41;</span><br />          *-----------------------------------------------------------------<br /><span style="color: #00C800;">RETURN</span><br /> </div>[/code:ol9g047d]
Consulta sobre TDolphin
Hola de nuevo por aca queriendo consultarles como se hace una busqueda en un browse segun la palabra ingresada en un get y que esa palabra este en cualquier parte del campo, osea, si en una lista de clientes tengo uno que se llama JUAN CARLOS LOPEZ, que al ingresar la palabra LOPEZ me lo filtre igual mas alla de que la palabra en el browse empieza por el nombre. Esto actualmente lo hago con SET FILTER en dbf Saludos a todos y espero que hallan pasado unas Felices Pascuas Marcelo
Consulta sobre TDolphin
Hola, prueba asi: [code=fw:1ha8k0d1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cBusca .......<br /><br />cBusca := ALLTRIM<span style="color: #000000;">&#40;</span>cBusca<span style="color: #000000;">&#41;</span><br /><br />cQry := <span style="color: #ff0000;">"SELECT clientes.nombres FROM clientes WHERE clientes.nombres LIKE '%"</span> + cBusca + <span style="color: #ff0000;">"%' ORDER BY clientes.nombres"</span><br />oDatos := oServer:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> cQry <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">&#40;</span>oDatos, <span style="color: #ff0000;">"Criterio de busqueda = "</span> + cBusca <span style="color: #000000;">&#41;</span><br /><br />&nbsp;</div>[/code:1ha8k0d1]
Consulta sobre TDolphin
Hola Willi, entendi lo que sugeriste pero en mi consulta me da error esas lineas, [code=fw:19la2si2]<div class="fw" id="{CB}" style="font-family: monospace;">         cQry := <span style="color: #ff0000;">"SELECT localidad.id_localidad,localidad.nombre AS nomLoc,localidad.Codigo_Postal,provincia.nombre AS nomPro,provincia.id_provincia "</span><br />         cQry += <span style="color: #ff0000;">"FROM localidad, provincia "</span><br />         cQry += <span style="color: #ff0000;">"WHERE nomLoc LIKE '%"</span> + cBusca + <span style="color: #ff0000;">"%' "</span><br />         cQry += <span style="color: #ff0000;">"AND localidad.id_provincia=provincia.id_provincia "</span><br />         cQry += <span style="color: #ff0000;">"ORDER BY nomLoc"</span><br /> </div>[/code:19la2si2] Ten en cuenta willi que recien estoy comenzando con mysql y si cometo un error grotezco pido mis disculpas Saludos Marcelo
Consulta sobre TDolphin
Hola, prueba asi; [code=fw:qkkcm06j]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cQry := <span style="color: #ff0000;">"SELECT localidad.id_localidad, localidad.nombre AS nomLoc, localidad.Codigo_Postal, provincia.nombre AS nomPro, provincia.id_provincia "</span><br />cQry += <span style="color: #ff0000;">"FROM localidad, provincia "</span><br />cQry += <span style="color: #ff0000;">"WHERE localidad.nombre LIKE '%"</span> + cBusca + <span style="color: #ff0000;">"%' "</span><br />cQry += <span style="color: #ff0000;">"AND localidad.id_provincia = provincia.id_provincia "</span><br />cQry += <span style="color: #ff0000;">"ORDER BY localidad.nombre"</span><br />&nbsp;</div>[/code:qkkcm06j]
Consulta sobre TDolphin
Hola Willi, bueno paso el ejemplo de provincia que es mas pequeño y basico el codigo por solo tener dos campos, el id_provincia y el nombre. [code=fw:1fj95hx3]<div class="fw" id="{CB}" style="font-family: monospace;"><br />PROCEDURE brwProvincias<span style="color: #000000;">&#40;</span>oServer,oWnd<span style="color: #000000;">&#41;</span><br />...<br />          cQry := <span style="color: #ff0000;">"SELECT * FROM provincia ORDER BY nombre"</span><br />          <span style="color: #0000ff;">DEFINE</span> QUERY oQry cQry<br /><br />          <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oSearch <span style="color: #0000ff;">VAR</span> cSearch <span style="color: #0000ff;">ID</span> <span style="color: #000000;">4002</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> ofntGet <span style="color: #0000ff;">UPDATE</span>;<br />                        <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">Self</span>:<span style="color: #000000;">Assign</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />                                    BuscamosP<span style="color: #000000;">&#40;</span>cSearch,@cQry,oQry,oServer,oBrw<span style="color: #000000;">&#41;</span>,;<br />                                    oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />...<br /><span style="color: #00C800;">RETURN</span><br />****************************************************************************<br /><span style="color: #00C800;">FUNCTION</span> BuscamosP<span style="color: #000000;">&#40;</span>cSearch,cQry,oQry,oServer,oBrw<span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">LOCAL</span> cBusca := ALLTRIM<span style="color: #000000;">&#40;</span>cSearch<span style="color: #000000;">&#41;</span><br />         cQry := <span style="color: #ff0000;">"SELECT * "</span><br />         cQry += <span style="color: #ff0000;">"FROM provincia "</span><br />         cQry += <span style="color: #ff0000;">"WHERE provincia.nombre LIKE '%"</span> + cBusca + <span style="color: #ff0000;">"%' "</span><br />         cQry += <span style="color: #ff0000;">"ORDER BY nombre"</span><br /><br />         oQry := oServer:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> cQry <span style="color: #000000;">&#41;</span><br />         oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />****************************************************************************<br /> </div>[/code:1fj95hx3] Este es el error: Error MYSQL/2014 Commands out of sync; you can't run this command now Un abrazo Marcelo
Consulta sobre TDolphin
Estimados: Estoy usando la clase Tdolphin, y cuando utilizo la función GetBlankRow() o GetRow() en un dialogo y estoy editando con gets, si muevo el dialogo los gets se actualizan con los datos guardados en la base de dato y pierden el dato que estaba editando. A alguien le pasó? Gracias por vuestra ayuda. Pongo el código para mayor información [code=fw:2ao7aj0l]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"tdolphin.ch"</span><br />*************************************************<br />** ABM DE Encuesta<br />*************************************************<br /><br />PROCEDURE Encuesta<span style="color: #000000;">&#40;</span> oServer<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> oDlg, oBrw, oGet, oWnd, cBuscar := SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">50</span><span style="color: #000000;">&#41;</span>, base, oBar, oQry<br />oQry  = oServer:<span style="color: #000000;">Query</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SELECT * FROM ENCUESTAS ORDER BY numero"</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #B900B9;">// Defino el dialogo tomado del recurso ABMCAJA</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MDICHILD</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"A/B/M de Encuestas"</span> ;<br />         <span style="color: #0000ff;">OF</span> MEMVAR->oWPpal NOZOOM <span style="color: #0000ff;">ICON</span> MEMVAR->oIco<br />         <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar  3D <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #000000;">2010</span><br />         <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"ALTA"</span> <span style="color: #0000ff;">OF</span> oBar ;<br />            TOOLTIP <span style="color: #ff0000;">"Agregar Registro"</span>  ;<br />            <span style="color: #0000ff;">ACTION</span> Formu<span style="color: #000000;">&#40;</span> oBrw , oQry, oWnd , .t., oServer<span style="color: #000000;">&#41;</span><br />         <span style="color: #B900B9;">// Este boton cierra la aplicacion</span><br />         <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"BAJA"</span> <span style="color: #0000ff;">OF</span> oBar;<br />            TOOLTIP <span style="color: #ff0000;">"Eliminar Registro"</span> ;<br />            <span style="color: #0000ff;">ACTION</span> Baja<span style="color: #000000;">&#40;</span> oBrw, oQry, oServer <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">WHEN</span><span style="color: #000000;">&#40;</span>oQry:<span style="color: #000000;">RecCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"MODI"</span> <span style="color: #0000ff;">OF</span> oBar ;<br />            TOOLTIP <span style="color: #ff0000;">"Modificar Registro"</span> ;<br />            <span style="color: #0000ff;">ACTION</span> Formu<span style="color: #000000;">&#40;</span> oBrw, oQry, oWnd, .f.,oServer<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">WHEN</span><span style="color: #000000;">&#40;</span>oQry:<span style="color: #000000;">RecCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"EXCE"</span> <span style="color: #0000ff;">OF</span> oBar ;<br />            TOOLTIP <span style="color: #ff0000;">"Exportar a Excel"</span> ;<br />            <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">ToExcel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">WHEN</span><span style="color: #000000;">&#40;</span>oQry:<span style="color: #000000;">RecCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"IMPR"</span> <span style="color: #0000ff;">OF</span> oBar ;<br />            TOOLTIP <span style="color: #ff0000;">"Reporte"</span> ;<br />            <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">Report</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">WHEN</span><span style="color: #000000;">&#40;</span>oQry:<span style="color: #000000;">RecCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #B900B9;">// Este boton cierra la aplicacion</span><br />         <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"SALE"</span> <span style="color: #0000ff;">OF</span> oBar;<br />            TOOLTIP <span style="color: #ff0000;">"Cerrar Ventana"</span> ;<br />            <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oWnd:<span style="color: #000000;">bGotFocus</span> := <span style="color: #000000;">&#123;</span> || oDlg:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#125;</span><br />   oWnd:<span style="color: #000000;">bResized</span> := <span style="color: #000000;">&#123;</span> || Incrusta<span style="color: #000000;">&#40;</span> oWnd, oDlg, .t.<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"ABMS"</span> <span style="color: #0000ff;">OF</span> oWnd<br />     <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw;<br />              FIELDS oQry:<span style="color: #000000;">numero</span> , oQry:<span style="color: #000000;">calle</span>, oQry:<span style="color: #000000;">npuerta</span>,;<br />              oQry:<span style="color: #000000;">piso</span>, oQry:<span style="color: #000000;">depto</span>, oQry:<span style="color: #000000;">motivo</span>, oQry:<span style="color: #000000;">fecha</span>;<br />              HEADERS <span style="color: #ff0000;">"Nro Enc."</span>, <span style="color: #ff0000;">"Calle"</span>, <span style="color: #ff0000;">"Puerta"</span>, <span style="color: #ff0000;">"Piso"</span>,;<br />              <span style="color: #ff0000;">"Depto"</span>, <span style="color: #ff0000;">"Cod.Motivo"</span>, <span style="color: #ff0000;">"Fecha"</span>;<br />              SIZES <span style="color: #000000;">90</span>, <span style="color: #000000;">80</span>, <span style="color: #000000;">80</span>, <span style="color: #000000;">70</span>,<span style="color: #000000;">70</span>,<span style="color: #000000;">70</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> <span style="color: #0000ff;">OF</span> oDlg<br />     *oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bDlbClick</span> := <span style="color: #000000;">&#123;</span>||  Modi<span style="color: #000000;">&#40;</span>oBrw, oQry, oWnd <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cBuscar <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"9999999999"</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">112</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />              <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> bus1<span style="color: #000000;">&#40;</span>oQry, oGet, oBrw, <span style="color: #ff0000;">"numero"</span><span style="color: #000000;">&#41;</span><br />     oQry:<span style="color: #000000;">bOnChangePage</span> := <span style="color: #000000;">&#123;</span>|| oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     SetDolphin<span style="color: #000000;">&#40;</span> oBrw, oQry, .f. <span style="color: #000000;">&#41;</span><br />     oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">KeyNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> % <span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, ;<br />                         <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">193</span>,<span style="color: #000000;">221</span>,<span style="color: #000000;">255</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />                         <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">221</span>,<span style="color: #000000;">245</span>,<span style="color: #000000;">255</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     oBrw:<span style="color: #000000;">nFreeze</span> := <span style="color: #000000;">6</span><br />     *oBrw:<span style="color: #000000;">GOTOP</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #B900B9;">// Activo el dialogo y al iniciar muevo a 0,0</span><br />     <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">NOWAIT</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> Incrusta<span style="color: #000000;">&#40;</span> oWnd, oDlg, .T.<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">VALID</span><span style="color: #000000;">&#40;</span>cerrar<span style="color: #000000;">&#40;</span>oQry<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span><br /><br />*************************************<br />** Agregar un registro nuevo<br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> Formu <span style="color: #000000;">&#40;</span> oBrw, base, oWnd, lAlta, oServer <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> oGet := ARRAY<span style="color: #000000;">&#40;</span><span style="color: #000000;">11</span><span style="color: #000000;">&#41;</span>, oBrw1, oBot := ARRAY<span style="color: #000000;">&#40;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#41;</span>, oDlg1, mrta := .f.,;<br />      aMotivo:= <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"1. Entrevista realizada"</span>,;<br />                 <span style="color: #ff0000;">"2. Todas las personas están temporalmente ausentes"</span>,;<br />                 <span style="color: #ff0000;">"3. La vivienda está en alquiler o venta"</span>,;<br />                 <span style="color: #ff0000;">"4. La vivienda está en construcción"</span>,;<br />                 <span style="color: #ff0000;">"5. La vivienda se usa como comercio/oficina/consult."</span>,;<br />                 <span style="color: #ff0000;">"6. La vivienda se usa para vacaciones o fin de semana"</span>,;<br />                 <span style="color: #ff0000;">"7. La vivienda está cerrada por motivos desconocidos"</span>,;<br />                 <span style="color: #ff0000;">"8. La vivienda está abandonada"</span>,;<br />                 <span style="color: #ff0000;">"9. Dirección inexistente"</span>,;<br />                 <span style="color: #ff0000;">"10. Rechaza la entrevista"</span><span style="color: #000000;">&#125;</span>,;<br />      aSexo:= <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Masculino"</span>, <span style="color: #ff0000;">"Femenino"</span><span style="color: #000000;">&#125;</span>, base1, oQry, nEncu := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">IF</span> lAlta<br />   base:<span style="color: #000000;">gobottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   nEncu := base:<span style="color: #000000;">numero</span> + <span style="color: #000000;">1</span><br />   base:<span style="color: #000000;">GetBlankRow</span><span style="color: #000000;">&#40;</span>.t.<span style="color: #000000;">&#41;</span>  <br />   base:<span style="color: #000000;">numero</span> := nEncu<br />   *base1:<span style="color: #000000;">GetBlankRow</span><span style="color: #000000;">&#40;</span>.f.<span style="color: #000000;">&#41;</span><br />   oQry := BuildQuery<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"*"</span><span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"personas"</span><span style="color: #000000;">&#125;</span> , <span style="color: #ff0000;">"personas.numero = "</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> base:<span style="color: #000000;">numero</span> <span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#41;</span><br />   *oQry := BuildQuery<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"*"</span><span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"personas"</span><span style="color: #000000;">&#125;</span> , <span style="color: #ff0000;">"personas.numero = "</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> base:<span style="color: #000000;">numero</span> <span style="color: #000000;">&#41;</span>   <span style="color: #000000;">&#41;</span><br />   base1  := oServer:<span style="color: #000000;">Query</span><span style="color: #000000;">&#40;</span> oQry<span style="color: #000000;">&#41;</span>   <br /><span style="color: #00C800;">ELSE</span><br />   base:<span style="color: #000000;">GetRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   nEncu := base:<span style="color: #000000;">numero</span><br />   oQry := BuildQuery<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"*"</span><span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"personas"</span><span style="color: #000000;">&#125;</span> , <span style="color: #ff0000;">"personas.numero = "</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> nEncu <span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#41;</span><br />   base1  := oServer:<span style="color: #000000;">Query</span><span style="color: #000000;">&#40;</span> oQry<span style="color: #000000;">&#41;</span><br />   *base1:<span style="color: #000000;">GetRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg1 <span style="color: #0000ff;">TITLE</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>lAlta,<span style="color: #ff0000;">"Alta"</span>,<span style="color: #ff0000;">"Modificacion"</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" de Encuestas"</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"ENCU"</span> ;<br />       <span style="color: #0000ff;">OF</span> oWnd<br />   oDlg1:<span style="color: #000000;">lHelpIcon</span> := .f.<br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> base:<span style="color: #000000;">numero</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"99999999"</span> <span style="color: #0000ff;">OF</span> oDlg1 ;<br />      <span style="color: #0000ff;">WHEN</span> <span style="color: #000000;">&#40;</span>lAlta .and. oBrw1:<span style="color: #000000;">nLen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> = <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">VALID</span><span style="color: #000000;">&#40;</span>base:<span style="color: #000000;">numero</span> ><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> base:<span style="color: #000000;">calle</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">112</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@!"</span> <span style="color: #0000ff;">OF</span> oDlg1 <br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> base:<span style="color: #000000;">npuerta</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">113</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"99999"</span> <span style="color: #0000ff;">OF</span> oDlg1<br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> base:<span style="color: #000000;">piso</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">114</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999"</span> <span style="color: #0000ff;">OF</span> oDlg1<br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> base:<span style="color: #000000;">depto</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">115</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@!"</span> <span style="color: #0000ff;">OF</span> oDlg1<br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> oGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> base:<span style="color: #000000;">motivo</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">116</span> <span style="color: #0000ff;">ITEMS</span> aMotivo <span style="color: #0000ff;">OF</span> oDlg1<br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> base:<span style="color: #000000;">fecha</span>  <span style="color: #0000ff;">ID</span> <span style="color: #000000;">117</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@D"</span> <span style="color: #0000ff;">OF</span> oDlg1<br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBot<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">118</span> <span style="color: #0000ff;">OF</span> oDlg1 <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>base:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,AgregaPer<span style="color: #000000;">&#40;</span>oBrw1, base1, .t., base:<span style="color: #000000;">numero</span>, oDlg1<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBot<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">119</span> <span style="color: #0000ff;">OF</span> oDlg1 <span style="color: #0000ff;">ACTION</span> AgregaPer<span style="color: #000000;">&#40;</span>oBrw1, base1, .f., base:<span style="color: #000000;">numero</span>, oDlg1<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">WHEN</span> oBrw1:<span style="color: #000000;">nLen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>><span style="color: #000000;">0</span><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBot<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">120</span> <span style="color: #0000ff;">OF</span> oDlg1 <span style="color: #0000ff;">ACTION</span> BorraPer<span style="color: #000000;">&#40;</span>oBrw1, base1<span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">WHEN</span> oBrw1:<span style="color: #000000;">nLen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>><span style="color: #000000;">0</span> <br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw1 FIELDS base1:<span style="color: #000000;">numfami</span>, base1:<span style="color: #000000;">apenom</span>, base1:<span style="color: #000000;">sexo</span>, base1:<span style="color: #000000;">edad</span>;<br />   HEADERS <span style="color: #ff0000;">"Persona Nº"</span>, <span style="color: #ff0000;">"Nombre"</span>, <span style="color: #ff0000;">"Sexo"</span>, <span style="color: #ff0000;">"Edad"</span> SIZES <span style="color: #000000;">60</span>, <span style="color: #000000;">300</span>, <span style="color: #000000;">80</span>, <span style="color: #000000;">60</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">123</span> <span style="color: #0000ff;">OF</span> oDlg1<br />     base1:<span style="color: #000000;">bOnChangePage</span> := <span style="color: #000000;">&#123;</span>|| oBrw1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     SetDolphin<span style="color: #000000;">&#40;</span> oBrw1, base1, .f. <span style="color: #000000;">&#41;</span><br />     oBrw1:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw1:<span style="color: #000000;">KeyNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> % <span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, ;<br />                         <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">193</span>,<span style="color: #000000;">221</span>,<span style="color: #000000;">255</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />                         <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">221</span>,<span style="color: #000000;">245</span>,<span style="color: #000000;">255</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>   <br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBot<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">125</span> <span style="color: #0000ff;">OF</span> oDlg1 <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>mrta:=.t., oDlg1:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBot<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">126</span> <span style="color: #0000ff;">OF</span> oDlg1 <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>mrta:=.f., oDlg1:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> CANCEL<br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg1 <span style="color: #0000ff;">CENTER</span> <span style="color: #B900B9;">//ON INIT oGet[1]:SetFocus()  </span><br /><span style="color: #00C800;">IF</span> !mrta .or. base:<span style="color: #000000;">numero</span> = <span style="color: #000000;">0</span><br />   base:<span style="color: #000000;">lAppend</span> := .f.<br />   base:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   base1:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">IF</span> lAlta .and. base:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span>base:<span style="color: #000000;">numero</span>,<span style="color: #ff0000;">"NUMERO"</span><span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />   MsgStop<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Registro duplicado"</span>,<span style="color: #ff0000;">"Error"</span><span style="color: #000000;">&#41;</span><br />   base:<span style="color: #000000;">lAppend</span> := .f.<br />   base:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /><span style="color: #00C800;">ENDIF</span><br />base:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />base:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />base1:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:2ao7aj0l]
Consulta sobre TDolphin
Hola revisa el ejemplo testfw1.prg dentro de la carpeta de samples de dolphin, ese ejemplo funciona bien por otra parte si quieres usar GetBlankRow( .T. ), enviado TRUE como parametro este devuelve un objeto TDolphinRow que hereda todas las propiedades del registro actual seleccionado y en vez de usar el objeto YDolphinQry inicial puedes usar el objeto TDolphinRow ejemplo [code=fw:o9fs6tev]<div class="fw" id="{CB}" style="font-family: monospace;">oRow = oQry:<span style="color: #000000;">GetBlankRow</span><span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br /><br />@ <span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> oRow:<span style="color: #000000;">nombre</span><br /><br />oRow:<span style="color: #000000;">Save</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:o9fs6tev] para reversar cambios puedes hacer [code=fw:o9fs6tev]<div class="fw" id="{CB}" style="font-family: monospace;">oRow:<span style="color: #000000;">undo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:o9fs6tev]
Consulta sobre TExcelScript (Vikthor)
Hace un buen tiempo que desarrolle un aplicativo clipper+fw usando esta clase. La pregunta es si hay alguna nueva version y de donde puedo bajarla. La que tengo es dice: Clase TExcelScript v1.10b 9-Oct-2002 y varias libs Ole2 que van desde el 2002 al 2004 gracias
Consulta sobre TExcelScript (Vikthor)
Gracias Oskar; aunque lo que está en dbWide es la version para xHarbour/Harbour
Consulta sobre TExcelScript (Vikthor)
Tengo una aplicacion clipper + fw en la que uso la Clase TExcelScript v1.10b 9-Oct-2002. Baje de dbWide la version 1.14 06-Feb-2004. No obstante por lo que observo ya no es compatible con clipper, o me equivoco?. (creo que la pregunta está contestada por si sola de acuerdo a que se incluye TRY-CATCH). No obstante pregunto si hay algo posterior a la versión v1.10b para clipper y de donde la consigo. En otro orden comento que al generar una lista de 5 columnas y, en mis pruebas con, entre 5 y 10 lineas, lo cual no es nada no?, tarda en una PC AMD Athlon XP1200+ un tiempo razonable, pero en una Celeron 266 es muy notorio lo que tarda. Si mal no recuerdo lei, no sé en cual foro, sobre una recomendación que hiciste (Vikthor) para que el proceso sea más agil. Te agradecería me lo refresques. Finalmente luego de crear un primer archivo, al realizar una segunda exortación, se despliega un mensaje de Excel advirtiendo sobre la existencia de tal archivo y si se desea reeemplazar; existe la forma de que no apareca? Muchas gracias por tu desinteresado aporte, que es muy que útil Saludos