topic
stringlengths
1
63
text
stringlengths
1
577k
Clipper/fivewin
hola tengo una version demo de Fivewin quisiera saber si puedo hacer un ejecutable con las librerias que tiene este demo o no es posible. Por favor requiero que me enseñen a hacerlo, tengo el compilador de clipper 5.2 y el blinker demo 5.1 y las librerias que trae la version demo de fivewin. El ejecutable se esta haciendo pero no ejecuta no se si este bien el bli.lnk o que me falta[color=darkred][/color
Clipper/fivewin
Con la versión demo puedes construir ejecutables perfectamente, sólo que saldrá una ventanita diciendo que es la versión demo. Necesitas una versión de Blinker superior ó igual a la 3.0. Tambien puedes usar el link.exe de Microsoft que es gratuito. Lo puedes decargar desde la página de descargas de <!-- w --><a class="postlink" href="http://www.fivetechsoft.com">www.fivetechsoft.com</a><!-- w --> En samples\build.bat puedes ver como usar Blinker ó link.exe
Clonar disco o imagen del S.O. instalado
Alguna utilidad [b:tldsfl92]buena bonita y gratis[/b:tldsfl92] para poder tener un disco clonado (o la imagen del S.O. instalada) para no tener que pasarme horas reinstalando el S.O. y asi poder (en unos minutos) volver a tener todo como al principio. Gracias.
Clonar disco o imagen del S.O. instalado
Puedes usar la Acronis TrueImage ...., Slds
Clonar disco o imagen del S.O. instalado
Muchas gracias. Parece "demasiado" para lo "poco" que yo quiero, solo clonar.
Clonar disco o imagen del S.O. instalado
[url:2gxpdaag]http&#58;//downloadsquad&#46;switched&#46;com/2008/09/05/5-free-apps-to-clone-your-hard-drive/[/url:2gxpdaag]
Clonar disco o imagen del S.O. instalado
Antonio, ¿ y cual me recomiendas ? Navegando, navegando, me he encontrado HDclone <!-- m --><a class="postlink" href="http://www.hdclone.com/">http://www.hdclone.com/</a><!-- m --> <!-- m --><a class="postlink" href="http://www.miray.de/products/sat.hdclone.html">http://www.miray.de/products/sat.hdclone.html</a><!-- m --> La versión FREE es bastante interesante. [img:1pghq64w]http&#58;//imag&#46;malavida&#46;com/mvimgbig/download/hdclone-911-1&#46;jpg[/img:1pghq64w]
Clonar disco o imagen del S.O. instalado
Jose María, yo te recomiendo HDD Raw Copy Tool [url:2nosjubx]http&#58;//hddguru&#46;com/software/HDD-Raw-Copy-Tool/[/url:2nosjubx] Como pides es gratuito. En esa página encontrarás más utilidades interesantes y gratuitas. Saludos, Félix
Clonar disco o imagen del S.O. instalado
Gracias... [quote="Baxajaun":11jb5lgl]yo te recomiendo HDD Raw Copy Tool [url:11jb5lgl]http&#58;//hddguru&#46;com/software/HDD-Raw-Copy-Tool/[/url:11jb5lgl][/quote:11jb5lgl] No encuentro lo que tiene HDclone, que es poder fabricar un disco botable (o pen usb) con el programa de clonar. Esta facilidad viene bien cuando no se tiene disco de arranque.
Clonar un objeto
Hola a todos ¿alguien sabría como clonar un objeto, hacer un duplicado del mismo? Un saludo
Clonar un objeto
Hola Paco, Prueba __objClone( o ) Saludos, José Luis Capel
Clonar un objeto
Supongo que no inicializa metodos ni nada por el estilo, vamos que no llama al constructor. Los codebloks ¿se duplican también? Saludos
Clonar un objeto
Paco, [code:y8ptpxt5]Function Main&#40;&#41; LOCAL u,v u &#58;= miClase&#40;&#41;&#58;c&#40;&#41; u&#58;s &#58;= "objeto u" v &#58;= __objClone&#40; u &#41; ? v&#58;s // "objecto u" ? v&#58;b&#40;&#41; // 1 RETURN NIL CLASS miClase DATA s DATA t METHOD a&#40;&#41; METHOD B INLINE a&#40;&#41; // esto crea un codeblock METHOD c&#40;&#41; ENDCLASS METHOD c&#40;&#41; CLASS miClase RETURN Self METHOD a&#40;&#41; CLASS miClase RETURN 1[/code:y8ptpxt5] Saludos, José Luis Capel
Clonar un objeto
Muchas gracias voy a probarlo
Close ADO-connection
Hi, I allways use in the beginning of my program [code=fw:258wnmat]<div class="fw" id="{CB}" style="font-family: monospace;">oSQL:=CreateObject<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ADODB.Connection"</span><span style="color: #000000;">&#41;</span><br />oSQL:<span style="color: #000000;">ConnectionString</span>:=ADO_SQL_Connectionstring<br />oSQL:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />...<br />...<br /> </div>[/code:258wnmat] and at the end [code=fw:258wnmat]<div class="fw" id="{CB}" style="font-family: monospace;">oSQL:<span style="color: #000000;">close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oSQL:=<span style="color: #00C800;">nil</span><br /> </div>[/code:258wnmat] and that is working very nice. In a particual program I want to delete the SQLite-database and do [code=fw:258wnmat]<div class="fw" id="{CB}" style="font-family: monospace;">oSQL:<span style="color: #000000;">close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oSQL:=<span style="color: #00C800;">nil</span><br />ferase<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'.<span style="color: #000000;">\m</span>yfile.db'</span><span style="color: #000000;">&#41;</span></div>[/code:258wnmat] but the ferase() this returns an error -1 This mean that the file is not closed <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> I now if a only return recordsets, I don't need to open the file like that, but I need to execute some SQL-commands (like creating tables, and other commands) How can I close the connection completely with ADO? Thanks
Close ADO-connection
Marc, [quote="Marc Vanzegbroeck":2k389opf][code=fw:2k389opf]<div class="fw" id="{CB}" style="font-family: monospace;">oSQL:=<span style="color: #00C800;">nil</span><br /> </div>[/code:2k389opf][/quote:2k389opf] This is not needed. [quote="Marc Vanzegbroeck":2k389opf]How can I close the connection completely with ADO?[/quote:2k389opf] [code=fw:2k389opf]<div class="fw" id="{CB}" style="font-family: monospace;">oSQL:<span style="color: #000000;">close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:2k389opf] Should be enough. It might be a timing issue. Try to insert a delay between close() and ferase(). EMG
Close ADO-connection
Hi Marc ferase requires the full path of the filename it may not be a sql issue. Cheers Colin
Close ADO-connection
I too confirm the problem. I could not find a solution yet.
Close ADO-connection
[quote="Colin Haig":3q6ub0dq]Hi Marc ferase requires the full path of the filename it may not be a sql issue. Cheers Colin[/quote:3q6ub0dq] Colin, This is not the problem, because it's working if I don't open the file before.
Close ADO-connection
[quote="Enrico Maria Giordano":2nroltdn] Should be enough. It might be a timing issue. Try to insert a delay between close() and ferase(). EMG[/quote:2nroltdn] Enrico, A delay between close() and ferase() don't work <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> I even tested it with 10 seconds delay...
Close ADO-connection
Marc, [quote="Marc Vanzegbroeck":y5tp59lo][quote="Enrico Maria Giordano":y5tp59lo] Should be enough. It might be a timing issue. Try to insert a delay between close() and ferase(). EMG[/quote:y5tp59lo] Enrico, A delay between close() and ferase() don't work <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> I even tested it with 10 seconds delay...[/quote:y5tp59lo] What did you use for the delay? EMG
Close ADO-connection
[quote="Enrico Maria Giordano":19mivxk7] What did you use for the delay? EMG[/quote:19mivxk7] delay(100)
Close ADO-connection
Marc, [quote="Marc Vanzegbroeck":2g2zingv][quote="Enrico Maria Giordano":2g2zingv] What did you use for the delay? EMG[/quote:2g2zingv] delay(100)[/quote:2g2zingv] Try with SysWait(). EMG
Close ADO-connection
Thanks to EMG SysWait(100) worked for me.
Close ADO-connection
[quote="nageswaragunupudi":8a3q1uer]Thanks to EMG SysWait(100) worked for me.[/quote:8a3q1uer] Also for me <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Close ADO-connection
NageswaraRao and Marc, Great! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
Close ADO-connection
very good! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Close ADO-connection
I wonder about other users having the database open thus preventing deletion. Is there a way to tell? Or, perhaps this is a temp file only created and used by one user?
Close ADO-connection
[quote="James Bott":36nr7jy5]I wonder about other users having the database open thus preventing deletion. Is there a way to tell? Or, perhaps this is a temp file only created and used by one user?[/quote:36nr7jy5] I only use SQLite-database on stand-alone programs. For network-versions I use MySQL. There I don't delete the database-file. Normaly I don't delete any database, but in this paricular program I want the user to be able to delete the SQLite-database, and create an other one...
Close ADO-connection
Please try this test program. I am able to delete the file "soon" after closing the connection. [code=fw:2h4gbmpn]<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;">"adodef.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 />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oCn<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cDb := <span style="color: #ff0000;">"test3.db"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oCn &nbsp; := CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Connection"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCn:<span style="color: #000000;">CursorLocation</span> := adUseClient<br />&nbsp; &nbsp;oCn:<span style="color: #000000;">ConnectionString</span> := <span style="color: #ff0000;">"Driver=SQLite3 ODBC Driver;Database="</span> + cDb + <span style="color: #ff0000;">";"</span><br />&nbsp; &nbsp;oCn:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;? oCn:<span style="color: #000000;">State</span><br />&nbsp; &nbsp;? File<span style="color: #000000;">&#40;</span> cdb <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCn:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCn := <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;? file<span style="color: #000000;">&#40;</span> cdb <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;? ferase<span style="color: #000000;">&#40;</span> cdb <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;? file<span style="color: #000000;">&#40;</span> cdb <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:2h4gbmpn] If the above code is working, why are you not able to erase the file in your program? We see one variable oCn ( or whatever ) as the only variable referring to the connection object. But in a large application, it is highly likely that references to the connection object are still retained in some vars or object data which we can not see. Unless all references in the application to this Object go out of scope, our application do not entirely give up the connection.
Close ADO-connection
[quote:cefoonoq]Unless all references in the application to this Object go out of scope, our application do not entirely give up the connection.[/quote:cefoonoq] Then, I assume, as long as you are not using PUBLICs, PRIVATEs, STATICs, and undeclared vars for connection objects, that this would not be a problem? If so, then this would be a good reason to clean up one's code. I never use PUBLICs, PRIVATEs, or undeclared vars, and rarely use STATICs. This practice has worked well for me. We could also try the opposite test--trying things that might prevent the database from closing. Regards, James
Close ADO-connection
James, [quote="James Bott":1ai0lk9x]Then, I assume, as long as you are not using PUBLICs, PRIVATEs, STATICs, and undeclared vars for connection objects, that this would not be a problem?[/quote:1ai0lk9x] Unfortunately, not. Even "detached locals" can keep live reference to an object. As an example: [code=fw:1ai0lk9x]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span>...;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> MYFUNC<span style="color: #000000;">&#40;</span> oRs <span style="color: #000000;">&#41;</span></div>[/code:1ai0lk9x] <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> EMG
Close ADO-connection
[quote:2gchm2xf]Even "detached locals" can keep live reference to an object.[/quote:2gchm2xf] Very much true. But it is very rare that our programmers in normal course create a "detached local" pf the recordset. [quote:2gchm2xf]As an example: Code: REDEFINE BUTTON...; ACTION MYFUNC( oRs ) [/Code] [/quote:2gchm2xf] Please reconsider. This action clause creates a codeblock { || MYFUNC( oRs ) }. The oRs is not detached. This codeblock always uses the current value of oRs in the calling program. So there is no detached local in this case to retain a reference to the recordset. A local (parameter) gets detached when the called program creates a codeblock using the parameter. Example: [code=fw:2gchm2xf]<div class="fw" id="{CB}" style="font-family: monospace;"><br />func callingfunction<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oRs, b<br />   <span style="color: #B900B9;">// create oRs</span><br />   b := CalledFunc<span style="color: #000000;">&#40;</span> oRs <span style="color: #000000;">&#41;</span><br />   Eval<span style="color: #000000;">&#40;</span> b <span style="color: #000000;">&#41;</span><br />   oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oRs := <span style="color: #00C800;">nil</span><br />   Eval<span style="color: #000000;">&#40;</span> b <span style="color: #000000;">&#41;</span><br />   b := <span style="color: #00C800;">nil</span>  <span style="color: #B900B9;">// now the detached local also is released.  ActiveConnection also is closed</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />fun CalledFunc<span style="color: #000000;">&#40;</span> oRs <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">&#123;</span> || <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> oRs:<span style="color: #000000;">ActiveConnection</span>:<span style="color: #000000;">State</span> <span style="color: #000000;">&#125;</span><br /> </div>[/code:2gchm2xf] Now the oRs get detached in the codeblock b. This detached local is live as long as the codeblock b is live. Even after the oRs in the called program is closed and set to nil, still Eval( b ) shows 1 ( meaining the activeconnection is still open). And when b is released by setting to nil or goes out of scope then the detached local ( referring to the recordset) also is released. One can say XBrowse creates lots of codeblocks using the oRs. Actually XBrowse does not create even a single codeblock using oRs received as parameter, but creates all codeblocks using ::oRs. Thereby there is not detached local referring to the recordset. What I observed ( with xHarbour ) is this: When oRs is assigned to the data of some Object, even after the Object goes out of scope, the reference to oRs in that Object's data is not released. Example: // oRs := Open Recset o := TSomeClass() o:oRs := oRs ... ... later o := nil still the reference of oRs in o:oRs is not released This should have been explicitly released by some destructor method of the TSomeClass Now thats what I have done. TXBrowse's Destroy method sets ::oRs := nil TDataRow class is not a control. so I created DESTRUCTOR method and released oRs reference there. Now I checked and the references to oRs are released cleanly
Close ADO-connection
NageswaraRao, Please check the sample below (change table and field name). You will see that LDB is automatically deleted only if you remove the BUTTON. [code=fw:1uq127uf]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><br /><span style="color: #00D7D7;">#define</span> adOpenForwardOnly <span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> adOpenKeyset      <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> adOpenDynamic     <span style="color: #000000;">2</span><br /><span style="color: #00D7D7;">#define</span> adOpenStatic      <span style="color: #000000;">3</span><br /><br /><span style="color: #00D7D7;">#define</span> adLockReadOnly        <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> adLockPessimistic     <span style="color: #000000;">2</span><br /><span style="color: #00D7D7;">#define</span> adLockOptimistic      <span style="color: #000000;">3</span><br /><span style="color: #00D7D7;">#define</span> adLockBatchOptimistic <span style="color: #000000;">4</span><br /><br /><span style="color: #00D7D7;">#define</span> adUseNone   <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> adUseServer <span style="color: #000000;">2</span><br /><span style="color: #00D7D7;">#define</span> adUseClient <span style="color: #000000;">3</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 />    TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    ? <span style="color: #ff0000;">"2"</span><br /><br />    <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">LOCAL</span> oDlg<br /><br />    <span style="color: #00C800;">LOCAL</span> oRs := CREATEOBJECT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br /><br />    oRs:<span style="color: #000000;">CursorLocation</span> = adUseClient<br /><br />    oRs:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SELECT * FROM Clienti ORDER BY Cliente"</span>, <span style="color: #ff0000;">"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clienti.mdb"</span>, adOpenForwardOnly, adLockReadOnly <span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br />    @ <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test"</span>;<br />           <span style="color: #0000ff;">ACTION</span> TEST2<span style="color: #000000;">&#40;</span> oRs <span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />             <span style="color: #0000ff;">CENTER</span><br /><br />    oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    ? <span style="color: #ff0000;">"1"</span><br /><br />    <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> TEST2<span style="color: #000000;">&#40;</span> oRs <span style="color: #000000;">&#41;</span><br /><br />    ? oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Contatto"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br /><br />    <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:1uq127uf] EMG
Close ADO-connection
Or if you remove oRs from the TEST2() parameter. EMG
Close ADO-connection
After oRs:Close() set oRs := nil Then immediately ActiveConnection also is closed
Close ADO-connection
NageswaraRao, [quote="nageswaragunupudi":hprjztvc]After oRs:Close() set oRs := nil Then immediately ActiveConnection also is closed[/quote:hprjztvc] The point is that oRs can have live references elsewhere in the code. Setting it to NIL doesn't solve the problem, sorry. EMG
Close ADO-connection
[quote:1i27iv05]The point is that oRs can have live references elsewhere in the code. Setting it to NIL doesn't solve the problem, sorry. [/quote:1i27iv05] Mr Enrico The points I am making are #1) Once all references to the recordset are gone the active connection also is closed. #2) ACTION clause does not create detached local. In the example you gave, the active connection was not closed "not because the ACTION codeblock" but because oRs has not still gone out of scope. Your inference from the example is not correct. Once oRs either goes out of scope or set to nil, the active connection is closed. I am not disputing your point that detached locals hold on reference to the object, but buttons ACTION clause does not.
Close ADO-connection
NageswaraRao, [quote="nageswaragunupudi":22hhoenl]Mr Enrico The points I am making are #1) Once all references to the recordset are gone the active connection also is closed. #2) ACTION clause does not create detached local. In the example you gave, the active connection was not closed "not because the ACTION codeblock" but because oRs has not still gone out of scope. Your inference from the example is not correct. Once oRs either goes out of scope or set to nil, the active connection is closed.[/quote:22hhoenl] Please look carefully at my sample. LDB file is still there even after the second message, when oRs has already gone out of scope. EMG
Close ADO-connection
Enrico and Rao I tested the oRs:CLose() followed up with oRs := nil and releasing the object did not close the .ldb for me .. however if I inserted oRs:ActiveConnection:Close() .. the .ldb went away. My example was just a simple case of opening a table .. reading data and writing back a date value to the table and oRs:CLose() .. no browse, no other controls. Rick Lipkin
Close ADO-connection
Enrico and Rao [quote:a71an459] I tested the oRs:CLose() followed up with oRs := nil and releasing the object did not close the .ldb for me .. however if I inserted oRs:ActiveConnection:Close() .. the .ldb went away. [/quote:a71an459] I need to update this post and let you both know that oRs := nil DOES release the object as well as the connection .. the .ldb does in fact close when you nil out the recordset object! I went back and looked at my example .. and I had an additional call to a verification table after the above first example.. It does appear that oRs := nil closed the connection. Rick Lipkin
Close ADO-connection
Rick, [quote="Rick Lipkin":1b90t1fw]I need to update this post and let you both know that oRs := nil DOES release the object as well as the connection .. the .ldb does in fact close when you nil out the recordset object! I went back and looked at my example .. and I had an additional call to a verification table after the above first example.. It does appear that oRs := nil closed the connection. Rick Lipkin[/quote:1b90t1fw] I have an application using a browse where setting oRs to NIL does not close LDB. EMG
Close ADO-connection
[quote="Rick Lipkin":2hg1npg5]Enrico and Rao [quote:2hg1npg5] I tested the oRs:CLose() followed up with oRs := nil and releasing the object did not close the .ldb for me .. however if I inserted oRs:ActiveConnection:Close() .. the .ldb went away. [/quote:2hg1npg5] I need to update this post and let you both know that oRs := nil DOES release the object as well as the connection .. the .ldb does in fact close when you nil out the recordset object! I went back and looked at my example .. and I had an additional call to a verification table after the above first example.. It does appear that oRs := nil closed the connection. Rick Lipkin[/quote:2hg1npg5] Mr Rick Additional Hint: If you have used XBrowse to browse the oRs then after closing the browse please do this: [code=fw:2hg1npg5]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">oRs</span> := <span style="color: #00C800;">nil</span><br />oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oRs := <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:2hg1npg5] From the next release of FWH (13.08) XBrowse itself releases the reference and you do not have to release oBrw:oRs by setting to NIL in your code. Actually I have made the modifications after testing. While testing I was continuously monitoring the number of connections remaining open with a timer after execution of each line of code.
Close ADO-connection
Mr Rick I again advise you to reconsider your practice of opening every recordset with connection string. When you specify ConnString in the RecSet's open method, each time ADO opens a separate connection. Even though you release the connection when you close the recordset, ther fact is that you keep as many independent connections to the server open as the number of recordsets in use in your application. This causes unnecessary strain on both the dataserver and the network. Better keep one connection open per one instance of the application. We are discussing about 2-tier (client-server) programming where our application directly connects to the dataserver, be it sql server or oracle or whatever. So for 2-tier applications like those we make, open connection once at the outset and use it for all recordsets and close the connection at the end of application. There is another well known issue. Opening a connection takes some extratime, which is not necessary to spend every time we open a recordset. Opening recordsets using an already opened connection object is a lot faster. I heard the concern expressed by some friends that if we keep a connection open all the time, disconnection with the server would crash the application. They think they can prevent this by opening recordset by specifying the conn string. But this is not a solution. This makes things even worse. Instead of keeping only connection open, you are keeping more connections open, because most the time the users are using some recordsets and so many connections are in an open state all the time. The practice of opening recset with connstring is more in use in webbased programming. There it is state-less programming. Recset is open, data is used to prepare the web-page, close recset (and also connection) and serve the page. There the programmer is saving coding time and lines of code by specifying connstting in the recset open() method. And most important thing is that web development is always 3-tier programming ( dataserver --> appliction server --> application ). Application server handles connection pooling and for the dataserver application server is just one single user. The connection pooling greatly reduces the strain on the server and also avoids the time taken to open new connection. Webdevelopment practices (3-tier appln) are not appropriate to our (2-tier) desktop applications.
Close ADO-connection
Rao YES .. I have come around to your way of thinking and prior advice along those lines .. I worked a good bit yesterday trying to retro-fit my existing code and I came up with this simple solution .. My existing code looks like this [code=fw:rb36ad5c]<div class="fw" id="{CB}" style="font-family: monospace;"><br />xPROVIDER := <span style="color: #ff0000;">"Microsoft.Jet.OLEDB.4.0"</span><br />xSOURCE   := cDEFA+<span style="color: #ff0000;">"<span style="color: #000000;">\G</span>room.mdb"</span><br />xPASSWORD := <span style="color: #ff0000;">"xxxxxxxxx"</span><br /><br /><span style="color: #00C800;">IF</span> xDATABASE = <span style="color: #ff0000;">"A"</span>  <span style="color: #B900B9;">// ms access</span><br />   xCONNECT := <span style="color: #ff0000;">'Provider='</span>+xPROVIDER+<span style="color: #ff0000;">';Data Source='</span>+xSOURCE+<span style="color: #ff0000;">';Jet OLEDB:Database Password='</span>+xPASSWORD<br /><span style="color: #00C800;">ELSE</span><br />   xCONNECT := <span style="color: #ff0000;">'Provider='</span>+xPROVIDER+<span style="color: #ff0000;">';Data Source='</span>+xSOURCE+<span style="color: #ff0000;">';Initial Catalog='</span>+xCATALOG+<span style="color: #ff0000;">';User Id='</span>+xUSERID+<span style="color: #ff0000;">';Password='</span>+xPASSWORD<br /><span style="color: #00C800;">ENDIF</span><br /><br />...<br />...<br /><br />oRsUser := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />oRsUser:<span style="color: #000000;">CursorType</span>     := <span style="color: #000000;">1</span>        <span style="color: #B900B9;">// opendkeyset</span><br />oRsUser:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// local cache</span><br />oRsUser:<span style="color: #000000;">LockType</span>       := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// lockoportunistic</span><br /><br />cSQL := <span style="color: #ff0000;">"SELECT * From [Staff] Order by [Lname]"</span><br /><br /><span style="color: #00C800;">TRY</span><br />  oRsUser:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span>cSQL,xCONNECT <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />  <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening Staff table"</span> <span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /> </div>[/code:rb36ad5c] Retro-fit code [code=fw:rb36ad5c]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// defined at top of Main()</span><br /><br />xPROVIDER := <span style="color: #ff0000;">"Microsoft.Jet.OLEDB.4.0"</span><br />xSOURCE   := cDEFA+<span style="color: #ff0000;">"<span style="color: #000000;">\G</span>room.mdb"</span><br />xPASSWORD := <span style="color: #ff0000;">"xxxxxxxxx"</span><br /><br /><span style="color: #00C800;">IF</span> xDATABASE = <span style="color: #ff0000;">"A"</span> <span style="color: #B900B9;">// access</span><br />   xSTRING := <span style="color: #ff0000;">'Provider='</span>+xPROVIDER+<span style="color: #ff0000;">';Data Source='</span>+xSOURCE+<span style="color: #ff0000;">';Jet OLEDB:Database Password='</span>+xPASSWORD<br /><span style="color: #00C800;">ELSE</span><br />   xSTRING := <span style="color: #ff0000;">'Provider='</span>+xPROVIDER+<span style="color: #ff0000;">';Data Source='</span>+xSOURCE+<span style="color: #ff0000;">';Initial Catalog='</span>+xCATALOG+<span style="color: #ff0000;">';User Id='</span>+xUSERID+<span style="color: #ff0000;">';Password='</span>+xPASSWORD<br /><span style="color: #00C800;">ENDIF</span><br /><br />xConnect := CREATEOBJECT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Connection"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">TRY</span><br />   xConnect:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> xString <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />   Saying := <span style="color: #ff0000;">"Could not open a Global Connection to Database "</span>+xSource<br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Saying <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /><br />...<br />...<br /><br /><span style="color: #B900B9;">// using the same Open() code</span><br />oRsUser := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />oRsUser:<span style="color: #000000;">CursorType</span>     := <span style="color: #000000;">1</span>        <span style="color: #B900B9;">// opendkeyset</span><br />oRsUser:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// local cache</span><br />oRsUser:<span style="color: #000000;">LockType</span>       := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// lockoportunistic</span><br /><br />cSQL := <span style="color: #ff0000;">"SELECT * From [Staff] Order by [Lname]"</span><br /><br /><span style="color: #00C800;">TRY</span><br />  oRsUser:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span>cSQL,xCONNECT <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// xConnect is now the connection object</span><br />CATCH oErr<br />  <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening Staff table"</span> <span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /> </div>[/code:rb36ad5c] As you can see .. I just re-defined xConnect to be the ( global ) connection object rather than the ( global ) connection string. This offered me the best solution without having to do major surgery and accomplishes using just ONE pre-established connection passed to open each recordset .. thus allowing me to only manage one connection which I can close at anyone time like when I need ( at runtime ) to execute the 'repair and compact' routine .. and at the close of that routine .. I just re-establish the global connection and keep on going. I must admit, I am a bit concerned about maintaining a single ( application ) connection due to the possibility the workstation could temporally lose its network connection and the app would not be able to re-connect, however I have all my recordsets trapped between Try,Catch and EndTry .. and all the user would see is a connection message and the app would not necessarily crash with a run-time error.... but if the network goes down or 'hick-ups' more than my app would crash as well <!-- s:| --><img src="{SMILIES_PATH}/icon_neutral.gif" alt=":|" title="Neutral" /><!-- s:| --> I would presume all my legacy applications using Ms Sql would suffer from the same connection problem and curiously why none of the DBA's would have noticed an excessive amount of open connections ? .. and even how Ms Sql manages those as concurrent or not <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> Rick Lipkin
Close ADO-connection
Rick, Ideally, if your app looses a connection, the app should save the recordset locally, then update the database when a connection is re-established. ADO has built-in capabilities to save and restore recordsets. Persisting Data [url:3ykmrtal]http&#58;//msdn&#46;microsoft&#46;com/en-us/library/windows/desktop/ms675273(v=vs&#46;85)&#46;aspx[/url:3ykmrtal] I have never used this so I can't offer more info. Regards, James
Close ADO-connection
Mr James I shall soon post an example of how to do it. (We can do with xHarbour but not yet with Harbour). We shall also discuss about disconnected recordsets in that posting. But Mr Ricks (and many others') problem is what happens if the connection with the server is broken while a user is browsing a recordset? How do we handle the situation? We shall be soon discussing these aspects also.
Close ADO-connection
James I am not too concerned about data as I buffer all my fields with variables and I create my recordset with the local cache option .. I am not really 'detached' but not working from the database or the table ( as I understand it ) .. from my experience, if the workstation crashes it is not (as) catastrophic to the database especially if the database is on a network share or client\server so database corruption ( especially Ms Access ) is not that common. Buffered variables ( add and edit ) are not written to the table until oRs:Update() so if the box crashes or the network 'hick-ups' .. the variables were never in a committed state .. nothing added or changed, your app may give you a run-time error but so will most of the other applications on that box .. As far as buffering data ( un-written data ) as a transaction if the network loses connection, is important, don't get me wrong, I would rather have my app crash and let the user re-boot and try the application again than worry about an un-stable workstation and if the buffered transaction is really being captured intact to be written to the table at some future time.... Just one of those things you can blame on a 'disturbance in the force' <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Rick Lipkin
Close ADO-connection
Mr Rick Glad you could switch to single connection object instead of single connection string so fast. [quote:1vk165t8]I must admit, I am a bit concerned about maintaining a single ( application ) connection due to the possibility the workstation could temporally lose its network connection and the app would not be able to re-connect, however I have all my recordsets trapped between Try,Catch and EndTry .. and all the user would see is a connection message and the app would not necessarily crash with a run-time error.... but if the network goes down or 'hick-ups' more than my app would crash as well <!-- s:| --><img src="{SMILIES_PATH}/icon_neutral.gif" alt=":|" title="Neutral" /><!-- s:| --> [/quote:1vk165t8] Even in your earlier method, if network connection is down while the user is using (mostly browsing or editing) a recordset, the situation is the same. In both approaches we have the same issue. You say you are talking about losing connection when user has closed all recordsets and just doing nothing. Even then it is not an issue. If you fail to open recordset, just close and reopen the connection and try again. We have better answers. Also please see my reply to Mr James' post. We shall discuss some of these issues in my future postings. But we can not always avoid crashes when network fails which happens even when we are browsing a DBF residing on the server. [quote:1vk165t8]I would presume all my legacy applications using Ms Sql would suffer from the same connection problem[/quote:1vk165t8] Yes. [quote:1vk165t8]curiously why none of the DBA's would have noticed an excessive amount of open connections ?[/quote:1vk165t8] They should have. When an organisation has both Oracle and sql servers most DBAs concentrate more on oracle server activity and they pay least attention to sql servers. Earlier I remember you were mentioning about the issue of licences. That would not be an issue. Even in case of user count based licences, the count applies to the number of client-pcs connected at any given point of time, but not to the number active sessions.
Close Activated Dialog by oWnd:oTimer
Dear All, I need to close all activated dialog by autooff() *alike screen saver*. I can use this below function for automatic log off (popup login screen) the program. [url:jzmg94mb]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=21595&start=0&hilit=getInputState[/url:jzmg94mb] I need to return to main windows (close all sub dialog), If user does not use for specific time. How to do this? Thanks in advance,
Close Activated Dialog by oWnd:oTimer
Dutch [quote:3361eo7m]I need to return to main windows (close all sub dialog), If user does not use for specific time.[/quote:3361eo7m] You can use a logical var for each dialog ( lOpen := .T. or .F. ) Maybe a solution You are looking for I have still a question to How can I set the vars lOpen{1], lOpen{2] or lOpen{3] to .F. in case one of the dialog-systembuttons exit is used to perform a defined action <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> This sample works : the timer is closing all open dialogs from inside a window [img:3361eo7m]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Autoclose&#46;jpg[/img:3361eo7m] [code=fw:3361eo7m]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00D7D7;">#define</span> SC_CLOSE   0xF060<br /><br /><span style="color: #00C800;">STATIC</span> oWnd, oTimer, lOpen<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>, oBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> <br /><br />I := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">3</span><br />    lOpen<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> := .F.<br /><span style="color: #00C800;">NEXT</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Dialog AUTOCLOSE"</span> ;<br /><span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">24</span>, <span style="color: #000000;">64</span> <span style="color: #0000ff;">PIXEL</span>  <br />oWnd:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">16762509</span> <span style="color: #000000;">&#41;</span><br /><br />@ <span style="color: #000000;">20</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">BTNBMP</span> oBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">2007</span> ;<br /><span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Open Dialog 1"</span> <span style="color: #0000ff;">OF</span> oWnd NOBORDER ;<br /><span style="color: #0000ff;">ACTION</span> OPENDLG1<span style="color: #000000;">&#40;</span>oDlg<span style="color: #000000;">&#41;</span><br /><br />@ <span style="color: #000000;">20</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">BTNBMP</span> oBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">2007</span> ;<br /><span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Open Dialog 2"</span> <span style="color: #0000ff;">OF</span> oWnd NOBORDER ;<br /><span style="color: #0000ff;">ACTION</span> OPENDLG2<span style="color: #000000;">&#40;</span>oDlg<span style="color: #000000;">&#41;</span><br /><br />@ <span style="color: #000000;">20</span>, <span style="color: #000000;">370</span> <span style="color: #0000ff;">BTNBMP</span> oBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">2007</span> ;<br /><span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Open Dialog 3"</span> <span style="color: #0000ff;">OF</span> oWnd NOBORDER ;<br /><span style="color: #0000ff;">ACTION</span> OPENDLG3<span style="color: #000000;">&#40;</span>oDlg<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #0000ff;">TIMER</span><span style="color: #000000;">&#40;</span>oDlg<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 /><span style="color: #00C800;">FUNCTION</span> OPENDLG1<span style="color: #000000;">&#40;</span>oDlg<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> oDlgBtn<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>  ;<br /><span style="color: #0000ff;">FROM</span> <span style="color: #000000;">150</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">450</span>, <span style="color: #000000;">400</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">PIXEL</span> <br />oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">13355927</span> <span style="color: #000000;">&#41;</span><br /><br />@ <span style="color: #000000;">120</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">BTNBMP</span> oDlgBtn <span style="color: #000000;">2007</span> ;<br /><span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Close"</span> <span style="color: #0000ff;">OF</span> oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> NOBORDER ;<br /><span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> lOpen<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := .F., oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<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 /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">NOWAIT</span> ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> lOpen<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := .T., NoCloseDlg<span style="color: #000000;">&#40;</span> oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// disable system-exit</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;">FUNCTION</span> OPENDLG2<span style="color: #000000;">&#40;</span>oDlg<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> oDlgBtn<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> ;<br /><span style="color: #0000ff;">FROM</span> <span style="color: #000000;">150</span>, <span style="color: #000000;">500</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">450</span>, <span style="color: #000000;">700</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">PIXEL</span> <br />oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">11513815</span> <span style="color: #000000;">&#41;</span><br /><br />@ <span style="color: #000000;">120</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">BTNBMP</span> oDlgBtn <span style="color: #000000;">2007</span> ;<br /><span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Close"</span> <span style="color: #0000ff;">OF</span> oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> NOBORDER ;<br /><span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> lOpen<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> := .F., oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<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 /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">NOWAIT</span> ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span>  lOpen<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> := .T. <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;">FUNCTION</span> OPENDLG3<span style="color: #000000;">&#40;</span>oDlg<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> oDlgBtn<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> ;<br /><span style="color: #0000ff;">FROM</span> <span style="color: #000000;">150</span>, <span style="color: #000000;">800</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">450</span>, <span style="color: #000000;">1100</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">PIXEL</span>  <br />oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">9028804</span> <span style="color: #000000;">&#41;</span><br /><br />@ <span style="color: #000000;">120</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">BTNBMP</span> oDlgBtn <span style="color: #000000;">2007</span> ;<br /><span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Close"</span> <span style="color: #0000ff;">OF</span> oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> NOBORDER ;<br /><span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> lOpen<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> := .F., oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:<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 /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">NOWAIT</span> ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> lOpen<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> := .T.<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;">FUNCTION</span> <span style="color: #0000ff;">TIMER</span><span style="color: #000000;">&#40;</span>oDlg<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">IF</span> oTimer == <span style="color: #00C800;">nil</span><br />      <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTimer <span style="color: #0000ff;">INTERVAL</span> <span style="color: #000000;">7000</span> <span style="color: #0000ff;">ACTION</span> CLOSEDLG<span style="color: #000000;">&#40;</span>oDlg<span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">TIMER</span> oTimer<br /><span style="color: #00C800;">ELSE</span><br />      Alert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"There is already a working timer..."</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</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;">FUNCTION</span> CLOSEDLG<span style="color: #000000;">&#40;</span>oDlg<span style="color: #000000;">&#41;</span><br />I := <span style="color: #000000;">1</span><br /><br /><span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">3</span><br />    <span style="color: #00C800;">IF</span> lOpen<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span> = .T.<br />        lOpen<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span> := .F.<br />        oDlg<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />    <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">NEXT</span><br /><br />oWnd:<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 /><span style="color: #B900B9;">//------------------- Disable the EXIT-button</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"windows.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapi.h"</span><br /><br /><span style="color: #00C800;">HB_FUNC</span> <span style="color: #000000;">&#40;</span> NOCLOSEDLG <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// ( hWnd )</span><br /><br /><span style="color: #000000;">&#123;</span><br />   HMENU hMenu = GetSystemMenu<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> HWND <span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">FALSE</span> <span style="color: #000000;">&#41;</span> ;<br />   EnableMenuItem<span style="color: #000000;">&#40;</span> hMenu, SC_CLOSE, MF_GRAYED <span style="color: #000000;">&#41;</span> ;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:3361eo7m] regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
Close Activated Dialog by oWnd:oTimer
Dear Uwe, I got the solution as your recommendation, it works fine now. The lOpen will be .F. in the Main procedure (Home) after return from sub-dialog. Thanks for an idea. Dutch
Close Activated Dialog by oWnd:oTimer
[code=fw:307k94z8]<div class="fw" id="{CB}" style="font-family: monospace;">AEval<span style="color: #000000;">&#40;</span> GetAllWin<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#123;</span> |o| <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> o == <span style="color: #00C800;">nil</span> .or. o:<span style="color: #000000;">hWnd</span> == GetWndApp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span>, o:<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: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:307k94z8]
Close Activated Dialog by oWnd:oTimer
Dear Mr.Rao, I will test and feedback to you. [quote="nageswaragunupudi":24pyajdc][code=fw:24pyajdc]<div class="fw" id="{CB}" style="font-family: monospace;">AEval<span style="color: #000000;">&#40;</span> GetAllWin<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#123;</span> |o| <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> o == <span style="color: #00C800;">nil</span> .or. o:<span style="color: #000000;">hWnd</span> == GetWndApp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span>, o:<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: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:24pyajdc][/quote:24pyajdc] Thanks you so much.
Close Applcation At Midnight
I want to do database maintenance after midnight. Is there a way to close all harbour applications still running at midnight? What would the source code look like? Thanks Fulton Loebel
Close Applcation At Midnight
May you can use TIMER?
Close Applcation At Midnight
I use : DEFINE TIMER oOut INTERVAL 59*60000 OF oWnd ; ACTION iif( LEFT(Time(),2)=="00" , ( set(_SET_ERRORLOG ,"Autoclose.log") , tracelog( DTOC(Date()) + " , Programma closed , user " + UPPER(NetName(.T.)) ) , oWnd:END() ) , ) Frank
Close DBF Table opened by Crystal Reports XI via ADS 8.1
Hi all, I am evaluating Crystal Reports XI working with FWH and ADS 8.1 Things are working fine but something is missing... This is how it works: I execute my app from client machine that creates a .dbf table with all the information that i need to put on the report previously created in Crystal Reports XI. Then a connection to the ADS 8.1 is established via Crystal Reports Driver 8.1. using a data dictionary. This data dictionary created with Architect 8.1 have all the tables (.dbf´s) needed by my app. In the next step ActiveXReportViewer opens and shows the report with the information contained in the table. With Architect opened I verified that a connection to ADS is established with the correspondent dictionary (.add) and table (.dbf). Everything works fine until this moment. But when I close the ActiveXReportViewer, this connection and the assotiated dbf file remains open by ADS. The only way I have managed to close this connection was using Architect and manually closing the connection or wating about 4 minutes later to ADS automatically close it by itself. I need to delete this temporary dbf to create another with the same name and refreshed information from database. The big question is this ... How can we force to close the data dictionary connection and the correspondent tables from inside our app code after the information needed by crystal reports is not necessary anymore. The ideal cenario would be closing the connection and tables when the app user close the Cristal Reports Viewer. That way next user that runs the app would have that dbf with refreshed information on it. All the help in this issue is welcome and would be really apriciated. This is my code app: #include "Fivewin.ch" FUNCTION MAIN() LOCAL oCrystal := CREATEOBJECT( "CrystalRuntime.Application" ) LOCAL oReport := oCrystal:OpenReport( "mapa001.rpt" ) LOCAL oWnd, oCRViewer DEFINE WINDOW oWnd oCRViewer = TActiveX():New( oWnd, "CrystalReports115.ActiveXReportViewer.1" ) oCRViewer:SetProp( "ReportSource", oReport ) oCRViewer:SetProp("DisplayGroupTree",.F.) oCRViewer:SetProp("WindowTitle","Listagem do Mestre de Bens") */oCRViewer:SetProp("DisplayToolbar",.T.) oReport:HasSavedData() oReport:DiscardSavedData() oCRViewer:Do( "ViewReport" ) oWnd:oClient = oCRViewer ACTIVATE WINDOW oWnd; MAXIMIZED RETURN NIL Thanks and best regards, Mário Paiva
Close DBF Table opened by Crystal Reports XI via ADS 8.1
Hi, I compile this sample but CREATEOBJECT is missing. Where I can find it?. Thank you!!!. Regards,
Close DBF Table opened by Crystal Reports XI via ADS 8.1
I solved it, I have to link a lib
Close all dialogs
Is there any way to close all open dialogs (without knowing which ones are open) ? Or is there a way to get a list of all open dialogs ?
Close all dialogs
To close all open dialogs: [code=fw:2rkbmuqt]<div class="fw" id="{CB}" style="font-family: monospace;">AEval<span style="color: #000000;">&#40;</span> GetAllWin<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#123;</span> |o| <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> o:<span style="color: #000000;">ClassName</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"TDIALOG"</span>, o:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span></div>[/code:2rkbmuqt] Array of all open dialogs: [code=fw:2rkbmuqt]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #00C800;">local</span> aDlg := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;AEval<span style="color: #000000;">&#40;</span> GetAllWin<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#123;</span> |o| <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> o:<span style="color: #000000;">ClassName</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"TDIALOG"</span>, AAdd<span style="color: #000000;">&#40;</span> aDlg, o <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2rkbmuqt]
Close all dialogs
Excellent. thank you.
Close oWnd from code inside HTML
Hi, How can I close oWnd from the HTML code that's provided by cMyURL? [code:1ju95wjo] DEFINE WINDOW oWnd oActiveX&#58;=TActiveX&#40;&#41;&#58;New&#40; oWnd, "Shell&#46;Explorer" &#41; oWnd&#58;oClient&#58;=oActiveX oActiveX&#58;Do&#40; "Navigate2", cMyURL &#41; ACTIVATE WINDOW oWnd [/code:1ju95wjo] Thanks Patrick
Close oWnd from code inside HTML
Try oActiveX&#058;Do( "Close" ) EMG
Close program for other windows user
My program will only allow one user to use it locally. I open a one DBF file locally in exclusive mode. This I do not wish to change. Here is the scenario... User A runs my program in their Windows Login. Then User A walks away from their computer. After xx time, the computer will go to the Windows Login screen (controlled by users IT department). Now User B enters their Windows Login information and tries to run my program. Since User A still has the program open, User B cannot run the program. Is there any way to close the program running under a different user?
Close program for other windows user
Jeff, I have build a solution for this problem. It's quite a big solution, to big to put the code in here but also to difficult because this code can be found in several parts of my code. But I'll try to describe what I do. I have a file, containing all the controls of the different users. Then I have a timer which checks some controls per user for instance every minute. One control is to check if the program has to be closed on demand by another user. The timer makes the program to read the control within one minute. If my control for closing the program is set to true by the other user, the program will read this, then put the control back to false and finally quit the program. How does user A make the application quit on the PC of user B? User A can select user B in a listbox. Then there is a button which put the control for quitting the program to true for the selected user (i.e. user B). Within one minute, the PC of user B will quit the application. I hope you understand what I mean.
Close program for other windows user
Driessen, Thank you... this gives me an idea of how to solve it <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Close program for other windows user
Dear Jeff, I found the class *Tinativo()* for Log Off (alike screen server by Timer), then by specific time in setup I will auto Log Out (Quit) The program if the user do not touch mouse or keyboard after specific time. - User A - leave the counter for 5 minutes - automatic Log-Off (Activate Login Screen) - after 5 minutes for example - automatic Log-Out (Quit the program) I fix the case of user do not quit the program in network environment and then the other user cannot run the end day procedure and maintenance files (all station must close before run it). Thanks, Dutch
Close the sistem
Good afternoon to all my dear colleagues: D I'm going through a situation where my system is simply closed form 'not advised' and causing much inconvenience to my customers. I have observed that it generates a file called 'hb_out.log'. In this aquivo find the timeline happened to the time of error, is always 'burst' in some of the functions 'DB ... ()' (dbcommit (), dbAppend (), etc.). The information is brought to me is that the CDX is corrupted (hb_cdxPageKeyLeafBalance:. Corrupted index). Would like to know if any of your friends or even liniares antonio One can help me. Already I am grateful to everyone's attention. Ps: I am Brazilian and I'm using the google translator if my 'english' is not good, I apologize. rsrsrsrsrsrsrs PS: I use Harbour
Close the sistem
i suggest you delete the index file and recreate it Regards.
Close the sistem
You can put the expression you create the index?
Close the sistem
not solve, I'm also having the same problem, first thought was the database class, then the harbour, I particionei my dbf parameters created in the harbour dbf minimized, but once a week is the same problem and all this then I switched to harbour in xHarbour did not have that problem. all say the harbour is better and while I could see is that I gained speed network and running the program, however has this inconvenience. let's wait some guro the harbour.
Close the sistem
sorry arthur enjoy your post, but I have the same difficulty this is what most corrupts the index, is also the most used oTxt1:SetText("Arquivo de Clientes") USE arqcli NEW EXCLUSIVE IF( lPack, hb_dbPack(), ) nRegCdx := RecCount() / 100 oMetCdx:SetTotal( RecCount() ) oTxt2:SetText("Indexando o Arquivo Por Código") INDEX ON cod TAG cod EVAL ( oMetCdx:Set(RECNO()), SysRefresh() ) EVERY nRegCdx oTxt2:SetText("Indexando o Arquivo Por Razão Social") INDEX ON nom TAG nom EVAL ( oMetCdx:Set(RECNO()), SysRefresh() ) EVERY nRegCdx oTxt2:SetText("Indexando o Arquivo Por Nome do Cliente") INDEX ON ape TAG ape EVAL ( oMetCdx:Set(RECNO()), SysRefresh() ) EVERY nRegCdx oTxt2:SetText("Indexando o Arquivo Por C.N.P.J.") INDEX ON cgc TAG cgc EVAL ( oMetCdx:Set(RECNO()), SysRefresh() ) EVERY nRegCdx oTxt2:SetText("Indexando o Arquivo Por Município") INDEX ON mun TAG mun EVAL ( oMetCdx:Set(RECNO()), SysRefresh() ) EVERY nRegCdx oTxt2:SetText("Indexando o Arquivo Por Ramo de Atividade") INDEX ON atv TAG atv EVAL ( oMetCdx:Set(RECNO()), SysRefresh() ) EVERY nRegCdx oTxt2:SetText("Indexando o Arquivo Por Vendedor") INDEX ON ven TAG ven EVAL ( oMetCdx:Set(RECNO()), SysRefresh() ) EVERY nRegCdx
Close the sistem
I had a similar problem some time ago. At that time, I was using xHarbour. I changed to Harbour and the problem disappeared.
Close the sistem
mine was just the opposite, but I'm reviewing the entire structure of dbf, inclusion, change ... hope FIND the problem.
Close the sistem
Try creating indexes so the first time [code=fw:zuxh2hzu]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oTxt1:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Arquivo de Clientes"</span><span style="color: #000000;">&#41;</span><br />USE arqcli <span style="color: #00C800;">NEW</span> EXCLUSIVE<br /><span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> lPack, hb_dbPack<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span><br />nRegCdx := RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> / <span style="color: #000000;">100</span><br />oMetCdx:<span style="color: #000000;">SetTotal</span><span style="color: #000000;">&#40;</span> RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />oTxt2:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Indexando o Arquivo Por Código"</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> cod TAG cod <span style="color: #B900B9;">//EVAL ( oMetCdx:Set(RECNO()), SysRefresh() ) EVERY nRegCdx</span><br />oTxt2:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Indexando o Arquivo Por Razão Social"</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> nom TAG nom <span style="color: #B900B9;">//EVAL ( oMetCdx:Set(RECNO()), SysRefresh() ) EVERY nRegCdx</span><br />oTxt2:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Indexando o Arquivo Por Nome do Cliente"</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> ape TAG ape <span style="color: #B900B9;">//EVAL ( oMetCdx:Set(RECNO()), SysRefresh() ) EVERY nRegCdx</span><br />oTxt2:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Indexando o Arquivo Por C.N.P.J."</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> cgc TAG cgc <span style="color: #B900B9;">//EVAL ( oMetCdx:Set(RECNO()), SysRefresh() ) EVERY nRegCdx</span><br />oTxt2:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Indexando o Arquivo Por Município"</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> mun TAG mun <span style="color: #B900B9;">//EVAL ( oMetCdx:Set(RECNO()), SysRefresh() ) EVERY nRegCdx</span><br />oTxt2:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Indexando o Arquivo Por Ramo de Atividade"</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> atv TAG atv <span style="color: #B900B9;">//EVAL ( oMetCdx:Set(RECNO()), SysRefresh() ) EVERY nRegCdx</span><br />oTxt2:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Indexando o Arquivo Por Vendedor"</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> ven TAG ven <span style="color: #B900B9;">//EVAL ( oMetCdx:Set(RECNO()), SysRefresh() ) EVERY nRegCdx</span><br /> </div>[/code:zuxh2hzu] What version of FWH and Harbour are you using?
Close the sistem
I'll try and then I report you, use FWH 907 / 1312 + harbour 3.0 / 3.2 and two'm in trouble
Close the sistem
I have the same problem, but only on a few customers, most of them do not. It seems that is related to equipment. I don't know what to do.
Close the sistem
Erro irrecuper vel 9201: hb_cdxPageKeyLeafBalance: index corrupted. Erro irrecuper vel 9201: hb_cdxPageSeekKey: wrong parent key. I have the same problem, already used XHB, switched to HB and was otimo for 5 days and after this period continues with the same problem, after deleting the CDX and create problem sometimes back again in 1 hour or 6 hours but it comes back happening, this customer has 40 machines that uses accessing the system, but already reduce usage to 20 machines and the problem continues, if some physical problem on some equipament to identify this problem. Currently use the HB 3.2 and FHW 13.12 and bcc 5.82
Close the sistem
Marcio Tullio, The problem is in your dbf that is corrupted. You must do this: rename your DBF like yourdbf_old.dbf and create a new one (maybe using DBU or another of your preference) and create the structure manually. After this, import all data from the old dbf. In your app, recreate all CDX files. Let us know your results.
Close the sistem
Kleyber Hello, I've done it and not resolved, I created all dbf in harbour and spends a few hours, sometimes minutes, corrupts the cdx. I added this function in application start. If! WIN_OSNETREGOK () // Need ADM rights If! WIN_OSNETREGOK (.t.,. T.) // First .t. is to adjust XP / ... W98, the second adjusts the view. MsgInfo ('Registration not set windows!') EndIf EndIf and took the DBINFO (DBI_SHARED, .F.) opening dbf Only Tomorrow I will have the results.
Close the sistem
From my notes: ------------------- 4/27/2005 7:08 AM Windows' Oppontunistic Locking Is well described at: <!-- m --><a class="postlink" href="http://www.dataaccess.com/whitepapers/opportunlockingreadcaching.html">http://www.dataaccess.com/whitepapers/o ... ching.html</a><!-- m --> ----------------- It also appears that you have Win 98 computers on the network--I highly recommend not using those. The amount of RAM in the computers can be an issue. Is this a new system, or an existing system that just started generating errors? If it just started, was there an update to the application software or server? James
Close the sistem
Hi James, thanks for answering. in my case, I dont have computers with w98, machines are core i3 4GB, 3GB 2duo core, but are already two days without problems after the changes. I'm monitoring and getting everything in order will give the opinion.
Close the sistem
My final thoughts despois two weeks without problems. Acresentei this function. If! WIN_OSNETREGOK () // Need ADM rights If! WIN_OSNETREGOK (.t.,. T.) // First .t. is to adjust XP / ... W98, the second adjusts the view. MsgInfo ('Registration not set windows!') EndIf EndIf removed from database class. DBINFO (DBI_SHARED) how to use DBF + CDX acrecentei the opening of the main .PRG AutoShare SET TO 0 recreated with all dbf HARBOUR and updated and finally (do not believe that is the problem, but ...) EVERY removed the indexing INDEX ON type + DTOS (dtem) TAG dtem EVAL (oMetCdx: Set (RECNO ()), SysRefresh ()) // EVERY nRegCdx these were my steps, hope it helps someone who pass by this problem, one thing I noticed is that the error will always be ours, of course, sometimes some updates compiler error occurs. but it is very rare.
Closing Circles
Hi, Here you have the example that we have programmed this week with our mod. This week we have tested with Apache Windows to try ADO Authentication Screen ADO connection! MS SQL database Browser (all code without using any pluggin) Pagination Register editing Error control in editing ... Using our MVC (Model / View / Controller) Mercury system [url:dj3fovs0]http&#58;//modharbour&#46;sysctrlsoftware&#46;com&#58;39391/seamap-3[/url:dj3fovs0] Regards C. regards
Closing Circles
Hola Carles Estoy probando como trabajar con mod_harbour y MS SQL y no tengo claro como manejar el tema de paginación, sobre todo con consultas de muchos registros, ¿Podrias compartir el ejemplo que mencionas?, el link que alli indicas ya no esta disponible. Muchas gracias!! Saludos desde Perú Martín Ch.
Closing Circles
Martin, I think you always have to check which mechanism you use on a case-by-case basis. What do you have on the frontend? bootstrap table? We did some test when starting with mod harbour 2 years ago. Please give more details. Best regards, Otto [url:33vv4m8b]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=45&t=39275&p=234389&hilit=speed&sid=8522ac063ae09281d22e52d2658f75dd&sid=e7e9cdf2c038ab13a4db1fd998f53c57#p234389[/url:33vv4m8b]
Closing Circles
Hola Otto Gracias por el comentario, efectivamente dentro de los detalles que debo adicionar es que estoy trabajando con mod-harbour V2 y con tablas bootstrap tal y como mencionas. El extracto de los datos es atraves de store procedure sql que luego son tratados desde el aplicativo mismo como recordset, pero el tema mayor es ¿como trabajo el tema de paginacion de muchos registros y que puedan ser mostrados en el front-end sin colapsar la presentación? Segun algunos ejemplos de mod-harbour los registros son colocados dentro de matrices que luego son mostrados por el BROWSE, pero al ser muchos no tengo idea de como "paginarlos". En el ejemplo. Carles menciona que trabaja con paginacion, validaciones, etc., por eso me atrevi a solictarle copia del ejemplo para aclarar mis dudas. Espero puedan apoyarme. Saludos, Martín Ch.
Closing Circles
Martin, Have you already tried with the different settings here? Is the data access with AJAX Best regards, Otto [code=fw:3fq6ea4u]<div class="fw" id="{CB}" style="font-family: monospace;"><table &nbsp;<span style="color: #00C800;">class</span>=<span style="color: #ff0000;">"table table-image"</span><br /><span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">"table"</span><br />data-toggle=<span style="color: #ff0000;">"table"</span><br />data-height=<span style="color: #ff0000;">"<?prg &nbsp;return hINI[ 'KARTEI-DATAHEIGHT' ] ?>"</span><br />data-unique-<span style="color: #0000ff;">id</span>=<span style="color: #ff0000;">"_recno"</span><br />data-search=<span style="color: #ff0000;">"true"</span><br />data-search-align=<span style="color: #ff0000;">"left"</span><br />data-pagination=<span style="color: #ff0000;">"true"</span><br />data-toolbar=<span style="color: #ff0000;">"#toolbar"</span><br />data-query-params=<span style="color: #ff0000;">"queryParams"</span><br />data-side-pagination=<span style="color: #ff0000;">"server"</span><br />data-server-sort=<span style="color: #ff0000;">"false"</span><br />data-show-footer=<span style="color: #ff0000;">"true"</span><br />data-ajax=<span style="color: #ff0000;">"ajaxRequest"</span><br />data-click-to-<span style="color: #0000ff;">select</span>=<span style="color: #ff0000;">"true"</span><br />data-single-<span style="color: #0000ff;">select</span>=<span style="color: #ff0000;">"true"</span><br />data-detail-view=<span style="color: #ff0000;">"true"</span><br />data-detail-formatter=<span style="color: #ff0000;">"detailFormatter"</span><br />data-show-columns=<span style="color: #ff0000;">"true"</span><br />data-show-columns-toggle-all=<span style="color: #ff0000;">"true"</span><br />><br />&nbsp;</div>[/code:3fq6ea4u]
Closing Circles
Estimado Otto Muchas gracias por tu respuesta, no me queda muy claro lo que mencionas, tendras un ejemplo algo mas completo que me ayude a comprender lo que me recomiendas? Saludos y gracias de antemano. Martín
Closing Circles
Hello Martin, I myself only work with DBF. But theoretically, it doesn't matter how the data is accessed. It's difficult for me to answer here, as I have no idea how well you know web programming. I'll post a simple example. The logline() function in data.prg logs all accesses. If you change in your bootstrap table definition data-side-pagination="server", you will see that every click on the PAGINATION navigation will trigger an AJAX call. Without data-side-pagination="server", PAGINATION is done directly on the client, i.e. in the web browser. [url:2h301p6b]https&#58;//mybergland&#46;com/fwforum/ajaxtest&#46;zip[/url:2h301p6b] Best regards, Otto
Closing Excel without saving data
Hi, In an application i'm writing, I open an excel-file, select and copy data to the clipboard, and want to close the excel again. It's working nice, but the problem is that excel ask: - Do want to save the changes? - Do you want to leave the data in the clipboard? Is it possible to close it without those messages? Thanks
Closing Excel without saving data
This may help: [url:16rjlpt9]http&#58;//www&#46;exceltip&#46;com/files-workbook-and-worksheets-in-vba/delete-sheets-without-confirmation-prompts-using-vba-in-microsoft-excel&#46;html[/url:16rjlpt9]
Closing Excel without saving data
[url:p7y2gxkm]https&#58;//msdn&#46;microsoft&#46;com/en-us/library/bb177478(v=office&#46;12)&#46;aspx[/url:p7y2gxkm]
Closing Excel without saving data
Thank you Antonio. It's working now with [code=fw:2xt8iptl]<div class="fw" id="{CB}" style="font-family: monospace;">oExcel:<span style="color: #000000;">Displayalerts</span><span style="color: #000000;">&#40;</span>.f.<span style="color: #000000;">&#41;</span></div>[/code:2xt8iptl]
Closing Window (MDI-Child) with Escape
Hi,with wbrowse, a MDI-Child window will close, if you press "ESC", but a xbrowse-window won't. Is there a possibility to close a xbrowse-window also with "ESC"?
Closing Window (MDI-Child) with Escape
Gilbert, oBrw:bKeyChar = { | nKey | If( nKey == VK_ESCAPE, oWnd:End(), nKey ) }
Closing Window (MDI-Child) with Escape
Antonio,thanks, works fine! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Closing Windows neatly
I have a MDI application that opens different databases, say CLIENTS, SUPPLIERS and MANUFACTURERS. I open each as a MDICHILD. (I use resources, so I have a borderless dialog the same size of the MDICHILD) (as taught to be my Antonio Linares and fwh\samples\TestMdi4.prg ) 1. I want to prevent the user from opening the same table more than once, so I need to check before opening, if the window is defined - ISWINDOW() doesn't seem to be working - is it me? Is that correct way? 2.I've also tried checking if the table is already open - if it is, the user has opened the window before. (in this case I want to bring that window 'to the front'. I need a oWnd:Maximize() function like the oWnd:Restore() to do this? (I tried: wndMain():oWndClient:aWnd[1]:setFocus() as suggested by James Bott on this forum - but this only brings the window to the front, not maximise it if it is restored.) 3. The problem with using the check in (2.) above, is that if the user doesn't press my "CLOSE NEATLY" button, I don't get to check that the last data was saved and that the databases get closed. (e.g. they press the 'X' on the window to close. ) Is the VALID clause where this needs to happen? 4. If the VALID clause is the correct place, do I put it on the (borderless) oDLG or on the oMDICHILDWnd ? All I can get it to do is to either close the whole app, or close without 'neatening up' first.