topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
|---|---|
tCalendar class error
|
Tim,
Did you search the TCalendar source for "SET DATE" or "set("? One of those must be in there somewhere.
When you find it, you need to save and restore the current date format.
[code=fw:1eddoxff]<div class="fw" id="{CB}" style="font-family: monospace;">cOldDateFormat := Set<span style="color: #000000;">(</span> _SET_DATEFORMAT <span style="color: #000000;">)</span> <br />SET DATE BRITISH<br />...<br />Set<span style="color: #000000;">(</span> _SET_DATEFORMAT, cOldDateFormat <span style="color: #000000;">)</span></div>[/code:1eddoxff]
James
|
tCalendar class error
|
James,
The class is designed to do all of its work in BRITISH format. On the first call of the class, it saves the program format, then switches to BRITISH. You can't change that because then the class will not work. It also restores the date after the method is called.
I think the problem is that if you call the calendar, it displays and has reset the operational month to BRITISH. If you leave that, you will reset to AMERICAN fine. However, if you change the month from within that calendar control, I think it then resets the default to BRITISH, and the restore then becomes to BRITISH. That is the only thing that makes sense.
When I call the calendar control, I must then reset the main program date format when I leave the function. My point, however, is that a flaw exists in the class that should be fixed. Yes, I have a workaround, but ultimately a broken control will result in other problems.
Also, if I modified the control, I would then need to modify every updated control and I would rather not have that issue to remember.
|
tCalendar class error
|
Tim,
I meant to find the problem in the control and find a fix. I'm sure Antonio would apply the fix for future releases.
James
|
tCalendar class error
|
I propose the following changes to tcalenda.prg to make the class work independent of the date format set in the application.
In the defines, comment out or remove
[code=fw:30vwnuv2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//#define DATEFORMAT "dd/mm/yyyy"</span><br /> </div>[/code:30vwnuv2]
Include this translate above the CLASS definition.
[code=fw:30vwnuv2]<div class="fw" id="{CB}" style="font-family: monospace;"><br />#xtranslate YMD2D<span style="color: #000000;">(</span> <y>, <m>, <d> <span style="color: #000000;">)</span> => SToD<span style="color: #000000;">(</span> StrZero<span style="color: #000000;">(</span> <y>, <span style="color: #000000;">4</span> <span style="color: #000000;">)</span> + StrZero<span style="color: #000000;">(</span> <m>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> + StrZero<span style="color: #000000;">(</span> <d>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> </div>[/code:30vwnuv2]
In the header of the class change these methods as virtual
[code=fw:30vwnuv2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">METHOD</span> RestoreDateFormat<span style="color: #000000;">(</span><span style="color: #000000;">)</span> VIRTUAL <span style="color: #B900B9;">//INLINE Set( _SET_DATEFORMAT, ::cDateFormat )</span><br /><br /> <span style="color: #00C800;">METHOD</span> SaveDateFormat<span style="color: #000000;">(</span><span style="color: #000000;">)</span> VIRTUAL <span style="color: #B900B9;">//INLINE ::cDateFormat := Set( _SET_DATEFORMAT ), Set( _SET_DATEFORMAT, DATEFORMAT )</span><br /> </div>[/code:30vwnuv2]
Or even completely remove these two methods from the entire source wherever they appear.
Replace these methods with the new methods given below
[code=fw:30vwnuv2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> GetArrayDatesRange<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TCalendar<br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">{</span> YMD2D<span style="color: #000000;">(</span> ::<span style="color: #000000;">pDateRange</span>:<span style="color: #000000;">nYear1</span>, ::<span style="color: #000000;">pDateRange</span>:<span style="color: #000000;">nMonth1</span>, ::<span style="color: #000000;">pDateRange</span>:<span style="color: #000000;">nDay1</span> <span style="color: #000000;">)</span>, ;<br /> YMD2D<span style="color: #000000;">(</span> ::<span style="color: #000000;">pDateRange</span>:<span style="color: #000000;">nYear2</span>, ::<span style="color: #000000;">pDateRange</span>:<span style="color: #000000;">nMonth2</span>, ::<span style="color: #000000;">pDateRange</span>:<span style="color: #000000;">nDay2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">METHOD</span> GetSystemDate<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TCalendar<br /><br /><span style="color: #00C800;">RETURN</span> YMD2D<span style="color: #000000;">(</span> ::<span style="color: #000000;">pSystemDate</span>:<span style="color: #000000;">nYear</span>, ::<span style="color: #000000;">pSystemDate</span>:<span style="color: #000000;">nMonth</span>, ::<span style="color: #000000;">pSystemDate</span>:<span style="color: #000000;">nDay</span> <span style="color: #000000;">)</span><br /> </div>[/code:30vwnuv2]
Make this change in the METHOD Notify
for the line:
[code=fw:30vwnuv2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /> dDate := CToD<span style="color: #000000;">(</span> StrZero<span style="color: #000000;">(</span> Day<span style="color: #000000;">(</span> ::<span style="color: #000000;">dDate</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">"/"</span> + StrZero<span style="color: #000000;">(</span> Month<span style="color: #000000;">(</span> ::<span style="color: #000000;">dDate</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">"/"</span> + Str<span style="color: #000000;">(</span> <span style="color: #0000ff;">Year</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">dDate</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> </div>[/code:30vwnuv2]
Substitute
[code=fw:30vwnuv2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> dDate := ::<span style="color: #000000;">dDate</span><br /> </div>[/code:30vwnuv2]
Now the TCalendar class does not interfere with the DATE FORMAT set in the application program.
|
tCombobox con ::bKeyDown
|
Hola:
¿ Por qué ahora, al definir un ::bKeyDown a un combobox ya no funcionan las otras teclas, como up, down, home, end ?
Hasta la versión 810 funcionaba, cuando la clase no tenía el método KeyDown.
Ejemplo:
oCbx:bKeyDown:=;
<|nK,nF|
IF nK=13 .and. !Empty(bMyAction)
Eval(bMyAction)
ENDIF
>
Mil gracias
|
tCombobox con ::bKeyDown
|
César,
Si devuelves nil desde bKeyDown, estarás solicitando comportamiento por defecto y funcionarán las teclas habituales:
oComboBox:bKeyDown = { | nKey | MsgBeep(), nil }
|
tDBF Class
|
Does someone have the tDBF class that is compatible with xHarbour if so can you please supply Source, Lib and Make files.
If you need to mail it <!-- e --><a href="mailto:grumpy@internode.on.net">grumpy@internode.on.net</a><!-- e --> would appreciate it.
Thanks in Advance.
Gerry
|
tDBF Class
|
You got the tDBF class already? If not, I can send you mine.
|
tDBF Class
|
Yes, Boris that would be great. My email for send is [color=blue:jb1vywr2]grumpy@internode.on.net [/color:jb1vywr2] I really appreciate it.
Thank You
Gerry
|
tData for SQL
|
James,
There is a lot of talk here about converting from DBF files to SQL.
As a long time user of tData ( it's in 100% of my code ), what would be the conversion possibilities to have a modified version that would work with SQL ? Maybe that is just "way out there" in ideas, but the thought of changing all that code ... well it's just not appealing at this stage in life ...
I figured you may have given this topic some thought, but I'm also posting it here so it will be dialoged by others who also use tdata.
Tim
|
tData for SQL
|
Tim,
Please search in the fórums for datarow class.
Very fast to work with it. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
tData for SQL
|
FWH has TDataBase class for DBFs, which has been improved a lot during few years.
Very soon FWH will have a TRecSet class whish is a wrapper class to ADO RecordSet. Both TRecSet and TDataBase will have the same methods.
Using TRecSet class programmer can use methods like ADO RecordSet class. At the same time he can use methods like TDatabase class. A program written for DBF with TDatabase can be easily ported to TRecSet class.
TDataRow is a class which deals with a single record. The record can be from DBF, AdoRecordSet. Browse Row, etc. Code written using TDataRow is fully portable across different datasources.
|
tData for SQL
|
tData is an extension of the tDatabase class. Here is an example of code written using the tData objects:
[code=fw:287cs4he]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #B900B9;">// Display edit dialog for eAuto account and this company's data</span><br /> <span style="color: #B900B9;">// Open database</span><br /> oDcf := tdata<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span>, cPath + <span style="color: #ff0000;">"dForce<span style="color: #000000;">\d</span>fsetu"</span> <span style="color: #000000;">)</span><br /> oDcf:<span style="color: #000000;">use</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> oDcf:<span style="color: #000000;">reccount</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span> = <span style="color: #000000;">0</span><br /> oDcf:<span style="color: #000000;">append</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> oDcf:<span style="color: #000000;">goto</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// Create dialog</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;">"DFORCE"</span> <span style="color: #0000ff;">BRUSH</span> oBrush TRANSPARENT <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">FONT</span> oMFont<br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">CHECKBOX</span> ldForce <span style="color: #0000ff;">ID</span> <span style="color: #000000;">116</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Check if you wish to turn on Demand Force processing"</span> <span style="color: #0000ff;">UPDATE</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oDcf:<span style="color: #000000;">dfsnam</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Enter the shop name"</span> <span style="color: #0000ff;">UPDATE</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oDcf:<span style="color: #000000;">dfsadr1</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">103</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Enter the shop address line 1"</span> <span style="color: #0000ff;">UPDATE</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oDcf:<span style="color: #000000;">dfsadr2</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">104</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Enter the shop address line 2"</span> <span style="color: #0000ff;">UPDATE</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"HROK"</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">121</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Accept"</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oDcf:<span style="color: #000000;">save</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Use the values entered above"</span> NOBORDER TRANSPARENT<br /><br /> <span style="color: #B900B9;">// Activate the dialog screen</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #0000ff;">center</span><span style="color: #000000;">(</span>wndmain<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// Close database and exit</span><br /> oDcf:<span style="color: #000000;">close</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span><br /><br /> </div>[/code:287cs4he]
|
tData for SQL
|
tData is an extension of the tDatabase class. Here is an example of code written using the tData objects:
[code=fw:3nowkcjm]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #B900B9;">// Display edit dialog for eAuto account and this company's data</span><br /> <span style="color: #B900B9;">// Open database</span><br /> oDcf := tdata<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span>, cPath + <span style="color: #ff0000;">"dForce<span style="color: #000000;">\d</span>fsetu"</span> <span style="color: #000000;">)</span><br /> oDcf:<span style="color: #000000;">use</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> oDcf:<span style="color: #000000;">reccount</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span> = <span style="color: #000000;">0</span><br /> oDcf:<span style="color: #000000;">append</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> oDcf:<span style="color: #000000;">goto</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// Create dialog</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;">"DFORCE"</span> <span style="color: #0000ff;">BRUSH</span> oBrush TRANSPARENT <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">FONT</span> oMFont<br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">CHECKBOX</span> ldForce <span style="color: #0000ff;">ID</span> <span style="color: #000000;">116</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Check if you wish to turn on Demand Force processing"</span> <span style="color: #0000ff;">UPDATE</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oDcf:<span style="color: #000000;">dfsnam</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Enter the shop name"</span> <span style="color: #0000ff;">UPDATE</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oDcf:<span style="color: #000000;">dfsadr1</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">103</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Enter the shop address line 1"</span> <span style="color: #0000ff;">UPDATE</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oDcf:<span style="color: #000000;">dfsadr2</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">104</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Enter the shop address line 2"</span> <span style="color: #0000ff;">UPDATE</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"HROK"</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">121</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Accept"</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oDcf:<span style="color: #000000;">save</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Use the values entered above"</span> NOBORDER TRANSPARENT<br /><br /> <span style="color: #B900B9;">// Activate the dialog screen</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #0000ff;">center</span><span style="color: #000000;">(</span>wndmain<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// Close database and exit</span><br /> oDcf:<span style="color: #000000;">close</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span><br /><br /> </div>[/code:3nowkcjm]
Of course, filters and scopes are fully supported, saves, etc. Browses are incredibly easy to setup.
I have 208 .prg files in this application, some with up to 7500 lines of code. There are over 100 dbf files. The size of a re-write to SQL has stopped me from progressing. Also, I would need to build a utility that creates the new SQL database, with all those tables, and imports all of the existing data ( in some cases, close to 30 years of data for a small business ).
I think it's important to move forward, but I'm trying to evaluate just how massive this project might become.
|
tData for SQL
|
#1 Yes. Originally TData was an extension of TDatabase. Now TDatabase is extended a lot by itself. It is not my intention is to compare or advise any change. I rather advise *not* to change. Any change is a big effort. I just wanted to place on record that now TDatabase is a very enriched class.
#2. Keeping portability in view we are going to introduce TRecSet class. With very few changes (mostly while opening the table) TDatabase code should work with TRecSet also. If there are going to be users it will be included in Sept release. It is not really a new work. Refurbishing the classes I have been personally using for years in my real life applications. The TRecset class transparently handles differences between harbour/xharbour and those minor but important differences between different SQL DBMSs.
#3. FWH already provides many ado functions for exporting DBFs to SQL DBMSs. The job of migrating tables is very easy. Example: FW_AdoImportFromDBF(...).
We purposefully designed XBrowse to help portability. With the same intention we added and integrated TDataRow class. Using both together we can write a table maintenance program in a very few steps that is fully portable between dbf, ado, tdatabase like objects, tdolphin, etc.
I personally advise you plan to move ahead. FWH provides the tools for you.
[quote:3vo93ou4]I think it's important to move forward, but I'm trying to evaluate just how massive this project might become.
[/quote:3vo93ou4]
There is no doubt it requires good effort. But it is definitely not going to be as massive as you might be thinking.
|
tData for SQL
|
I have my entire program now fully built, and running, with FWH / Harbour / and Visual Studio 2013. The next logical step is SQL and some significant code refinements. Some of the newer capabilities are in classes while some of the older ones are still function sets. More will be converted to classes.
The code set spans over 30 years, starting from dbase II code running under CP/M. It has grown, been modified, enhanced to Windows, and embraced many new capabilities over the years.
Tim
|
tData for SQL
|
Tim,
[quote:1hd2wym2]As a long time user of tData ( it's in 100% of my code ), what would be the conversion possibilities to have a modified version that would work with SQL ? Maybe that is just "way out there" in ideas, but the thought of changing all that code ... well it's just not appealing at this stage in life ...
I figured you may have given this topic some thought, but I'm also posting it here so it will be dialoged by others who also use tdata[/quote:1hd2wym2].
Actually, I gave it some thought back in 2008 and I already wrote a recordset class that emulates TData. There wasn't much interest at the time so I didn't pursue it further. I will dig it up, review it, and get back to you.
James
|
tData for SQL
|
James,
A lot has changed in 6 years, and likely there is more interest now. Also, newer FWH capabilities are focusing on that now.
Tim
|
tData for SQL
|
Tim
Rao has done some nice work in creating FW wrappers for many for the routine Sql Ado methods. For me ( when I was learning ado ) it was useful in understanding the basic methods and what they did so I had a clearer idea what was possible and the method definitions.
Here is the MSDN link to the Ado Class and Methods used with your recordsets.
<!-- m --><a class="postlink" href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms677516%28v=vs.85%29.aspx">http://msdn.microsoft.com/en-us/library ... 85%29.aspx</a><!-- m -->
Rick Lipkin
|
tData for SQL
|
Thanks Rick,
I've got one project to finish up ( this week hopefully ) and then I plan to dive into this aggressively. I've also retained your notes from before.
Tim
|
tData for SQL
|
Hello Tim,
have you ever considered to switch to remote desktop and keep the dbf databases.
You can tweak remote desktop using polices and get this way the security and flexibility you need and best
you need only one program to serve all the operating systems.
We have now a custom version of a remote client for our purpose. We do not use VPN anymore. This way connection is much faster and easier.
This is from an email exchange with the programmer of the remote client:
As far as I know the only way to avoid the VPN security prompt in Android might be (I've never able to get this to work) to set up an "Always-On VPN" connection (see "vpn.png" attachment). Only L2TP or IPSec VPNs are supported (not PPTP).
Even with custom VPN applications, Android will always prompt (according to this) if the application is trusted.
RDP protocol uses TLS internally, so strictly speaking, it provides security level comparable with IPSec VPN and higher than PPTP. By default, remote client accepts any server certificate when it's establishing a connection, and relies on username/password authentication mechanism only, but it would be possible to add server certificate verification capability to remote client for additional security, and avoid having to use VPN completely.
To use RDP without VPN, your RDP server will need to be accessible via Internet. RDP uses TCP port 3389, so you will need to open that port on the firewall, (or set up a different port and redirect it to server's port 3389). In remote client you will need, of course, to specify the public IP address or host name, and if the port number is different than 3389, you can add it too, separated by colon (':'), such as: "1.2.3.4:5678" (where 1.2.3.4 is the IP address, and 5678 is the port number).
It's now possible to:
a) specify screen orientation (system, portrait, or landscape) in "custom resolution" settings dialog
b) disable the menu icon (the orange gear icon) from being displayed when connection is active
c) disable zoom
Once connection is configured, you can add a "widget" to Android launcher screen, which will allow you to activate a specific connection directly.
Best regards,
Otto
|
tData for SQL
|
Dear Otto,
whats the name of that Android app ?
|
tData for SQL
|
Hello Antonio,
this version is not distributed using "Play" store.
If there is interest I can talk with the programmer.
Best regards,
Otto
|
tData for SQL
|
Otto,
Is there a web site where to review it ?
I am sure others will find it quite interesting too
|
tData for SQL
|
Hi Otto,
I have absolutely no problems with DBFs over networks. I haven't in many years.
The issue here is SQL. Personally I like DBF's, but in this increasing world of connectivity, they simply are not being supported. If I need to make ancillary programs for some capabilities, they need to be in SQL. Many of the 3rd party programs have built in features for SQL ( like Codejock ) that simplify the usage, but not for DBF. As I look to the future ( optimistic for this old timer ), I know I should make the transition.
Remote desktop may work for you, but I don't see a need for it in my case.
Finally, if I decide to do a cloud based solution, SQL would be, by availability, the database of choice.
I'm just thinking ahead, keeping the senility at bay !
Tim
|
tData for SQL
|
Hello Tim,
this is strange. Here we use XML for this.
Best regards,
Otto
|
tData for SQL
|
I love ADS. I can use SQL interface/client and straight DBF access on the same data at the same time. They even have an oData client for use with mobile connectivity.
|
tData for SQL
|
Hi Tim
I agree with you.
Long pass through this stage and the complexity of my applications just like you, we have due to our customers, to go from dbf to sql was a decision to mediate and end we decided on SQLRDD and xHarbour, it took three months to put about one of our most important applications.
however, now we want to use new tools like visual strudio, xHarbour does not even for visual support.
So we're in the same position we had 5 years ago, when we migrated to SQL because SQLRDD is not even supported for Harbour.
So we have to decide just like you, that tool allows us to have a reliable solution in short time.
Analyzing the different options, everything points to ADO, however, the change is substantial, due to the change in how you view the information from a DBF table vs. SQL, when already in production and should not affect our client and we estimate that the change will take us 6 months.
And all this because of the incompatibility between compilers, (x) Harbour.
regards
|
tData for SQL
|
This is a discussion with many viewpoints. I posted it because it is clear that many FWH developers are facing the SQL question. Certainly Daniel has made some nice contributions with Dolphin, and Rick has excited people with ADO.
I am working on the belief that FWH + Harbour + MSVC ( Visual Studio ) will be a major benefit for us. I also believe that when we use Visual Studio, we will see the benefit of using other languages to build supportive programs for our main programs written with FWH.
Visual Studio does not natively support DBFs any longer. That is why I'm concerned. In fact, as I talk with IT people now, most really don't know or understand DBFs. They only use SQL to store data, and XML to share it. Most of the 3rd party programs with which we have to interface only use SQL. ( These are products that provide data to our clients ). Also, at my age, I always have to think of someone taking over this code, and SQL would be a lot easier for someone to acquire and use. Its just the way it is today.
Yes, ADS is good, and my main system uses ADS. However, to be honest, the company has been acquired many times and the staff is changing. There is no guarantee it will be around for the long term. Its a very small segment of a very large company. My rep is gone, and the new person responsible for providing me product to sell doesn't seem too interested. That concerns me.
This is a huge project for me to undertake so I like any options to make it easier. When I went to tData ( objects ), it was a lot of work, but it was very worthwhile. Hopefully I can find a way to make a smooth transition and have a result that attracts new clients and pleases the long term loyalists.
Tim
|
tData for SQL
|
Tim
I remember when I modified my first DBFCDX application to Sql Server with ADO.. I found it to be a different way of thinking, especially thinking in terms of fetching a subset of rows for a specific query, rather than opening an entire table, seeking and filtering data.
One thing to keep in mind using recordsets is that they are local ( cached ) to the workstation that opened them and in a multi-user environment you need to keep in mind data visibility. Meaning, if I have a workstation that has fetched a set of rows from a Customer Table and workstation two has done so also, but has ADDED a new record .. workstation one can not see the new row until he refreshed his cache of records... to handle such events you need to plan for them in your development to open\close and re-open tables on each workstation as you move from module to module in your code so that you have record visibility between your workstations.
Also, in many service shops you many have 10 or so ( open ) work orders in a day and you can have multiple people ( potentially ) modifying the same record at the same time so you need to account for that before you update any records to make sure you do not over-write records that have been 'out of your scope' ..
I have all kinds of strategies I have dealt with and the time to think about ( especially ) workstation update and visibility is at the planning stage and not a retro-fit after the fact.
If you like we can share some code, or I would even be willing to take one of your small modules and covert the code in your context so you can see how SQl and Ado work together.
Rick Lipkin
|
tData for SQL
|
Tim,
I reviewed my old recordset class and notes and was going to point out some of the issues when using SQL, but I see Rick has already mentioned most of them.
So, although, my recordset class can be used as a drop-in replacement for the TData class, you cannot feasibly do this when using large tables since the entire table must be in the recordset. Therefore, there seems to be no alternative but to rewrite code in order to move to SQL databases. Mainly you need to reduce browses to only a subset of a table which generally can be done with a search narrowing down the number of records to be browsed.
Then as Rick pointed out, changed records in the set must be updated immediately so other users can see the updates.
James
|
tData for SQL
|
Hello,
Fivewin provides a set of great ADO functions created by Mr. Nages.
Also, Rick and Enrico provided me extraordinary help and support to understand ADO.
ADO allows us to use whatever database available with same code.
In the past, SQLRDD seemed a great tool, but at the end it turned out to be very buggy and unfinished. Also, Antonio pointed out in a previous message that Patrick Mast is considering to move into Harbour.
About ADS, Timm indicated the risk. Besides, the costs are quite expensive.
|
tData for SQL
|
Lucas,
[quote="lucasdebeltran":2by7w4al]In the past, SQLRDD seemed a great tool, but at the end it turned out to be very buggy and unfinished.[/quote:2by7w4al]
I confirm. And moreover, it doesn't solve the problem of big tables pointed out by James.
[quote="lucasdebeltran":2by7w4al]Also, Antonio pointed out in a previous message that Patrick Mast is considering to move into Harbour.[/quote:2by7w4al]
This is not true. Patrick has confirmed in comp.lang.xharbour that he's [b:2by7w4al]not[/b:2by7w4al] moving to Harbour.
EMG
|
tData for SQL
|
I really appreciate the responses on this thread. It helps us evaluate potential options as we improve our solutions, and shows the pros and cons of various methods.
I like that people have many options, and make them work as desired. As a developer, I spend much time in communication with my clients. They don't understand programming, so they never tell me what to use. They do understand their business, so the let me know what they need. This allows me to understand where I need to focus in the next few years.
I always appreciate everyone's comments because they often bring up views that I have not previously considered, or cautions I need to explore before I make changes in my approach. I want to thank all of the people who participate in this forum for your continued input.
Tim
|
tDataBase
|
Hi All
I an using this code to create my indexes
[code=fw:2uj2o55h]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Maintmod<span style="color: #000000;">(</span>oMainWnd,cPath<span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oDb,oIndex<br />oIndex := tdatabase<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span>,cPath + <span style="color: #ff0000;">"indfile"</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">if</span> oIndex:<span style="color: #000000;">use</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> ! oIndex:<span style="color: #000000;">eof</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> CursorWait<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oDb := tdatabase<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span>,cPath + alltrim<span style="color: #000000;">(</span>oIndex:<span style="color: #000000;">datafile</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> oDb:<span style="color: #000000;">use</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oDb:<span style="color: #000000;">pack</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oDb:<span style="color: #000000;">CreateIndex</span><span style="color: #000000;">(</span>alltrim<span style="color: #000000;">(</span>oIndex:<span style="color: #000000;">datafile</span><span style="color: #000000;">)</span>,alltrim<span style="color: #000000;">(</span>oIndex:<span style="color: #000000;">tagname</span><span style="color: #000000;">)</span>,alltrim<span style="color: #000000;">(</span>oIndex:<span style="color: #000000;">key</span><span style="color: #000000;">)</span>,<span style="color: #00C800;">if</span><span style="color: #000000;">(</span>!empty<span style="color: #000000;">(</span>oIndex:<span style="color: #000000;">cond</span><span style="color: #000000;">)</span>,alltrim<span style="color: #000000;">(</span>oIndex:<span style="color: #000000;">cond</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> oDb:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oIndex:<span style="color: #000000;">skip</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">enddo</span><br /> oIndex:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> CursorArrow<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span><span style="color: #000000;">(</span><span style="color: #00C800;">nil</span><span style="color: #000000;">)</span><br /> </div>[/code:2uj2o55h]
The indexes are created but the when I use an index with a for condition (oIndex:cond) it does not work according to the condition.
Regards
Colin
|
tDataBase
|
Colin,
The fourth parameter of Method CreateIndex has to be a codeblock:
[code=fw:1j4gh2u1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> CreateIndex<span style="color: #000000;">(</span> cFile, cTag, cKey, bKey, lUnique <span style="color: #000000;">)</span><br /> </div>[/code:1j4gh2u1]
|
tDataBase
|
Hi Antonio
I changed to this
oDb:CreateIndex(alltrim(oIndex:datafile),alltrim(oIndex:tagname),alltrim(oIndex:key),{||if(!empty(oIndex:cond),alltrim(oIndex:cond),oIndex:cond)})
the indexes are created but when I use an index which has a condition it does not work.
Regards
Colin
|
tDatabase
|
Colin,
I actually buck the windows standard and use something from the DOS days because that is what my clients want. The browse occupies the lower part of a dialog and the fields for the highlighted record are displayed in the upper half of the dialog. As you browse through the records, the edit fields are refreshed with the data. It saves all those popups and it is exactly what my clients want.
That created difficulties because of the various xbrowse buffers. Using tData makes the process very easy, and the ON CHANGE for the browse actually loads the newly highlighted record into tRecord. The edit fields are all trecord objects, and if the save button is pressed after doing editing, the values are now always written to the correct actual database record. It works perfectly.
James is correct about the proper method for handling data ( browse edits done in a pop up window ) based on what people will expect. However, in a vertical market, with some of my clients having in excess of a 25 year history with this software ( DOS and Windows ), I found it necessary to program for their preferences. New users love it also because it makes more sense to them.
Tim
|
tDatabase
|
One should follow Windows standards unless there is a really good reason not to.
However, I do concur with Tim. In certain vertical markets such as his (auto shops) many of his users probably only use his software and many have been using it since the DOS era. So in his case it may make sense to stick with the old interface style.
James
|
tDatabase
|
Hi All
I am converting my applications to using the Fivewin database class but are unsure about indexes
lData := TRUE
oCode := tdatabase():Open(,cPath + "code",,TRUE)
if oCode:used()
oCode:SetOrder('CODE')
else
MsgAlert('Can Not Open CLIENT File')
lData := FALSE
endif
oJb := tdatabase():Open(,cPath + "jb",,TRUE)
if oJb:used()
oJb:SetOrder('CODEORD')
oJb:SetRelation(oCode,"code",FALSE)
else
MsgAlert('Can Not Open JOB File')
lData := FALSE
endif
if lData
oCode:use() // if I check the alias and indexkey - there is no index
do while ! oCode:eof()
MsgInfo(oCode:code) // does not skip in index order
oCode:skip()
enddo
endif
Am I supposed to use AddIndex or some other method or do I have to specify the order each time.
Any samples of using tDatabase - openning datafiles and indexes - also setting a relationship would be appreciated.
Cheers
Colin
|
tDatabase
|
Please remove "oCode:Use()" after "if lData" statement. Open method already opened the table, using Use() method.
Otherwise your code is correct.
Please take care of the following points:
TDatabase opens the table using the default RDD, which is normally DBFNTX. If you want to use DBFCDX, either you should set the default RDD to DBFCDX by RDDSetDefault( 'DBFCDX' ) or specify the driver as 3rd parameter in the call to open method. Otherwise,
If you are using DBFNTX, you should manually add the index file, by oCode:AddIndex( <indexfilename> ) and then oCode:SetOrder(...)
|
tDatabase
|
Mr Rao
I am using dbfcdx.
Why does oCode not skip in the index order - when I set the order when I openned it.
oCode := tdatabase():Open(,cPath + "code",,TRUE)
if oCode:used()
oCode:SetOrder('CODE')
else
MsgAlert('Can Not Open CLIENT File')
lData := FALSE
endif
Cheers
Colin
|
tDatabase
|
The above code should work. Similar code works for me and all. May be the tag does not exist or misspelt.
After oCode:SetOrder( 'CODE' ), please check "MsgInfo( oCode:SetOrder() )" and see if the order is set correctly.
|
tDatabase
|
Look at tData ... it adds some significant improvements. I've been using database objects for years and it makes coding a lot easier.
|
tDatabase
|
Tim
I have been seeking assistance from James and he has been a great help with the tDatabase class - I am
re writing my application because I cant get a third party database server ( which I have been using for ages)
upgraded - everything was going fine until I tried using SetRelation which I cant get to work and seems to do something
to the index set on the child database. Also changing my twbrowses ( Hernans ) to Fivewin xbrowse and finding xbrowse
very good.
Cheers
Colin
|
tDatabase
|
Here is a sample code that works with TDatabase class. This code is tested. You may compile and test the code as it is. Later you may adopt this for your needs.
[code=fw:e5ucfzzu]<div class="fw" id="{CB}" style="font-family: monospace;"><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;">"ord.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">static</span> cPath := <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\s</span>amples<span style="color: #000000;">\"</span> // change this if necessary<br /><br />function Main()<br /><br /> local oCust, oStates<br /> local oDlg, oBrw<br /><br /> SET DELETED ON<br /> SET EXCLUSIVE OFF<br /><br /> RDDSetDefault( 'DBFCDX' )<br /> SET OPTIMIZE ON<br /><br /> ReBuildIndex() // for this test program<br /><br /> oCust := TDataBase():Open( , cPath + 'CUSTOMER' )<br /> if oCust:Used()<br /> oStates := TDataBase():Open( , cPath + 'STATES' )<br /> if oStates:Used()<br /> oStates:SetOrder( 'CODE' )<br /> oStates:lBuffer := .f. // IMPORTANT FOR CHILD<br /><br /> oCust:SetRelation( oStates, 'STATE' ) // STATE is field name in CUSTOMER.DBF<br /> oCust:GoTop()<br /><br /> DEFINE DIALOG oDlg SIZE 640,440 PIXEL<br /> @ 10,10 XBROWSE oBrw SIZE 300,200 PIXEL OF oDlg ;<br /> COLUMNS 'City','State' ;<br /> FIELDS oStates:Code, oStates:Name ;<br /> HEADERS nil,nil,'Code','StateName' ;<br /> OBJECT oCust ;<br /> CELL LINES NOBORDER<br /><br /> oBrw:CreateFromCode()<br /> ACTIVATE DIALOG oDlg CENTERED<br /><br /> oStates:Close()<br /> else<br /> MsgInfo( 'Error Opening States.dbf' )<br /> endif<br /> oCust:Close()<br /> else<br /> MsgInfo( 'Error Opening Customer.dbf' )<br /> endif<br /><br />return ( 0 )<br /><span style="color: #000000;">\</span><br />static function ReBuildIndex()<br /><br /> FIELD CODE<br /><br /> if File( cPath + 'STATES.CDX' )<br /> FErase( cPath + 'STATES.CDX' )<br /> endif<br /><br /> USE ( cPath + 'STATES' ) NEW EXCLUSIVE<br /> INDEX ON CODE TAG CODE<br /> CLOSE DATA<br /><br />return nil<br /></span></div>[/code:e5ucfzzu]
Important: oChild:lBuffer := .f. // necessary
|
tDatabase
|
Colin,
Both of those are wise moves.
I've used tData for years. I also was using tsBrowse but moved to xBrowse this year throughout the application. It works well with tData objects, but you also need to use tRecord.
I've spent many months going through my whole application and the results have been quite pleasing.
I'm not sure why you are using child databases but you might also consider loading a subset of data into an array. For example, I use a double browse on a dialog. One shows accounts, and the other shows transactions. The subset of transactions are actually loaded into an array for easier manipulation. I see no performance delay at all. Also, with ADS I was using filters which can perform well, but moved to scopes (at James suggestion ) and its faster and more stable.
Tim
|
tDatabase
|
Hi Tim
What does tRecord do ?
I am adding, editing and deleting records in xbrowse with the
standard database class in Fivewin and everthing is working ok.
Cheers
Colin
|
tDatabase
|
Colin,
The problem occurs when you edit a record in a browse with a dialog. Whenever the browse is repainted (as when the user switches to another application and back during a dialog edit) the buffer is reloaded. In order to repaint the window the entire browse is re-read from disk and redisplayed. This reloads the buffer for each visible record as it is repainted including the one being edited. Also, the data that has already been changed on the screen in the dialog remains displayed as changed, but the buffer contains the original data. I have also seen cases where the data was saved into the wrong record after a repaint, but I never figured out what the cause of this was (I did figure out a way to prevent it though--see below).
TRecord acts a second buffer and the data is not changed by a browse repaint. TRecord also has other nice features since it will automatically find its own record in the database to save the data into, or if it is a new record without a recno, then it will append a new record then save itself.
Regards,
James
|
tDatabase
|
Hi James
When you say edit in a dialog does that mean you open a separate dialog with the fields of one record
make changes/add data and then close the dialog and refresh the browse.
I do all my editing in each cell of the browse and have not noticed any effects like you have
mentioned.
Cheers
Colin
|
tDatabase
|
Colin,
>When you say edit in a dialog does that mean you open a separate dialog with the fields of one record make changes/add data and then close the dialog and refresh the browse.
Yes.
>I do all my editing in each cell of the browse and have not noticed any effects like you have
mentioned.
I believe it still can happen but only with one field (cell). Each time you leave a cell the data is saved so you would only loose the edit for the current cell.
The downside of this edit approach, is that the user cannot cancel a record edit (only a cell edit). It is a Windows standard design to use dialogs for edits and provide Ok and Cancel terminating buttons. This is what the users are used to and expecting.
Also, unless there are very few fields, you cannot see all the fields at one time as when in a dialog. It is not possible to use Tabs and/or groups to organize the data. With some browses you cannot use checkboxes, comboboxes, spinners, etc.
I very rarely edit directly in a browse and usually only when the user is entering new data with just a few fields.
Regards,
James
|
tDatabase
|
[quote="James Bott":3gri78kn]Colin,
The problem occurs when you edit a record in a browse with a dialog. Whenever the browse is repainted (as when the user switches to another application and back during a dialog edit) the buffer is reloaded. In order to repaint the window the entire browse is re-read from disk and redisplayed. This reloads the buffer for each visible record as it is repainted including the one being edited. Also, the data that has already been changed on the screen in the dialog remains displayed as changed, but the buffer contains the original data. I have also seen cases where the data was saved into the wrong record after a repaint, but I never figured out what the cause of this was (I did figure out a way to prevent it though--see below).
TRecord acts a second buffer and the data is not changed by a browse repaint. TRecord also has other nice features since it will automatically find its own record in the database to save the data into, or if it is a new record without a recno, then it will append a new record then save itself.
Regards,
James[/quote:3gri78kn]
This is really a very serious problem. This appears to be least known and least taken care of. It may happen rarely, but when it happens, it spoils the data and the user may not even know. Mr. James Bott recognized this long time back and provided tRecord class. Programs browsing data with TData class should always offer pop-up edits using TRecord class.
But this problem is not only with TData or TDatabase, but with all data sources, be it RDD, ADO or any kind of data source, with XBrowse or any other browse.
While using TRecord is a good solution when browsing TData, we need a generic solution for browsing any kind of data.
Fivewin does not provide TRecord like facility for its TDatabase class, but provides a more generic solution in XBrowse.
[b:3gri78kn]oBrw:CurrentRow()[/b:3gri78kn]
oBrw:CurrentRow() returns a Row object which can be used for pop-up edits. This works whether the data being browsed is TData, TDatabase, RDD, ADO or any other data source. The values of remain static even when the main browse is navigated for any reasons. This object also provides methods to save and undo.
Here is a sample using the oBrw:CurrentRow() object to use in pop-up edits. (\fwh\samples\XbRowEd.Prg in FWH 10.2). The pop-up edit is provided in a non-modal dialog, so that we can test it by navigating the browse while edit is in progress.
[code=fw:3gri78kn]<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> <span style="color: #B900B9;">// in \fwh\include folder</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'ord.ch'</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'xbrowse.ch'</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oBrw, oDlg, uData<br /> <span style="color: #00C800;">local</span> oFont<br /><br /> SET EXCLUSIVE OFF<br /> SET DELETED <span style="color: #0000ff;">ON</span><br /> SET OPTIMIZE <span style="color: #0000ff;">ON</span><br /><br /> SetGetColorFocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> uData := OpenData<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">'TAHOMA'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">640</span>,<span style="color: #000000;">460</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">'XBrowse Row Edit'</span> ;<br /> <span style="color: #0000ff;">FONT</span> oFont<br /><br /> @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> COLUMNS <span style="color: #ff0000;">'First'</span>, <span style="color: #ff0000;">'City'</span>, <span style="color: #ff0000;">'Age'</span>, <span style="color: #ff0000;">'Salary'</span> ;<br /> PICTURES <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">'999'</span>, <span style="color: #ff0000;">'99,999,999.99'</span> ;<br /> OBJECT uData ;<br /> AUTOSORT CELL LINES NOBORDER ;<br /> <span style="color: #0000ff;">ON</span> DBLCLICK RowEdit<span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">CurrentRow</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> WITH OBJECT oBrw<br /> :<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /> @ <span style="color: #000000;">210</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">'Edit'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">14</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> RowEdit<span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">CurrentRow</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">210</span>,<span style="color: #000000;">270</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">'Close'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">14</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</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;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /> CloseData<span style="color: #000000;">(</span> uData <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> RowEdit<span style="color: #000000;">(</span> oRow <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oDlg<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">'Edit Customer'</span> ;<br /> <span style="color: #0000ff;">FONT</span> oRow:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oFont</span><br /><br /> @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">'First'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">RIGHT</span><br /> @ <span style="color: #000000;">10</span>, <span style="color: #000000;">60</span> <span style="color: #0000ff;">GET</span> oRow:<span style="color: #000000;">First</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, .t. <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">25</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">'City'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">RIGHT</span><br /> @ <span style="color: #000000;">25</span>, <span style="color: #000000;">60</span> <span style="color: #0000ff;">GET</span> oRow:<span style="color: #000000;">City</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, .t. <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">40</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">'Age'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">RIGHT</span><br /> @ <span style="color: #000000;">40</span>, <span style="color: #000000;">60</span> <span style="color: #0000ff;">GET</span> oRow:<span style="color: #000000;">Age</span> ;<br /> <span style="color: #0000ff;">SIZE</span> oRow:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">Age</span>:<span style="color: #000000;">nWidth</span> / <span style="color: #000000;">2</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">PICTURE</span> oRow:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">Age</span>:<span style="color: #000000;">cEditPicture</span> <span style="color: #0000ff;">RIGHT</span> ;<br /> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, .t. <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">55</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">'Salary'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">RIGHT</span><br /> @ <span style="color: #000000;">55</span>, <span style="color: #000000;">60</span> <span style="color: #0000ff;">GET</span> oRow:<span style="color: #000000;">Salary</span> ;<br /> <span style="color: #0000ff;">SIZE</span> oRow:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">Salary</span>:<span style="color: #000000;">nWidth</span> / <span style="color: #000000;">2</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">PICTURE</span> oRow:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">Salary</span>:<span style="color: #000000;">cEditPicture</span> <span style="color: #0000ff;">RIGHT</span> ;<br /> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, .t. <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">80</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">'Undo'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">WHEN</span> oRow:<span style="color: #000000;">Modified</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oRow:<span style="color: #000000;">Undo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">80</span>, <span style="color: #000000;">78</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">'Save'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">WHEN</span> oRow:<span style="color: #000000;">Modified</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oRow:<span style="color: #000000;">Save</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oDlg:<span style="color: #000000;">aEvalWhen</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">80</span>,<span style="color: #000000;">110</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">'Close'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> NOMODAL<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">// ---- DATA OPEN AND CLOSE FUNCTIONS ---- //</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> OpenData<br /><br /> <span style="color: #00C800;">local</span> uData, nDataType<br /><br /> nDataType := <span style="color: #0000ff;">Max</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, Alert<span style="color: #000000;">(</span> <span style="color: #ff0000;">'DataType'</span>, <span style="color: #000000;">{</span> <span style="color: #ff0000;">'DBFCDX'</span>, <span style="color: #ff0000;">'TDataBase'</span>, <span style="color: #ff0000;">'ADO'</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> nDataType > <span style="color: #000000;">2</span><br /> uData := OpenADO<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> USE CUSTOMER <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> CUST SHARED VIA <span style="color: #ff0000;">'DBFCDX'</span><br /> DATABASE uData<br /><br /> <span style="color: #00C800;">if</span> nDataType == <span style="color: #000000;">1</span><br /> uData := <span style="color: #ff0000;">'CUST'</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> uData<br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> OpenADO<br /><br /> <span style="color: #00C800;">local</span> oCn, oRs, cPath := CURDRIVE<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">':'</span> + Chr<span style="color: #000000;">(</span><span style="color: #000000;">92</span><span style="color: #000000;">)</span> + CURDIR<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oCn := TOleAuto<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'ADODB.Connection'</span> <span style="color: #000000;">)</span><br /> WITH OBJECT oCn<br /> :<span style="color: #000000;">ConnectionString</span> := <span style="color: #ff0000;">'Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq='</span> + cPath<br /> :<span style="color: #000000;">CursorLocation</span> := adUseClient<br /> :<span style="color: #000000;">Open</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /> oRs := TOleAuto<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'ADODB.RecordSet'</span> <span style="color: #000000;">)</span><br /> WITH OBJECT oRs<br /> :<span style="color: #000000;">ActiveConnection</span> := oCn<br /> :<span style="color: #000000;">Source</span> := <span style="color: #ff0000;">'CUSTOMER'</span><br /> :<span style="color: #000000;">LockType</span> := adLockOptimistic<br /> :<span style="color: #000000;">Open</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /><span style="color: #00C800;">return</span> oRs<br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> CloseData<span style="color: #000000;">(</span> uData <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oCn<br /><br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> uData <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'O'</span><br /> <span style="color: #00C800;">if</span> Upper<span style="color: #000000;">(</span> uData:<span style="color: #000000;">ClassName</span> <span style="color: #000000;">)</span> = <span style="color: #ff0000;">'TOLEAUTO'</span><br /> oCn := uData:<span style="color: #000000;">ActiveConnection</span><br /> uData:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCn:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> uData:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> CLOSE <span style="color: #00C800;">DATA</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:3gri78kn]
[url=http://img188.imageshack.us/my.php?image=xbrowed.jpg:3gri78kn][img:3gri78kn]http://img188.imageshack.us/img188/2135/xbrowed.jpg[/img:3gri78kn][/url:3gri78kn]
Independent of the edit in the dialog, the browse can be navigated but the data will be saved in the correct record when the saved.
In this example the user can choose either RDD, TDatabase or ADO. In all cases the program works identically.
This example also demonstrates how both xbrowse and CurrentRow() objects can be coded without the knowledge of where the data is read from or written to. XBrowse automatically recognizes the data source and builds codeblocks to handle the data appropriately including locking and unlocking. This way of coding can be useful to write generic interface which can be plugged to different kinds of data sources.
The default save method works well normally in many cases. But we can also customize the save behavior by assigning our own codeblock to oRow:bSave. We can see other data and methods in the static class TXbrRow in the xbrowse.prg.
In quite a few cases, we offer only some selected columns in the browse but we need to edit more columns in the edit dialog. In such cases, we can add all the columns to be edited to xbrowse and hide them with oCol:lHide := .t.. Row object will contain all columns to be edited, though the browse shows only the columns that are not hidden.
Though this method was available in XBrowse for quite long, it had a few minor bugs prior to version 10.2 and also this feature and its benefits were little known. With the following 3 bug fixes, this features works perfectly in all previous versions also.
In [b:3gri78kn]METHOD Save() CLASS TXBrRow[/b:3gri78kn]:
1. Replace the old code
[code=fw:3gri78kn]<div class="fw" id="{CB}" style="font-family: monospace;"> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">bBookMark</span> <span style="color: #000000;">)</span></div>[/code:3gri78kn]
with this correct code
[code=fw:3gri78kn]<div class="fw" id="{CB}" style="font-family: monospace;"> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">bBookMark</span>, ::<span style="color: #000000;">nRecNo</span> <span style="color: #000000;">)</span></div>[/code:3gri78kn]
2. Replace the old code
[code=fw:3gri78kn]<div class="fw" id="{CB}" style="font-family: monospace;"> oCol := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oCol</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">Headers</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span></div>[/code:3gri78kn]
with this correct code
[code=fw:3gri78kn]<div class="fw" id="{CB}" style="font-family: monospace;"> oCol := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oCol</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">aHeaders</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span></div>[/code:3gri78kn]
3. and Insert one line as indicated
[code=fw:3gri78kn]<div class="fw" id="{CB}" style="font-family: monospace;"> lSaved := .t.<br /> ACopy<span style="color: #000000;">(</span> ::<span style="color: #000000;">aValues</span>, ::<span style="color: #000000;">aOriginals</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Insert this line. This line was not in previous versions</span><br /> <span style="color: #00C800;">endif</span><br /> </div>[/code:3gri78kn]
|
tDatabase
|
Rao,
Thanks for all the info and a good solution.
One advantge to using a record class is that you can subclass it and add methods to better emulate a real-word object. For instance adding an Age() method which automatically calculates the age based on the date-of-birth and the current date. Or adding an AcceptPayment() method to a customer record which might post data into multiple databases like an invoice database, a general ledger database, and an audit database in addition to updating the customer file.
And you can also use such a class when you are not using a browse.
James
|
tDatabase
|
[quote="James Bott":h5uwbffp]Rao,
Thanks for all the info and a good solution.
One advantge to using a record class is that you can subclass it and add methods to better emulate a real-word object. For instance adding an Age() method which automatically calculates the age based on the date-of-birth and the current date. Or adding an AcceptPayment() method to a customer record which might post data into multiple databases like an invoice database, a general ledger database, and an audit database in addition to updating the customer file.
And you can also use such a class when you are not using a browse.
James[/quote:h5uwbffp]
Yes Mr. James. I do agree with you. My intention was not to understate the merits of TRecord class, but to explain the use of a less known but very useful method of XBrowse.
|
tDatabase
|
Hi Antonio
I tried to compile database program and get the following
database.o:(.data+0x8a8): undefined reference to `HB_FUN_NUMPICT'
database.o:(.data+0x9b8): undefined reference to `HB_FUN_ANSITOOEM'
database.o:(.data+0xb08): undefined reference to `HB_FUN_OEMTOANSI'
database.o:(.data+0xeb8): undefined reference to `HB_FUN_XBROWSE'
database.o:(.data+0xf18): undefined reference to `HB_FUN_TXBROWS'
database.o:(.data+0x1058): undefined reference to `HB_FUN_EXCELOBJ'
Cheers
Colin
|
tDatabase
|
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?p=139924#p139924">viewtopic.php?p=139924#p139924</a><!-- l -->
|
tDatabase
|
There is a new FiveLinux build available from:
[url:ub7pgr66]http://code.google.com/p/fivelinux/downloads/detail?name=fivelinux_20130213.zip&can=2&q=[/url:ub7pgr66]
|
tDatabase- AdsSetAof()-RESUELTO
|
Hola amigos.
Existe la posibilidad de agregar AdsSetAof() a tDatabase?
Gracias.
Ruben Dario Fernandez.
Mi hijo lo relvió
En tData debe incluirse
#include "ads.ch
method setAOF(cFilter) inline (::cAlias)->(AdsSetAOF(cFilter))
method clearAOF inline (::cAlias)->(AdsClearAOF())
Gracias. Saludos
Ruben Dario Fernández
|
tDatabase- AdsSetAof()-RESUELTO
|
Ruben,
Adding ADS functions to TDatabase is not the best way to handle this.
OOP principles are that you should create a separate class to handle a separate database type. Thus you could have an array class that works using the same methods as a DBF database class. You can then plug in either class to a program without making any changes to program code. Similarly you could have a CSV class, an XML, or an SQL class, that also use the same methods.
What you don't want to do is to try to combine them all into the same class with a lot of IF/THEN and DO/CASEs. Then you are just falling back to procedural code and this gets very complex, messy to work on, and prone to errors. Further, whenever you try to add or fix something you risk breaking more than just the database type that you are working on. Thus, you would be forced to have complex test routines that tested all of the different data sources whenever you made the smallest change to the class code--or otherwise you risk all kinds of errors.
In the case of ADS, it already uses a lot of the same code that DBFs use, but it adds a number of features that standard DBF code does not have. Therefore, for this situation, the best approach is to subclass from TDatabase and make a new class for ADS. In the new TADS class you can add all the functions that are unique to TADS as methods. This way you do not risk breaking any of the DBF class code, and you do not have to recreate it in the new class.
For an array class, subclassing TDatabase would not be possible since arrays don't use any of the same database syntax and/or functions. So an array class would need to be written from scratch. It would contain the same methods as TDatabase but they would act on an array.
I hope that was clear, if not let me know.
Regards,
James
|
tDatabase- AdsSetAof()-RESUELTO
|
Thank you James. Very clear.
Regards
Ruben Dario Fernández
|
tDatepick : error in 12.02
|
Hello,
Updating from fwh 8.10 to fwh 12.02 gives a error in tDtepick
Error description: Error BASE/1004 Class: 'NIL' has no exported method: EVAL
Args:
[ 1] = U
[ 2] = O TDATEPICK
Stack Calls
===========
Called from: => EVAL( 0 )
Called from: .\source\classes\TDTPICKE.PRG => (b)TDATEPICK:NEW( 94 )
The offending line in tDtepick.prg :
::bValid = { || If( ::lClosed, Eval( bValid, Self ), .F. ) }
In 8.10 : ::bValid = bValid
In the dialog i have no valid clausule :
@ 10,10 DTPICKER oGet[1] VAR Van OF oDlg PIXEL SIZE 45,10
It seems that the ::bValid is executed with ::lClosed=.T. (set in method Notify ?) , bValid is nil
Changing as :
# ifdef FRANKDEMONT
::bValid = { || If(::lClosed, IIF( Valtype(bValid)=="B" , Eval( bValid, Self ) , .T.) , .F. ) }
# else
::bValid = { || If( ::lClosed, Eval( bValid, Self ), .F. ) }
# endif
Seems to work
Frank
Frank
|
tDatepick : error in 12.02
|
Frank,
Yes, we recently detected that bug in FWH 12.02 and we commented it here in the forums and proposed a similar solution like yours <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?p=126788#p126788">viewtopic.php?p=126788#p126788</a><!-- l -->
|
tDatepick : error in 12.02
|
Thank you.
Will you publish a revised build?.
|
tDatepick : error in 12.02
|
Eduardo,
Not yet, unless other bugs arise
|
tDolphin ::Refresh() no funciona
|
Hola Daniel...
cuando se usa Refresh() el método no halla la tabla correspondiente:
oDatos := oCon:Execute("Select * from productos.articulos")
..
..
..
oDatos:Refresh() // <- aquí indica que ho existe productos.articulos
Salu2
|
tDolphin ::Refresh() no funciona
|
El método Execute solo devuelve si se ha ejecutado correctamente (.t. o .f.).
|
tDolphin ::Refresh() no funciona
|
el método execute, no es para eso,
oDatos := oCon:Query("Select * from productos.articulos")
oDatos:refresh()
|
tDolphin ::Refresh() no funciona
|
Lo siento, error mio...
oDatos := oCon:Query("Select * from productos.articulos")
..
..
..
oDatos:Refresh() <-el error es aquí, indica euq no existe productos.articulos
|
tDolphin ::Refresh() no funciona
|
Mr.
No conozco TDolphin pero razonándolo me parece que el error
puede estar en el punto(.), no?
Con MySql el punto se utiliza para separar la DATABASE del campo o columna
cuando el nombre del campo es igual en más de una DATABASE y tal vez
lo que tu deseas es abrir dos tablas (Productos y Articulos) entonces podría
ser
[code=fw:3826c5mt]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oDatos := oCon:<span style="color: #000000;">Query</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Select * from productos , articulos"</span><span style="color: #000000;">)</span><br /> </div>[/code:3826c5mt]
Solo una idea
Saludos
|
tDolphin ::Refresh() no funciona
|
Willi:
No se cual es tu intención con el :Refresh(); pero yo, luego de hacer un Query, no necesito del refresh
[code=fw:9utotivd]<div class="fw" id="{CB}" style="font-family: monospace;"> oQry:= oSrv:<span style="color: #000000;">Query</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"SELECT desc_div FROM divisiones ORDER BY id_div"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// Dialogo</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> soDlg1 <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"dlg_Browse"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Divisiones"</span><br /> soDlg1:<span style="color: #000000;">lHelpIcon</span>:= <span style="color: #00C800;">FALSE</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw OBJECT oQry <span style="color: #0000ff;">ID</span> <span style="color: #000000;">500</span> ;<br /> <span style="color: #0000ff;">AUTOCOLS</span> AUTOSORT HEADERS <span style="color: #ff0000;">"Divisiones"</span> <span style="color: #B900B9;">// El browse se muestra correctamente</span><br /> ...<br /> ...<br /> </div>[/code:9utotivd]
Para saber si existes datos a mostrar, si fuera el caso de no querer mostrar el browse vacio, lo que hago es primero consultar con un Count()
|
tDolphin ::Refresh() no funciona
|
El refresh deberia ser en el Xbrowse para que actualice la data, en el query creo como dice el colega, no es necesario, a menos que hagas algo directamente a la tabla de donde hicistes el query, entonces el refresh si lo uso para que actualice la consulta y luego el xbrowse si es el caso, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
|
tDolphin ::Refresh() no funciona
|
hola.
a mi me pasa esto a ver si pueden guiarme.
hago una consulta por el campo fecha,
y relleno un xbrowse,
luego un boton que hace la misma consulta pero con una fecha diferente.
hago un refresh() del xbrowse y los datos siguen quedando los viejos,
si la consulta devuelve datos si lo muestra, pero si no existen datos quedan los viejos.
porque?
gracias.
|
tDolphin ::Refresh() no funciona
|
las consultas las hago de esa forma willyy
[code=fw:3djth4mw]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">local</span> oQry<br /><br /><span style="color: #0000ff;">define</span> query oQry <span style="color: #ff0000;">"SELECT * FROM tbdatos.clientes"</span><br /> </div>[/code:3djth4mw]
|
tDolphin ::Refresh() no funciona
|
Hola sr.
prueba con :
oQuery:LoadQuery()
|
tDolphin ::Refresh() no funciona
|
negativo!
Cuando la consulta es simple:
[code=fw:e3ay699k]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">select</span> * <span style="color: #0000ff;">from</span> tbclientes<span style="color: #ff0000;">"</span></div>[/code:e3ay699k]
la cosa funciona de diez.
Ahora esto:
[code=fw:e3ay699k]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #0000ff;">DEFINE</span> query ::<span style="color: #000000;">oQry</span> <span style="color: #ff0000;">"select "</span> +;<br /> <span style="color: #ff0000;">"tbfacturas.fecha as c1, "</span> +;<br /> <span style="color: #ff0000;">"tbfacturados.descripcion as c2, "</span> +;<br /> <span style="color: #ff0000;">"tbfacturados.cantidad as c3, "</span> +;<br /> <span style="color: #ff0000;">"tbfacturados.precio as c4, "</span> +;<br /> <span style="color: #ff0000;">"tbfacturados.idfactura c5 "</span>+;<br /> <span style="color: #ff0000;">"from "</span> +;<br /> <span style="color: #ff0000;">"tbfacturas "</span> +;<br /> <span style="color: #ff0000;">"left join tbfacturados "</span> +;<br /> <span style="color: #ff0000;">"on tbfacturas.id = tbfacturados.idfactura "</span> +;<br /> <span style="color: #ff0000;">"where tbfacturas.fecha = "</span> + ClipValue2SQL<span style="color: #000000;">(</span>vGets<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>+;<br /> <span style="color: #ff0000;">" order by tbfacturados.descripcion"</span></div>[/code:e3ay699k]
No anda. o sea hago la consulta y cuando "refresco" el xbrowse no aparece el resultado de la nueva consulta, y otra coosa que cuando aparecen (en el primer caso que es simple) las columnas cuando haces click "NO SE ORDENAN" a no ser que, luego de hacerle click a la columna que queres que se ordene, muevas el mouse "fuera del listbox que es el que utilizo para el xbrowse".
|
tDolphin ::Refresh() no funciona
|
Gus;
meto la cuchara en la parte de establecer Orden.
Si en la declaración del xBrowse agregas AUTOSORT, te aparecerá ordenado por la columna que indique el índice asociado y mostrará el triángulo sobre el header correspondiente.
|
tDolphin ::Refresh() no funciona
|
Asi es Mario,
Pero al momento de hacerle click a la columna 2, muuestra el triangulito pero no muestra ordenada la columna HASTA QUE sacas el mouse del mismo xbrowse o presionas tab y pasas el foco a otro control.
Con el solo hecho de sacar el mouse desde arriba del xbrowse ahi se entera que tiene que mostrar denuevo los datos y si! muestra esa columna 2 ordenada.
Gracias.
|
tDolphin ::Refresh() no funciona
|
mmmm... si me esta pasando con un xBrowse y datos de una DBF
Mañana me fijo, creo que tengo un codigo que forzaba el orden haciendo clic en la columna
|
tDolphin ::Refresh() no funciona
|
Hola amigos, :refresh() y :loadquery()en Doplhin, solo funciona con setencias simples..., cuando en la sentencia hay m,as de una tabla involucrada, no va... pero hay solución
[code=fw:1tmelcei]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cDatos := <span style="color: #ff0000;">"select "</span> +;<br /> <span style="color: #ff0000;">"tbfacturas.fecha as c1, "</span> +;<br /> <span style="color: #ff0000;">"tbfacturados.descripcion as c2, "</span> +;<br /> <span style="color: #ff0000;">"tbfacturados.cantidad as c3, "</span> +;<br /> <span style="color: #ff0000;">"tbfacturados.precio as c4, "</span> +;<br /> <span style="color: #ff0000;">"tbfacturados.idfactura c5 "</span>+;<br /> <span style="color: #ff0000;">"from "</span> +;<br /> <span style="color: #ff0000;">"tbfacturas "</span> +;<br /> <span style="color: #ff0000;">"left join tbfacturados "</span> +;<br /> <span style="color: #ff0000;">"on tbfacturas.id = tbfacturados.idfactura "</span> +;<br /> <span style="color: #ff0000;">"where tbfacturas.fecha = "</span> + ClipValue2SQL<span style="color: #000000;">(</span>vGets<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>+;<br /> <span style="color: #ff0000;">" order by tbfacturados.descripcion"</span><br /><br />eDatos := <span style="color: #000000;">{</span>|| query := ::<span style="color: #000000;">Query</span><span style="color: #000000;">(</span>cDatos<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /><br />EVAL<span style="color: #000000;">(</span>eDatos<span style="color: #000000;">)</span> <span style="color: #B900B9;">// evaluas la sentencia cuando lo requieras, que al final es lo mismo que el ::refresh()</span><br />...<br />...<br /><br /><br /> </div>[/code:1tmelcei]
|
tDolphin ::Refresh() no funciona
|
[quote="goosfancito":3tqeqqx7]Asi es Mario,
Pero al momento de hacerle click a la columna 2, muuestra el triangulito pero no muestra ordenada la columna HASTA QUE sacas el mouse del mismo xbrowse o presionas tab y pasas el foco a otro control.
Con el solo hecho de sacar el mouse desde arriba del xbrowse ahi se entera que tiene que mostrar denuevo los datos y si! muestra esa columna 2 ordenada.
Gracias.[/quote:3tqeqqx7]
A ver si ayuda
[code=fw:3tqeqqx7]<div class="fw" id="{CB}" style="font-family: monospace;"> WITH OBJECT oCol1<br /> :<span style="color: #000000;">cHeader</span>:= <span style="color: #ff0000;">"Código"</span><br /> :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">60</span><br /> :<span style="color: #000000;">oHeaderFont</span>:= ::<span style="color: #000000;">hFont</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"SysFontB"</span><span style="color: #000000;">]</span><br /><br /> :<span style="color: #000000;">bStrData</span>:= <span style="color: #000000;">{</span>|| StrZero<span style="color: #000000;">(</span> ::<span style="color: #000000;">oQryIns</span>:<span style="color: #000000;">FieldGet</span><span style="color: #000000;">(</span> F_CodIns <span style="color: #000000;">)</span>,<span style="color: #000000;">7</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> :<span style="color: #000000;">bLClickHeader</span>:= <span style="color: #000000;">{</span>|| ::<span style="color: #000000;">SetColOrden</span><span style="color: #000000;">(</span> col_CodIns <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// En cada columna que quiero cambiar el order, llamo a la funcion</span><br /> END<br />...<br /><br />PROCEDURE SetColOrden<span style="color: #000000;">(</span> nCol, lLike, lOrden <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMantenimiento<br /><br /> <span style="color: #00C800;">DEFAULT</span> lLike := <span style="color: #00C800;">FALSE</span>, ;<br /> lOrden:= <span style="color: #00C800;">TRUE</span><br /><br /> ::<span style="color: #000000;">oQryIns</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"SELECT T1.CodInsumo, T1.DescIns, T2.StkActU, T3.Existencia, T4.Cantidad, T1.IDInsumo "</span> + ;<br /> <span style="color: #ff0000;">"FROM "</span> +::<span style="color: #000000;">aTablas</span><span style="color: #000000;">[</span>_TBINSUMOS<span style="color: #000000;">]</span> +<span style="color: #ff0000;">" AS T1, "</span> +::<span style="color: #000000;">aTablas</span><span style="color: #000000;">[</span>_TBSTOCK1<span style="color: #000000;">]</span> +<span style="color: #ff0000;">" AS T2, "</span> + ;<br /> ::<span style="color: #000000;">aTablas</span><span style="color: #000000;">[</span>_TBSTOCK2<span style="color: #000000;">]</span> +<span style="color: #ff0000;">" AS T3, "</span> +::<span style="color: #000000;">aTablas</span><span style="color: #000000;">[</span>_TBSALI2S1<span style="color: #000000;">]</span>+<span style="color: #ff0000;">" AS T4 "</span> + ;<br /> <span style="color: #ff0000;">"WHERE T1.IDInsumo = T2.IDInsumo and T1.IDInsumo = T3.IDInsumo and T1.IDInsumo = T4.IDInsumo "</span> + ;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lLike, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !IsDigit<span style="color: #000000;">(</span>hS1:<span style="color: #000000;">cLike</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"and T1.DescIns REGEXP '"</span>+hS1:<span style="color: #000000;">cLike</span>+<span style="color: #ff0000;">"' "</span>,<span style="color: #ff0000;">"and T1.CodInsumo LIKE '"</span>+hS1:<span style="color: #000000;">cLike</span>+<span style="color: #ff0000;">"%' "</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span> + ;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lOrden, ;<br /> <span style="color: #ff0000;">" ORDER BY "</span>+ <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> nCol== <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"T1.CodInsumo"</span>, ; <span style="color: #B900B9;">// Acá decide como ordena la consulta</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> nCol== <span style="color: #000000;">2</span>, <span style="color: #ff0000;">"T1.DescIns"</span>, <span style="color: #ff0000;">"T1.CodInsumo"</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> + ;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrwIns</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">" ASC"</span>, ;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrwIns</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>nCol<span style="color: #000000;">]</span>:<span style="color: #000000;">cOrder</span> == <span style="color: #ff0000;">"A"</span>, <span style="color: #ff0000;">" ASC"</span>, <span style="color: #ff0000;">" DESC"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrwIns</span> <span style="color: #000000;">)</span><br /> aEval<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrwIns</span>:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">{</span>|o,n| <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !n == nCol, o:<span style="color: #000000;">cOrder</span>:= <span style="color: #ff0000;">""</span>, <span style="color: #000000;">)</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> n <= col_DescIns, o:<span style="color: #000000;">oHeaderFont</span>:= ::<span style="color: #000000;">oBrwIns</span>:<span style="color: #000000;">oFont</span>, <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> lOrden <span style="color: #B900B9;">// Con esto decimos como se mostrará el ícono ASC/DESC</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oBrwIns</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>nCol<span style="color: #000000;">]</span>:<span style="color: #000000;">cOrder</span> == <span style="color: #ff0000;">"A"</span><br /> ::<span style="color: #000000;">oBrwIns</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>nCol<span style="color: #000000;">]</span>:<span style="color: #000000;">cOrder</span>:= <span style="color: #ff0000;">"D"</span><br /> elseif ::<span style="color: #000000;">oBrwIns</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>nCol<span style="color: #000000;">]</span>:<span style="color: #000000;">cOrder</span> == <span style="color: #ff0000;">"D"</span><br /> ::<span style="color: #000000;">oBrwIns</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>nCol<span style="color: #000000;">]</span>:<span style="color: #000000;">cOrder</span>:= <span style="color: #ff0000;">"A"</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">oBrwIns</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>nCol<span style="color: #000000;">]</span>:<span style="color: #000000;">cOrder</span>:= <span style="color: #ff0000;">"A"</span><br /> end<br /> end<br /><br /> <span style="color: #B900B9;">// Cosmética</span><br /> ::<span style="color: #000000;">oBrwIns</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>nCol<span style="color: #000000;">]</span>:<span style="color: #000000;">oHeaderFont</span>:= ::<span style="color: #000000;">hFont</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"SysFontB"</span><span style="color: #000000;">]</span><br /> ::<span style="color: #000000;">oBrwIns</span>:<span style="color: #000000;">bClrHeader</span> := <span style="color: #000000;">{</span>|| <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrwIns</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>nCol<span style="color: #000000;">]</span>:<span style="color: #000000;">cOrder</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">{</span> CLR_BLACK, GetSysColor<span style="color: #000000;">(</span> COLOR_BTNFACE <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> CLR_GREEN, GetSysColor<span style="color: #000000;">(</span> COLOR_BTNFACE <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> ::<span style="color: #000000;">oBrwIns</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> end<br /><br /><span style="color: #B900B9;">// Fin</span></div>[/code:3tqeqqx7]Importante, no te guies por el codigo MySQL porque no esta hecho con TDolphin (en definitiva lo importante es de xBrowse)
|
tDolphin ::Refresh() no funciona
|
gracias a ambos.
|
tDolphin ::Refresh() no funciona
|
no estoy entendiendo la idea... a ver. esto me sigue sin funcionar
[code=fw:1u86m5o4]<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;">"dtpicker.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"tdolphin.ch"</span><br /><br /><span style="color: #00C800;">CLASS</span> TCaja<br /><br /> <span style="color: #00C800;">DATA</span> oCnx<br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">new</span> <span style="color: #000000;">(</span>oCnx<span style="color: #000000;">)</span> CONSTRUCTOR<br /><span style="color: #00C800;">METHOD</span> browser<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">METHOD</span> cargarBrowser<span style="color: #000000;">(</span>vGets<span style="color: #000000;">)</span><br /><span style="color: #00C800;">METHOD</span> query<span style="color: #000000;">(</span>cQuery<span style="color: #000000;">)</span><br /><br />END <span style="color: #00C800;">CLASS</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">new</span><span style="color: #000000;">(</span>oCnx<span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">oCnx</span>:= oCnx<br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span><span style="color: #00C800;">Self</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">METHOD</span> browser<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oDlg,;<br /> oGets := Array<span style="color: #000000;">(</span><span style="color: #000000;">2</span><span style="color: #000000;">)</span>,;<br /> vGets := Array<span style="color: #000000;">(</span><span style="color: #000000;">2</span><span style="color: #000000;">)</span>,;<br /> oBrw,;<br /> oQry,;<br /> oFont, OFont1<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">""</span> bold <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-11</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont1 <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Ebrima"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-11</span><br /><br /> vGets<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:= CToD<span style="color: #000000;">(</span><span style="color: #ff0000;">"21/11/2014"</span><span style="color: #000000;">)</span><br /><br /> oQry:= ::<span style="color: #000000;">cargarBrowser</span><span style="color: #000000;">(</span>vGets<span style="color: #000000;">)</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;">"DLGCAJA"</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> DTPICKER oGets<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> vGets<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">100</span> <span style="color: #0000ff;">OF</span> oDlg<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> oGets<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> vGets<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span>;<br /> <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Todo"</span>, <span style="color: #ff0000;">"Efectivo"</span>, <span style="color: #ff0000;">"Cta Cte"</span> <span style="color: #000000;">}</span>;<br /> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> <span style="color: #B900B9;">//----------( )----------</span><br /><br /> oBrw:= TXBROWSE<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span>oDlg<span style="color: #000000;">)</span><br /><br /> oBrw:<span style="color: #000000;">setdolphin</span><span style="color: #000000;">(</span>oQry,.T., .T., <span style="color: #000000;">{</span><span style="color: #ff0000;">"c1"</span>, <span style="color: #ff0000;">"c2"</span>, <span style="color: #ff0000;">"c3"</span>, <span style="color: #ff0000;">"c4"</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> WITH OBJECT oBrw<br /> WITH object :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br /> :<span style="color: #000000;">odatafont</span> := oFont<br /> :<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Id"</span><br /> :<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br /> :<span style="color: #000000;">oheaderfont</span> := oFont<br /> :<span style="color: #000000;">oheaderfont</span> := oFont<br /> END with<br /><br /> WITH object :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span><br /> :<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Apellido y Nombres"</span><br /> :<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br /> :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">250</span><br /> :<span style="color: #000000;">oheaderfont</span> := oFont<br /> :<span style="color: #000000;">odatafont</span> := oFont1<br /> END with<br /><br /> WITH object :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span><br /> :<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Domicilio"</span><br /> :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">220</span><br /> :<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br /> :<span style="color: #000000;">oheaderfont</span> := oFont<br /> :<span style="color: #000000;">odatafont</span> := oFont1<br /> END with<br /><br /> WITH object :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span><br /> :<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Teléfono"</span><br /> :<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br /> :<span style="color: #000000;">oheaderfont</span> := oFont<br /> :<span style="color: #000000;">odatafont</span> := oFont1<br /> END with<br /><br /> END WITH<br /><br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:<span style="color: #000000;">setorder</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> AEval<span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">aCols</span>,<span style="color: #000000;">{</span>|o| o:<span style="color: #000000;">bRClickHeader</span> := <span style="color: #000000;">{</span>|| <span style="color: #00C800;">NIL</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /><br /> oBrw:<span style="color: #000000;">createfromresource</span><span style="color: #000000;">(</span><span style="color: #000000;">102</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">//----------( )----------</span><br /><br /> oGets<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bchange</span>:= <span style="color: #000000;">{</span>|| oQry:= ::<span style="color: #000000;">cargarBrowser</span><span style="color: #000000;">(</span>vGets<span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><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: #000000;">(</span><span style="color: #00C800;">NIL</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">METHOD</span> cargarBrowser<span style="color: #000000;">(</span>vGets<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> cDatos, eDatos<br /><br /> cDatos := <span style="color: #ff0000;">"select "</span> +;<br /> <span style="color: #ff0000;">"tbfacturas.fecha as c1, "</span> +;<br /> <span style="color: #ff0000;">"tbfacturados.descripcion as c2, "</span> +;<br /> <span style="color: #ff0000;">"tbfacturados.cantidad as c3, "</span> +;<br /> <span style="color: #ff0000;">"tbfacturados.precio as c4, "</span> +;<br /> <span style="color: #ff0000;">"tbfacturados.idfactura c5 "</span>+;<br /> <span style="color: #ff0000;">"from "</span> +;<br /> <span style="color: #ff0000;">"tbfacturas "</span> +;<br /> <span style="color: #ff0000;">"left join tbfacturados "</span> +;<br /> <span style="color: #ff0000;">"on tbfacturas.id = tbfacturados.idfactura "</span> +;<br /> <span style="color: #ff0000;">"where tbfacturas.fecha = "</span> + ClipValue2SQL<span style="color: #000000;">(</span>vGets<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>+;<br /> <span style="color: #ff0000;">" order by tbfacturados.descripcion"</span><br /><br /> eDatos:= <span style="color: #000000;">{</span> | query | query:= ::<span style="color: #000000;">query</span><span style="color: #000000;">(</span>cDatos<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span>Eval<span style="color: #000000;">(</span>eDatos<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">METHOD</span> query<span style="color: #000000;">(</span>cQuery<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oQry<br /><br /> <span style="color: #0000ff;">DEFINE</span> query oQry cQuery<br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span>oQry<span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><br /> </div>[/code:1u86m5o4]
Asi tal cual el xbrowse me sigue mostrando la primer consulta, o sea, hago el cambio de fecha va trae los datos de la consulta (y los trae, porque los verifique) pero
el xbrowse sigue sin enterarse de que tiene que mostrarlos.
gracias.
|
tDolphin + Progress Bar
|
Amigos del foro, me dirijo a ustedes por que tengo la siguiente duda, además que no se mucho sql.
Tengo que generar una tabla histórica de transacciones, la cual tiene 182 campos, normalmente el archivo plano del cual recibo las transacciones es bastante grande, unos 12500 registros diarios, el cual es almacenado diariamente en una tabla MySQL que contiene los movimientos del mes, obviamente al llegar el termino de cada mes, este se cierra y pasa al histórico, el cual es otra tabla MySQL, la pregunta es, cómo puedo aplicar una progress bar a un Query, puesto que necesito que el usuario pueda ver el progreso del proceso de actualización de la tabla histórica. Trabajo con TDolphin, y me resulta muy lento el proceso de carga aplicando el metodh Save().
Existe alguna fórmula para presentar la progress bar en un Query como INSERT INTO TABLE (field1, field2) VALUES (value1, value2)?
Agradeceré mucho las respuestas.
|
tDolphin + Progress Bar
|
Friend,
no usas el methodo Save , no se recomienda para guardar masivamente registros,
utiliza sentencias mysql vas a mejorar mucho la velocidad,
saludos..
|
tDolphin + Progress Bar
|
Se que el method save es lento, pero que otra cosa puedo usar para hacer visible el progreso de la operación al usuario?
|
tDolphin + Progress Bar
|
Si estas insertanto, de uno en uno,
quizas con una oDlg NOWAIT
e imprimes,
oDlg:say( 10, 10 , "Reg." )
de esta forma lo ve el usuario,
con progres bar, podria ser pero habria que ver el como jeje.
saludos.
|
tDolphin + Progress Bar
|
Si es que recibes las transacciones en un archivo plano (imagino te refieres a un .txt o similar), y suponiendo que cada linea es un query diferente:
deberias abrir el archivo con MemoRead()
cuenta el numero de lineas con MLCOUNT()
Ejecuta linea por linea usando el comando For y MemoLine()
En base a esto refresca el Meter cada 1% por ejemplo...
Para el uso de estos comando ve a:
[url:49zu7tza]http://www.ousob.com/ng/53guide/[/url:49zu7tza]
|
tDolphin + Progress Bar
|
He probado con la siguiente Qry:
[code=fw:7ss5slgl]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> Insert_Record<span style="color: #000000;">(</span>oQM,oQH<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> oQI<br /><span style="color: #00C800;">Local</span> M_Orden_Flete,M_Plaza_Origen,M_Plaza_Destino,M_Ciudad_Origen,M_Ciudad_Destino,M_Peso_GRS,M_Via,M_Tipo_Envio,M_Codigo_Cliente,;<br /> M_Razon_Social,M_Estado_OrdenFlete,M_Estado_Tracking,M_Fec01,M_Fec33,M_Fec18,M_Fec93,M_R93,M_Fec51,M_R51,M_Fec71,M_R71,M_Fec72,;<br /> M_R72,M_Fec73,M_R73,M_Fec75,M_Fec02,M_R02,M_Fec09,M_Fec56,M_Fec03,M_R03,M_Fec10,M_R10,M_Fec76,M_R76,M_Fec04,M_R04,M_R33,;<br /> M_Remitente,M_Domicilio_Remite,M_Destinatario,M_Direccion_Destino,M_Descripcion,M_Valor_Declarado,M_Guia,M_Observaciones,;<br /> M_Receptor,M_Rut_Receptor,M_D_V,M_Peso_Cubi,M_Limite,M_Usu001,M_H001,M_Usu033,M_H033,M_Usu093,M_H093,M_Usu018,M_H018,;<br /> M_Fec019,M_Usu019,M_H019,M_Usu002,M_H002,M_Usu003,M_H003,M_Usu010,M_H010,M_Fec011,M_Fec015,M_Fec020,M_Fec021,M_Fec035,M_Fec037,;<br /> M_Fec038,M_Fec039,M_Fec040,M_Fec041,M_Fec042,M_Fec043,M_Usu056,M_H056,M_Fec059,M_Usu075,M_H075,M_H005,M_Usu005,M_Fec031,;<br /> M_Usu071,M_H071,M_Usu073,M_H073,M_Fec053,M_Fec080,M_H072,M_Usu072,M_H009,M_Usu009,M_Fec058,M_H058,M_Usu058,M_Fec028,M_Fec029,;<br /> M_Fec030,M_Fec036,M_Fec044,M_H044,M_Usu044,M_Fec045,M_H045,M_Usu045,M_Fec047,M_H047,M_Usu047,M_Fec048,M_H048,M_Usu048,M_Fec049,;<br /> M_H049,M_Usu049,M_Fec050,M_H050,M_Usu050,M_H051,M_Usu051,M_Fec052,M_H052,M_Usu052,M_Fec017,M_H017,M_Usu017,M_H076,M_Usu076,;<br /> M_Fec077,M_H077,M_Usu077,M_Fec078,M_H078,M_Usu078,M_H004,M_Usu004,M_Fec006,M_H006,M_Usu006,M_Fec008,M_H008,M_Usu008,M_Fec012,;<br /> M_H012,M_Usu012,M_Fec016,M_H016,M_Usu016,M_Fec022,M_H022,M_Usu022,M_Fec023,M_H023,M_Usu023,M_Fec024,M_H024,M_Usu024,M_Fec026,;<br /> M_H026,M_Usu026,M_Fec027,M_H027,M_Usu027,M_Fec055,M_H055,M_Usu055,M_Fec007,M_H007,M_Usu007,M_Fec013,M_H013,M_Usu013,M_Fec014,;<br /> M_H014,M_Usu014,M_Can_Bul<br /><br />M_Orden_Flete:=oQry:<span style="color: #000000;">Orden_Flete</span><br />M_Plaza_Origen:=oQry:<span style="color: #000000;">Plaza_Origen</span><br />M_Plaza_Destino:=oQry:<span style="color: #000000;">Plaza_Destino</span><br />M_Ciudad_Origen:=oQry:<span style="color: #000000;">Ciudad_Origen</span><br />M_Ciudad_Destino:=oQry:<span style="color: #000000;">Ciudad_Destino</span><br />M_Peso_GRS:=oQry:<span style="color: #000000;">Peso_GRS</span><br />M_Via:=oQry:<span style="color: #000000;">Via</span><br />M_Tipo_Envio:=oQry:<span style="color: #000000;">Tipo_Envio</span><br />M_Codigo_Cliente:=oQry:<span style="color: #000000;">Codigo_Cliente</span><br />M_Razon_Social:=oQry:<span style="color: #000000;">Razon_Social</span><br />M_Estado_OrdenFlete:=oQry:<span style="color: #000000;">Estado_OrdenFlete</span><br />M_Estado_Tracking:=oQry:<span style="color: #000000;">Estado_Tracking</span><br />M_Fec01:=oQry:<span style="color: #000000;">Fec01</span><br />M_Fec33:=oQry:<span style="color: #000000;">Fec33</span><br />M_Fec18:=oQry:<span style="color: #000000;">Fec18</span><br />M_Fec93:=oQry:<span style="color: #000000;">Fec93</span><br />M_R93:=oQry:<span style="color: #000000;">R93</span><br />M_Fec51:=oQry:<span style="color: #000000;">Fec51</span><br />M_R51:=oQry:<span style="color: #000000;">R51</span><br />M_Fec71:=oQry:<span style="color: #000000;">Fec71</span><br />M_R71:=oQry:<span style="color: #000000;">R71</span><br />M_Fec72:=oQry:<span style="color: #000000;">Fec72</span><br />M_R72:=oQry:<span style="color: #000000;">R72</span><br />M_Fec73:=oQry:<span style="color: #000000;">Fec73</span><br />M_R73:=oQry:<span style="color: #000000;">R73</span><br />M_Fec75:=oQry:<span style="color: #000000;">Fec75</span><br />M_Fec02:=oQry:<span style="color: #000000;">Fec02</span><br />M_R02:=oQry:<span style="color: #000000;">R02</span><br />M_Fec09:=oQry:<span style="color: #000000;">Fec09</span><br />M_Fec56:=oQry:<span style="color: #000000;">Fec56</span><br />M_Fec03:=oQry:<span style="color: #000000;">Fec03</span><br />M_R03:=oQry:<span style="color: #000000;">R03</span><br />M_Fec10:=oQry:<span style="color: #000000;">Fec10</span><br />M_R10:=oQry:<span style="color: #000000;">R10</span><br />M_Fec76:=oQry:<span style="color: #000000;">Fec76</span><br />M_R76:=oQry:<span style="color: #000000;">R76</span><br />M_Fec04:=oQry:<span style="color: #000000;">Fec04</span><br />M_R04:=oQry:<span style="color: #000000;">R04</span><br />M_R33:=oQry:<span style="color: #000000;">R33</span><br />M_Remitente:=oQry:<span style="color: #000000;">Remitente</span><br />M_Domicilio_Remite:=oQry:<span style="color: #000000;">Domicilio_Remite</span><br />M_Destinatario:=oQry:<span style="color: #000000;">Destinatario</span><br />M_Direccion_Destino:=oQry:<span style="color: #000000;">Direccion_Destino</span><br />M_Descripcion:=oQry:<span style="color: #000000;">Descripcion</span><br />M_Valor_Declarado:=oQry:<span style="color: #000000;">Valor_Declarado</span><br />M_Guia:=oQry:<span style="color: #000000;">Guia</span><br />M_Observaciones:=oQry:<span style="color: #000000;">Observaciones</span><br />M_Receptor:=oQry:<span style="color: #000000;">Receptor</span><br />M_Rut_Receptor:=oQry:<span style="color: #000000;">Rut_Receptor</span><br />M_D_V:=oQry:<span style="color: #000000;">D_V</span><br />M_Peso_Cubi:=oQry:<span style="color: #000000;">Peso_Cubi</span><br />M_Limite:=oQry:<span style="color: #000000;">Limite</span><br />M_Usu001:=oQry:<span style="color: #000000;">Usu001</span><br />M_H001:=oQry:<span style="color: #000000;">H001</span><br />M_Usu033:=oQry:<span style="color: #000000;">Usu033</span><br />M_H033:=oQry:<span style="color: #000000;">H033</span><br />M_Usu093:=oQry:<span style="color: #000000;">Usu093</span><br />M_H093:=oQry:<span style="color: #000000;">H093</span><br />M_Usu018:=oQry:<span style="color: #000000;">Usu018</span><br />M_H018:=oQry:<span style="color: #000000;">H018</span><br />M_Fec019:=oQry:<span style="color: #000000;">Fec019</span><br />M_Usu019:=oQry:<span style="color: #000000;">Usu019</span><br />M_H019:=oQry:<span style="color: #000000;">H019</span><br />M_Usu002:=oQry:<span style="color: #000000;">Usu002</span><br />M_H002:=oQry:<span style="color: #000000;">H002</span><br />M_Usu003:=oQry:<span style="color: #000000;">Usu003</span><br />M_H003:=oQry:<span style="color: #000000;">H003</span><br />M_Usu010:=oQry:<span style="color: #000000;">Usu010</span><br />M_H010:=oQry:<span style="color: #000000;">H010</span><br />M_Fec011:=oQry:<span style="color: #000000;">Fec011</span><br />M_Fec015:=oQry:<span style="color: #000000;">Fec015</span><br />M_Fec020:=oQry:<span style="color: #000000;">Fec020</span><br />M_Fec021:=oQry:<span style="color: #000000;">Fec021</span><br />M_Fec035:=oQry:<span style="color: #000000;">Fec035</span><br />M_Fec037:=oQry:<span style="color: #000000;">Fec037</span><br />M_Fec038:=oQry:<span style="color: #000000;">Fec038</span><br />M_Fec039:=oQry:<span style="color: #000000;">Fec039</span><br />M_Fec040:=oQry:<span style="color: #000000;">Fec040</span><br />M_Fec041:=oQry:<span style="color: #000000;">Fec041</span><br />M_Fec042:=oQry:<span style="color: #000000;">Fec042</span><br />M_Fec043:=oQry:<span style="color: #000000;">Fec043</span><br />M_Usu056:=oQry:<span style="color: #000000;">Usu056</span><br />M_H056:=oQry:<span style="color: #000000;">H056</span><br />M_Fec059:=oQry:<span style="color: #000000;">Fec059</span><br />M_Usu075:=oQry:<span style="color: #000000;">Usu075</span><br />M_H075:=oQry:<span style="color: #000000;">H075</span><br />M_H005:=oQry:<span style="color: #000000;">H005</span><br />M_Usu005:=oQry:<span style="color: #000000;">Usu005</span><br />M_Fec031:=oQry:<span style="color: #000000;">Fec031</span><br />M_Usu071:=oQry:<span style="color: #000000;">Usu071</span><br />M_H071:=oQry:<span style="color: #000000;">H071</span><br />M_Usu073:=oQry:<span style="color: #000000;">Usu073</span><br />M_H073:=oQry:<span style="color: #000000;">H073</span><br />M_Fec053:=oQry:<span style="color: #000000;">Fec053</span><br />M_Fec080:=oQry:<span style="color: #000000;">Fec080</span><br />M_H072:=oQry:<span style="color: #000000;">H072</span><br />M_Usu072:=oQry:<span style="color: #000000;">Usu072</span><br />M_H009:=oQry:<span style="color: #000000;">H009</span><br />M_Usu009:=oQry:<span style="color: #000000;">Usu009</span><br />M_Fec058:=oQry:<span style="color: #000000;">Fec058</span><br />M_H058:=oQry:<span style="color: #000000;">H058</span><br />M_Usu058:=oQry:<span style="color: #000000;">Usu058</span><br />M_Fec028:=oQry:<span style="color: #000000;">Fec028</span><br />M_Fec029:=oQry:<span style="color: #000000;">Fec029</span><br />M_Fec030:=oQry:<span style="color: #000000;">Fec030</span><br />M_Fec036:=oQry:<span style="color: #000000;">Fec036</span><br />M_Fec044:=oQry:<span style="color: #000000;">Fec044</span><br />M_H044:=oQry:<span style="color: #000000;">H044</span><br />M_Usu044:=oQry:<span style="color: #000000;">Usu044</span><br />M_Fec045:=oQry:<span style="color: #000000;">Fec045</span><br />M_H045:=oQry:<span style="color: #000000;">H045</span><br />M_Usu045:=oQry:<span style="color: #000000;">Usu045</span><br />M_Fec047:=oQry:<span style="color: #000000;">Fec047</span><br />M_H047:=oQry:<span style="color: #000000;">H047</span><br />M_Usu047:=oQry:<span style="color: #000000;">Usu047</span><br />M_Fec048:=oQry:<span style="color: #000000;">Fec048</span><br />M_H048:=oQry:<span style="color: #000000;">H048</span><br />M_Usu048:=oQry:<span style="color: #000000;">Usu048</span><br />M_Fec049:=oQry:<span style="color: #000000;">Fec049</span><br />M_H049:=oQry:<span style="color: #000000;">H049</span><br />M_Usu049:=oQry:<span style="color: #000000;">Usu049</span><br />M_Fec050:=oQry:<span style="color: #000000;">Fec050</span><br />M_H050:=oQry:<span style="color: #000000;">H050</span><br />M_Usu050:=oQry:<span style="color: #000000;">Usu050</span><br />M_H051:=oQry:<span style="color: #000000;">H051</span><br />M_Usu051:=oQry:<span style="color: #000000;">Usu051</span><br />M_Fec052:=oQry:<span style="color: #000000;">Fec052</span><br />M_H052:=oQry:<span style="color: #000000;">H052</span><br />M_Usu052:=oQry:<span style="color: #000000;">Usu052</span><br />M_Fec017:=oQry:<span style="color: #000000;">Fec017</span><br />M_H017:=oQry:<span style="color: #000000;">H017</span><br />M_Usu017:=oQry:<span style="color: #000000;">Usu017</span><br />M_H076:=oQry:<span style="color: #000000;">H076</span><br />M_Usu076:=oQry:<span style="color: #000000;">Usu076</span><br />M_Fec077:=oQry:<span style="color: #000000;">Fec077</span><br />M_H077:=oQry:<span style="color: #000000;">H077</span><br />M_Usu077:=oQry:<span style="color: #000000;">Usu077</span><br />M_Fec078:=oQry:<span style="color: #000000;">Fec078</span><br />M_H078:=oQry:<span style="color: #000000;">H078</span><br />M_Usu078:=oQry:<span style="color: #000000;">Usu078</span><br />M_H004:=oQry:<span style="color: #000000;">H004</span><br />M_Usu004:=oQry:<span style="color: #000000;">Usu004</span><br />M_Fec006:=oQry:<span style="color: #000000;">Fec006</span><br />M_H006:=oQry:<span style="color: #000000;">H006</span><br />M_Usu006:=oQry:<span style="color: #000000;">Usu006</span><br />M_Fec008:=oQry:<span style="color: #000000;">Fec008</span><br />M_H008:=oQry:<span style="color: #000000;">H008</span><br />M_Usu008:=oQry:<span style="color: #000000;">Usu008</span><br />M_Fec012:=oQry:<span style="color: #000000;">Fec012</span><br />M_H012:=oQry:<span style="color: #000000;">H012</span><br />M_Usu012:=oQry:<span style="color: #000000;">Usu012</span><br />M_Fec016:=oQry:<span style="color: #000000;">Fec016</span><br />M_H016:=oQry:<span style="color: #000000;">H016</span><br />M_Usu016:=oQry:<span style="color: #000000;">Usu016</span><br />M_Fec022:=oQry:<span style="color: #000000;">Fec022</span><br />M_H022:=oQry:<span style="color: #000000;">H022</span><br />M_Usu022:=oQry:<span style="color: #000000;">Usu022</span><br />M_Fec023:=oQry:<span style="color: #000000;">Fec023</span><br />M_H023:=oQry:<span style="color: #000000;">H023</span><br />M_Usu023:=oQry:<span style="color: #000000;">Usu023</span><br />M_Fec024:=oQry:<span style="color: #000000;">Fec024</span><br />M_H024:=oQry:<span style="color: #000000;">H024</span><br />M_Usu024:=oQry:<span style="color: #000000;">Usu024</span><br />M_Fec026:=oQry:<span style="color: #000000;">Fec026</span><br />M_H026:=oQry:<span style="color: #000000;">H026</span><br />M_Usu026:=oQry:<span style="color: #000000;">Usu026</span><br />M_Fec027:=oQry:<span style="color: #000000;">Fec027</span><br />M_H027:=oQry:<span style="color: #000000;">H027</span><br />M_Usu027:=oQry:<span style="color: #000000;">Usu027</span><br />M_Fec055:=oQry:<span style="color: #000000;">Fec055</span><br />M_H055:=oQry:<span style="color: #000000;">H055</span><br />M_Usu055:=oQry:<span style="color: #000000;">Usu055</span><br />M_Fec007:=oQry:<span style="color: #000000;">Fec007</span><br />M_H007:=oQry:<span style="color: #000000;">H007</span><br />M_Usu007:=oQry:<span style="color: #000000;">Usu007</span><br />M_Fec013:=oQry:<span style="color: #000000;">Fec013</span><br />M_H013:=oQry:<span style="color: #000000;">H013</span><br />M_Usu013:=oQry:<span style="color: #000000;">Usu013</span><br />M_Fec014:=oQry:<span style="color: #000000;">Fec014</span><br />M_H014:=oQry:<span style="color: #000000;">H014</span><br />M_Usu014:=oQry:<span style="color: #000000;">Usu014</span><br />M_Can_Bul:=oQry:<span style="color: #000000;">Can_Bul</span><br /><br />oQI:=oConected:<span style="color: #000000;">Query</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Insert Into historico (Orden_Flete,Plaza_Origen,Plaza_Destino,Ciudad_Origen,Ciudad_Destino,Peso_GRS,Via,Tipo_Envio,Codigo_Cliente,Razon_Social,Estado_OrdenFlete,Estado_Tracking,Fec01,Fec33,Fec18,Fec93,R93,Fec51,R51,Fec71,R71,Fec72,R72,Fec73,R73,Fec75,Fec02,R02,Fec09,Fec56,Fec03,R03,Fec10,R10,Fec76,R76,Fec04,R04,R33,Remitente,Domicilio_Remite,Destinatario,Direccion_Destino,Descripcion,Valor_Declarado,Guia,Observaciones,Receptor,Rut_Receptor,D_V,Peso_Cubi,Limite,Usu001,H001,Usu033,H033,Usu093,H093,Usu018,H018,Fec019,Usu019,H019,Usu002,H002,Usu003,H003,Usu010,H010,Fec011,Fec015,Fec020,Fec021,Fec035,Fec037,Fec038,Fec039,Fec040,Fec041,Fec042,Fec043,Usu056,H056,Fec059,Usu075,H075,H005,Usu005,Fec031,Usu071,H071,Usu073,H073,Fec053,Fec080,H072,Usu072,H009,Usu009,Fec058,H058,Usu058,Fec028,Fec029,Fec030,Fec036,Fec044,H044,Usu044,Fec045,H045,Usu045,Fec047,H047,Usu047,Fec048,H048,Usu048,Fec049,H049,Usu049,Fec050,H050,Usu050,H051,Usu051,Fec052,H052,Usu052,Fec017,H017,Usu017,H076,Usu076,Fec077,H077,Usu077,Fec078,H078,Usu078,H004,Usu004,Fec006,H006,Usu006,Fec008,H008,Usu008,Fec012,H012,Usu012,Fec016,H016,Usu016,Fec022,H022,Usu022,Fec023,H023,Usu023,Fec024,H024,Usu024,Fec026,H026,Usu026,Fec027,H027,Usu027,Fec055,H055,Usu055,Fec007,H007,Usu007,Fec013,H013,Usu013,Fec014,H014,Usu014,Can_Bul) Values ("</span>+<span style="color: #ff0000;">"'"</span>+M_Orden_Flete+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Plaza_Origen+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Plaza_Destino+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Ciudad_Origen+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Ciudad_Destino+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Peso_GRS+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Via+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Tipo_Envio+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Codigo_Cliente+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Razon_Social+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Estado_OrdenFlete+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Estado_Tracking+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec01+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec33+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec18+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec93+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_R93+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec51+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_R51+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec71+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_R71+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec72+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_R72+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec73+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_R73+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec75+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec02+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_R02+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec09+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec56+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec03+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_R03+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec10+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_R10+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec76+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_R76+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec04+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_R04+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_R33+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Remitente+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Domicilio_Remite+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Destinatario+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Direccion_Destino+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Descripcion+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Valor_Declarado+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Guia+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Observaciones+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Receptor+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Rut_Receptor+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_D_V+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Peso_Cubi+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Limite+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu001+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H001+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu033+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H033+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu093+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H093+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu018+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H018+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec019+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu019+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H019+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu002+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H002+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu003+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H003+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu010+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H010+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec011+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec015+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec020+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec021+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec035+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec037+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec038+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec039+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec040+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec041+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec042+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec043+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu056+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H056+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec059+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu075+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H075+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H005+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu005+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec031+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu071+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H071+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu073+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H073+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec053+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec080+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H072+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu072+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H009+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu009+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec058+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H058+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu058+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec028+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec029+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec030+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec036+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec044+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H044+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu044+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec045+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H045+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu045+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec047+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H047+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu047+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec048+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H048+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu048+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec049+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H049+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu049+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec050+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H050+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu050+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H051+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu051+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec052+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H052+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu052+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec017+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H017+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu017+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H076+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu076+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec077+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H077+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu077+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec078+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H078+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu078+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H004+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu004+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec006+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H006+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu006+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec008+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H008+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu008+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec012+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H012+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu012+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec016+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H016+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu016+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec022+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H022+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu022+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec023+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H023+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu023+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec024+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H024+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu024+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec026+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H026+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu026+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec027+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H027+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu027+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec055+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H055+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu055+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec007+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H007+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu007+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec013+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H013+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu013+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Fec014+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_H014+<span style="color: #ff0000;">"',"</span>+<span style="color: #ff0000;">"'"</span>+M_Usu014+<span style="color: #ff0000;">"',"</span>+Str<span style="color: #000000;">(</span>M_Can_Bul<span style="color: #000000;">)</span>+<span style="color: #ff0000;">")"</span> <span style="color: #000000;">)</span><br />oQI:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span></div>[/code:7ss5slgl]
y sólo agrega el primer registro, ¿qué estoy haciendo mal?
|
tDolphin + Progress Bar
|
Leo
Si ya tienes los datos en un archivo plano, un txt supongo, porque no usas el LOAD DATA como en el siguiente post.
[url:x9gmpy81]http://forums.fivetechsupport.com/viewtopic.php?f=6&t=25959[/url:x9gmpy81]
Es rapidisimo, eficiente y si tienes bien definido el txt. Para 12500 lineas, algo como 6 segundos, por lo menos en mi caso con un server Linux, algunas veces en Windows y modo local se demora mas, ni idea poruqe, pero como es win, no me preocupo.
Saludos
Desde Chile
Adolfo
|
tDolphin + Progress Bar
|
Repito, no es un archivo plano, cuando ejecuto el cierre mensual de transacciones, debo traspasar de la tabla MySQL de transacciones del mes a la tabla MySQL de transacciones históricas.
|
tDolphin + Progress Bar
|
Hola
lo ideal y mas rapido es que hagas cargas masivas en una sola sentencia... te explico como puedes hacer el proceso
enviaras cada sentencia lotes de por ejemplo 500 o 1000 registros, como lo haces? usa el metodo Insert de la clase TDolphinSrv
calculas la cantidad de registros a enviar que te servira para el control de progress bar
vas cargando los datos en el arreglo multidimencional (por ejemplo 500 registro de una sola vez) que usara el metodo Insert,
envias el insert, borras el arreglo y repites el proceso hasta terminar
ejemplo de uso de insert, envia tres registro de una sola vez
[code=fw:2tsa1l0z]<div class="fw" id="{CB}" style="font-family: monospace;">aColumns = <span style="color: #000000;">{</span> <span style="color: #ff0000;">"date"</span>, <span style="color: #ff0000;">"category"</span>, <span style="color: #ff0000;">"event_id"</span> <span style="color: #000000;">}</span><br />aValues = <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> CToD<span style="color: #000000;">(</span> <span style="color: #ff0000;">'09-03-2008'</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">'Q'</span>, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> CToD<span style="color: #000000;">(</span> <span style="color: #ff0000;">'09-06-2008'</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">'Q'</span>, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">}</span> ,<span style="color: #000000;">{</span> CToD<span style="color: #000000;">(</span> <span style="color: #ff0000;">'09-09-2008'</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">'T'</span>, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">}</span><span style="color: #000000;">}</span><br />oServer:<span style="color: #000000;">Insert</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"NombreDeLaTabla"</span>, aColumns, aValues <span style="color: #000000;">)</span></div>[/code:2tsa1l0z]
|
tDolphin + Progress Bar
|
Eso es nuevo, lo probraré y luego comento. Sólo me queda una duda, cómo genero un array con los valores de los campos de la otra tabla que es idéntica a la tabla a la que voy a vaciar la información?, además las "Q" y "T" que hay en el array de las columnas, qué significan?
|
tDolphin + Progress Bar
|
Leo,
Si es desde consulta mysql no e veo problema.
si es desde mysql.
INSERT INTO tabla (id, value) (SELECT id, value FROM tabla2)
y con eso pasaras la nformacion de tabla
|
tDolphin + Progress Bar
|
[quote="Leo":qfwbuw1v]Eso es nuevo, lo probraré y luego comento. Sólo me queda una duda, cómo genero un array con los valores de los campos de la otra tabla que es idéntica a la tabla a la que voy a vaciar la información?, además las "Q" y "T" que hay en el array de las columnas, qué significan?[/quote:qfwbuw1v]
Hola
esas Q y T estan en el array de los valores no de las columnas
son los valores que tomaran los campos
para el primer insert los valores seran
{ "date", "category", "event_id" }
date = CToD( '09-03-2008' )
category = 'Q'
event_id = NIL
si te fijas hay 3 columnas en la tabla ( { "date", "category", "event_id" })
y tres valores para cada una
{ CToD( '09-03-2008' ), 'Q', NIL } (1)
{ CToD( '09-06-2008' ), 'Q', NIL } (2)
{ CToD( '09-09-2008' ), 'T', NIL } (3)
y esto no es nuevo esta desde el principio de la clase
[quote="wmormar":qfwbuw1v]Leo,
Si es desde consulta mysql no e veo problema.
si es desde mysql.
INSERT INTO tabla (id, value) (SELECT id, value FROM tabla2)
y con eso pasaras la nformacion de tabla[/quote:qfwbuw1v]
de esta forma sera muy rapido, pero lamentablemente no contaras con la progress bar, aparte si se demora un poco mas la sentencia, sea por lo que sea, lentitud del internet, sea muy grande la cantidad de registros, si no lo haces en un proceso en background, la aplicacion podria "no responder" hasta terminar el proceso, pero esta sugerencia que te aporta william es muy rapida
|
tDolphin + Progress Bar
|
Daniel Garcia-Gil,
De la manera comentada, se podria usar un msgrun, el progressbar definitivamente no funciona, y lo favorable de esto es que todo se ejecuta desde el servidor aun siendo de manera remota.
|
tDolphin + Progress Bar
|
Daniel, William, Les agradezco mucho los post que me han hecho, probaré los dos métodos, ya que el que propone Daniel, le permite al usuario ver un estado de avance, en este momento lo estoy probando y funciona muy bien, sólo que algo lento en forma remota, en cuanto a tiempo de proceso, tengo que probar la solución propuesta por William. De verdad me han ayudado una enormidad. Cuando termine con las pruebas de mi pequeño archivo de 87864 registros, les comentaré los resultados. Otra vez, Muchas Gracias.
|
tDolphin using it on remote computer
|
Hello ,
I try to use dolphin or mySql , but i am afraid i do not understand the concept (server - client)
I have installed xAmpp on a computer , //MyComp. I can run it and start MySql and apache.
In tDolphin\samples i can build and execute some prg-files , using as connection data (in connect.ini) :
[mysql3]
host=127.0.0.1 // or localhost
user=root
psw=
flags=0
port=3306
dbname=testmysql
Next step is to run the generated program from a remote computer (in the network).
How can it be done ?
For a connection we have to know the hostname , i have no idea how we can get it or set it.
Frank
|
tDolphin using it on remote computer
|
Frank,
[quote:4jjua3jq]For a connection we have to know the hostname , i have no idea how we can get it or set it.[/quote:4jjua3jq]
in your case the hostname is the name of the pc where xampp is installed.
But, if I remember correct, xammp does not allow any sql access from outside the web environment. Better you install the standalone MySql-Server.
|
tDolphin using it on remote computer
|
Do i have to install xampp also on the remote computer ? Datadir can be set on the datadir from the server !
It seems not to be efficient when we have a network with many computers.
Frank
|
tDolphin using it on remote computer
|
I hope, I understood you right..
Xampp is only a webserver, that includes a sql modul. But, as I said before, this sql service is not accessible from outside, you can only access it if you have a website, running on that server, with e.g. a java or php app. These can access this sql service.
To run tDolphin normally you can´t use xaampp. Maybe xampp is configurable to open sql for everybody, but I don´t know.
I suggest to install a standalone sql server on one pc in your network. (MySql, SqlLite, MS Sql,...) This pc is now the sql server in your network, accessible from anywhere. Now you can create users and databases. MySql offers a lot of tools to manage the server.
I don´t have any experience ith tDolphin, I didn´t use it so far. But now it should be possible to access your sql server with tDolphin.
I hope this helps a little
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.