topic
stringlengths
1
63
text
stringlengths
1
577k
ADO RDD xHarbour
Antonio, i found in the meanwhile that when i use quit the massage is showing, but when i close the main window (FIVEWIN) the quit is not called!
ADO RDD xHarbour
Gunther, Im trying with ACTIVATE WINDOW oWnd VALID ; FimPrograma(ownd,oTimer) The FimPrograma does not quit and even so the message is shown only ADO_EXIT but without any procs.
ADO RDD xHarbour
Gunther, If you need you can call directly ADODB_CLOSE() in order to close all tables, sets and connection thats what ADO_EXIT does. I though ADO_EXIT would be called in any circumstance besides errors.
ADO RDD xHarbour
Antonio, for now i insert ADODB_CLOSE() in the valid from my main-window. Another points to discuss i found on transfer my app to adordd is: 1.) If i fill the index-array the order cannot changing with SET INDEX TO .... In some cases this is required if i will not change the code. 2.) Opening the same DBF with 2 or more USE and different aliases is in other RDD possible. In ADORDD?
ADO RDD xHarbour
Gunther, [quote:3di2shte] 1.) If i fill the index-array the order cannot changing with SET INDEX TO .... In some cases this is required if i will not change the code. [/quote:3di2shte] Sorry I cant understand what you mean. SET INDEX TO its translated by the preprocessor to ordlistadd() as in clipper adordd SET ORDER to the 1st index in the SET INDEX TO. Is it not working like that? Can you post an example? [quote:3di2shte] 2.) Opening the same DBF with 2 or more USE and different aliases is in other RDD possible. In ADORDD? [/quote:3di2shte] It works like any other rdd you everything continues the same. My apps work just like that and its 100% ok.
ADO RDD xHarbour
Antonio, SET INDEX TO index1,index2,... or USE....INDEX index1,index2,... describes only the order from indexfiles. As in ADORDD no files exist i must use before INDEX ON... (in a clipper app only once to produce the indexfile) or the command SET ADODBF TABLES INDEX LIST TO .... If i use this ADODBF TABLES INDEX LIST TO .... then the order from the indexes always like this array. [b:2u3yg6o2]The SET INDEX TO... or USE..INDEX TO... are not respected![/b:2u3yg6o2] You write in a message before that this array are always on first ranking and after this the indexes with INDEX ON... added.
ADO RDD xHarbour
Gunther, USE cTable SET INDEX TO index1,index2,index3 Order focus should be index1. If SET AUTOPEN ON the order focus will be on the first index in the SET ADODBF.. You should only use INDEX ON for temporary indexes as permanent ones should be indicated on SET ADODBF INDEX... If you use INDEX ON... TO cFile the cFile name must be present the min 4 first letters in ADO SET TEMPORARY NAMES... otherwise will never be opened. You can use this to check the status of tables,aliases, locks, relations and indexes per area. [code=fw:3uerxw35]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> expalias<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> cerrorlog := <span style="color: #ff0000;">""</span>,n,j,ntarget,x<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">255</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cErrorLog += CRLF + Str<span style="color: #000000;">&#40;</span> n, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">": "</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == n,<span style="color: #ff0000;">"=> "</span>, <span style="color: #ff0000;">" &nbsp; "</span> <span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PadR<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">15</span> <span style="color: #000000;">&#41;</span> + Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"NomeRDD: "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RddName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + CRLF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cErrorLog += <span style="color: #ff0000;">" &nbsp; &nbsp; =============================="</span> + CRLF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cErrorLog += <span style="color: #ff0000;">" &nbsp; &nbsp; RecNo &nbsp; &nbsp;RecCount &nbsp; &nbsp;BOF &nbsp; EOF"</span> + CRLF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cErrorLog += <span style="color: #ff0000;">" &nbsp; &nbsp;"</span> + Transform<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"99999"</span> <span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">" &nbsp; &nbsp; &nbsp;"</span> + Transform<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"99999"</span> <span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">" &nbsp; &nbsp; &nbsp;"</span> + cValToChar<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> BoF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">" &nbsp; "</span> + cValToChar<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> EoF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + CRLF + CRLF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cErrorLog += <span style="color: #ff0000;">" &nbsp; &nbsp; Used indexes "</span> + Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">23</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"TagName"</span> + CRLF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> j = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">15</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> IndexKey<span style="color: #000000;">&#40;</span> j <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cErrorLog += Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> IndexOrd<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == j, <span style="color: #ff0000;">"=> "</span>, <span style="color: #ff0000;">" &nbsp; "</span> <span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PadR<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> IndexKey<span style="color: #000000;">&#40;</span> j <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdName<span style="color: #000000;">&#40;</span> j <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CRLF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cErrorLog += CRLF + <span style="color: #ff0000;">" &nbsp; &nbsp; Relações em uso "</span> + CRLF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> j = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">8</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nTarget := <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbRSelect<span style="color: #000000;">&#40;</span> j <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cErrorLog += Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> + Str<span style="color: #000000;">&#40;</span> j <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">": "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"TO "</span> + <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbRelation<span style="color: #000000;">&#40;</span> j <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">" INTO "</span> + <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span> nTarget <span style="color: #000000;">&#41;</span> + CRLF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// uValue = ( Alias( n ) )->( DbRelation( j ) )</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// cErrorLog += cValToChar( &( uValue ) ) + CRLF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; x := &nbsp;<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">alias</span><span style="color: #000000;">&#40;</span>n<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>dbrlocklist<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cErrorLog += Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> +<span style="color: #ff0000;">"Locked records "</span>+CRLF<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> j = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span>x<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cErrorLog += Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"Recno "</span>+str<span style="color: #000000;">&#40;</span>x<span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>+CRLF<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp;SHOWMEMO<span style="color: #000000;">&#40;</span>cerrorlog<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> .t.<br /><br />&nbsp;</div>[/code:3uerxw35] Can you post a small trial and the that trial table index array in SET ADODBF... ?
ADO RDD xHarbour
Gunther, [quote:2fhf9z7j]You write in a message before that this array are always on first ranking and after this the indexes with INDEX ON... added.[/quote:2fhf9z7j] Just lie any other rdd INDEX ON without ADDITIVE clause will clear all the orders prior to creation.
ADO RDD xHarbour
Gunther, Is the problem solved ? Im looking into indexes with SQLite right now so if you need something please let me know.
ADO RDD xHarbour
Antonio, i test now my app and have wrote a little testprogram. I send you tomorrow the results! Greetings from Austria!
ADO RDD xHarbour
Antonio, after testing i can say: All is right! Suggestions: For the local (.ctl, files with text "nada") files you should also set a path ex.: <app>\adordd or the temp from windows as we should not write into the app-path (and/or a SET order)! The text "nada" should more international. SET ADO INDEX UDFS TO should contain for standard SUBS and SUBSTR.
ADO RDD xHarbour
Gunther, [quote:2nah3spw]Antonio, after testing i can say: All is right![/quote:2nah3spw] Great ! [quote:2nah3spw]For the local (.ctl, files with text "nada") files you should also set a path ex.: <app>\adordd or the temp from windows as we should not write into the app-path (and/or a SET order)![/quote:2nah3spw] These files are only created when SET ADO LOCK ON and at the path of SET ADO LOCK CONTROL SHAREPATH TO so you can choose whatever path you want. These files are only created to simulate USE EXCLUSIVE / SHARED as they are opened with FOPEN( (cFile), IF(lExclusive, FO_EXCLUSIVE, FO_DENYNONE ) ) [quote:2nah3spw]The text "nada" should more international.[/quote:2nah3spw] Nada means nothing I think its international. [quote:2nah3spw]SET ADO INDEX UDFS TO should contain for standard SUBS and SUBSTR.[/quote:2nah3spw] You can place here any functions you want. In principle should be present here all ones that are not only to convert data types, such as SUBSTR for ex. The ones that alter the value, length of a field must be present here.
ADO RDD xHarbour
Antonio. [quote:19fp9x7m]In principle should be present here all ones that are not only to convert data types, such as SUBSTR for ex. The ones that alter the value, length of a field must be present here.[/quote:19fp9x7m] Also upper() and so on should be in this list? And whats ex. should not to be in list?
ADO RDD xHarbour
Gunther, We normally use index functions to convert all index keys to the same data type. INDEX ON STR(NUM)+DTOS(DATE)+CVALTCHAR(LOGIC) These kind of functions dont alter the data itself but only the type in order that can be evaluated without errors. These kind of functions you dont need and should not use them in ADO UDF. But for instances if we do instead INDEX ON STR(NUM)+DTOS(DATE)+IF( LOGIC , "yes", "no") Then we need to include in ADO UDF - IF to tell adordd that this index its a different one. The same with UPPER, SUBSTR, ==, PAD, etc. But you should only place them in ADO UDF if in fact they are used in your app in index expressions otherwise you dont need to take the time to do it. Besides these you need there all true User Defined Functions. Please note that if you place DTOS in ADO UDF all indexes with that function will be created in an array and after sorted. This array of bookmarks its then set in ado :filter method. This is expensive to create and maintained in big tables and should be only used when truly needed. Is this clear to you?
ADO RDD xHarbour
New build adordd ver 1.0 at <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m --> Corrected bugs: APPEND with SQLITE, FIREBIRD, POSTGRE and ORACLE with index with UDF or condition was adding the same bookmark twice. ADO_REQUERY could fall into recursive calls after append new record using engines Sqlite, FireBird Postgre and Oracle. DBGOTO was giving error if the record was not within INDEX with UDF or condition. Changes: hb_AdoRddFile( cFile ) Check for index file in the adodbf index list... and support for Sqlite, Firebird, Oracle.
ADO RDD xHarbour
New build adordd ver 1.0 at <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m --> Corrected Bugs: 1) FIELDNAME was not returning upper fieldname in case of db engine PostGre, Oracle 2) Some upper case conversions to take care of lower case fields used by PostGre and Oracle. 3) Reserved keywords used in fields taken care with PostGre and Oracle. 4) SET TRESHOLD was not finding aMask if used table and SQL were with different case. Now all upper case. 5) Pre opening of recorsets optimized and cached for different where clauses on same table. If the table its below the SET THRESHOLD and its already opened in another work area the set its not created again but cloned from that work area. If during app run time a table passes the SET THRESHOLD value its cached next time is opened. Tested engines: ACCESS ADS DBASE FIREBIRD FOXPRO MS SQL MYSQL POSTGRE SQLITE Still not tested but should work ok: ANYWHERE INFORMIX MARIADB ORACLE
ADO RDD xHarbour
Antonio, line 6233 lReval -> lRetval
ADO RDD xHarbour
Gunther, Thanks Done!
ADO RDD xHarbour
New build adordd ver 1.0 at <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m --> New: 1) SET ADODBF INDEX LIST FIELDTYPE NUMBER TO {{ "Table",{ "numfiled", nlen },{"numfield", nLen } } } adordd need a precise indication of the len of numeric fields used in index expressions. This is only needed for numeric fields where the SQL type its without field len definition such as: AUTOINC, MONEY, DOUBLE, INT, SMALLINT, etc. Corrected Bugs: 1) ADOBEGINTRANS( nWA ) : without work are it starts a transaction in default adordd connection otherwise it starts in the connection of the current work area. 2) ADOROLLBACKTRANS( nWA ) : without any work area it rolls back all transactions in all open connections otherwise it rolls back transaction in same connection as that work area. 3) ado_create was adding an extra position in field len of numeric fields now ADO_FIELDSTRUCT takes that position returning the correct len of a field type "N" This could lead to side effects in INDEXKEY where the numeric field was part of the expression. No tables structure corrections are necessary. 4) ADPSEUDOSEEK works now ok with fields type "T" 5) ADODUFINDEX if result of the index expression its numeric its considered as it was a UDF expression because we cant extract field len to build a find, filter or query expression because the eval result its the sum of all the numeric fields in the expression. 6) ORDKEYGOTO was not full implemented.
ADO RDD xHarbour
New build adordd ver 1.0 at <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m --> Corrected new Bugs due to changes previous build: 1) ADO_SQLSTRU with firebird numeric fields precision fieldlen was wrong 2) ADO_FIELDSTRUCT integers doesnt take any extra position. 3) ADO_PUTVALUE trim spaces to check data width error with numbers.
ADO RDD xHarbour
New AdoRdd Version 1.070317 at <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m --> Improvements and corrected bugs: ADO_ORDCREATE after creating index wasnt opening it. ADO_SEEK key with multiple fields with softseek on was going to eof instead of last key. ADOFILE if connection not valid returns now .F. instead of HB_FAILURE. ADOOPENCONNECT if engine its not supported or wrongly set alerts the user. ADOBEGINTRANS if workarea not specified opens a transactions for each opened connection ADOCOMMITTRANS and ADOROLLBACKTRANS the same as ADOBEGINTRANS New function ADONESTEDTRANS( nWA ) returns nr of nested transactions NEW ERROR CODE 10600 - connection not available cant find transactions ADO_ALREADYOPEN Test if the open recordset has same Sql query statement. ADORECCOUNT Table name was not being converted to get fieldrecno if any defined for that table always returned that default one. ADOPREOPENTHRESHOLD Faster counting records. Doesn't cache any tables with WHERE clause. All ADO cursors changed in the code from adopendynamic to adopenstatic, although it always started as adopenstatic. New features: New option PORT in SET ADO DEFAULT DATABASE ... ADO_ORDINFO ordwildseek implemented Multibag orders support with new SET: SET ADODBF MULTIBAG INDEX LIST TO { { "INDEX NAME", {TAGORDER 1","TAGORDER2"} } } This allows multibag index file support exactly the same as any other DBf rdd. ATTENTION Now when SET AUTOOPEN ON doesn't open all index files automatically in SET ADODBF INDEX LIST instead only opens the INDEX NAME present in SET ADODBF MULTIBAG INDEX LIST TO that match the table name. Faster opening recordsets: SET RECORDSET OPEN WHERE CLAUSE TO { { "TABLENAME", "SQL WHERE EXPRESSION" } } ADOWHERECLAUSE ADORDD function allowing us to change the recordset WHERE clause on the fly keeping all workarea information as Filters, Scopes, Indexes, etc. Ex SET RECORDSET OPEN WHERE CLAUSE TO { { "table", "FIELDANEMYEAR = '2017'" } } USE table BROWSE() //only records that meet "where" clause //we want to see some historic data cOldQry := ADOWHERECLAUSE( SELECT(), "FIELDANEMYEAR = '2012'" ) BROWSE() //Get back to current year ADOWHERECLAUSE( SELECT(), cOldQry ) BROWSE()
ADO RDD xHarbour
New AdoRdd at <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m -->
ADO RDD xHarbour
New AdoRdd at <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m -->
ADO RDD xHarbour
New AdoRdd at <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m --> Performance enhancement opening tables. SET RECORDSET OPEN WHERE CLAUSE TO {{"MYTABLE","HBRECNO < 51000" },; {"MYTABLE2","HBRECNO BETWEEN 1 AND 50000" }} This SET together ADOWHERECLAUSE( nWa, cNewSql ) enable us to open tables using the set of data we really need without altering any code logic. This SET is used as default query to open for each table present here. The ADOWHERECLAUSE( nWa, cNewSql ) can be placed in strategic places within our app code to change or to avoid to bring all the records to the set. Tables till 100K dont need to worry. Usually its slower to build the set than to read data from the database. Recordset s with more than 100 columns will start to take long time to build. I´ve seen recordset s with 800 columns! This takes long time even with a couple of thousands of records! Tables with a couple of millions of records if we dont use any WHERE clause will exhaust memory very fast or we even dont have enough memory to run our app. [code=fw:3qcom0m3]<div class="fw" id="{CB}" style="font-family: monospace;"><br />....<br /><span style="color: #B900B9;">//Ex</span><br />USE <span style="color: #ff0000;">"MYTABLE"</span> &nbsp;<span style="color: #B900B9;">// 10.000.000 RECS with SET RECORDSET OPEN WHERE CLAUSE TO will load only 51.000 recs</span><br />....<br /><span style="color: #B900B9;">// Here we will need other set of data</span><br /><span style="color: #B900B9;">//we have to be sure that with this new query our app code can run all necessary routines</span><br />nRecno := RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />cOldSql := ADOWHERECLAUSE<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"INVOICEDATE > '2016/04/01'"</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">//working with the new set</span><br /><span style="color: #B900B9;">//all workarea data, indexes etc continue exactly the same</span><br /><span style="color: #B900B9;">//finish working get back to previous set</span><br />ADOWHERECLAUSE<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, cOldSql &nbsp;<span style="color: #000000;">&#41;</span><br />GO nRecno<br />....<br />&nbsp;</div>[/code:3qcom0m3] Caching the tables (recordsets): [code=fw:3qcom0m3]<div class="fw" id="{CB}" style="font-family: monospace;"><br />SET ADO PRE OPEN THRESHOLD <span style="color: #0000ff;">TO</span> <span style="color: #000000;">0</span> MASK <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"MYTABLE"</span>,<span style="color: #ff0000;">"MYTABLE2"</span><span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:3qcom0m3] This enable to cache the tables to avoid read the data again every time we open these tables with the same query. This SET uses the queries defined with SET RECORDSET OPEN WHERE CLAUSE TO. Setting TO 0 adordd will not cache any table based on nr of records. In this case adordd will only load the tables in MASK. In databases with tables of millions of records if we choose to cache tables for ex > 50k records we must have a defined query for those tables otherwise adordd will cache all the records in the table. If there are 10.000k program most probably will crash! We need also to pay some attention to MASK to avoid loading tables we dont need. Suppose that we have loaded, when we import our data on our database, our tables with paths: These will be the table names in the database. CURRENTPATH_MYTABLE HISTORICOATH_MYTABLE With above SET adordd will cache both. So in this case we can do: SET ADO PRE OPEN THRESHOLD TO 0 MASK {"CURRENTPATH\MYTABLE","CURRENTPATH\MYTABLE2"} To avoid cache for ex other historic tables with same name. Please remember that even we dont use this SET every time a table is opened it will be cached. Again if any of those tables have millions of records if we dont have any query to limit the nr of records returned adordd will load all those millions! ATTENTION By default adordd caches all tables with more than 6000 recs when opening it. Please adjust it in adordd to another value of your choice and we should have a query to limit records for the tables with more than 500k.
ADO RDD xHarbour
New AdoRdd at <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m --> Improved speed DBEval Cache tables and recordsets enhancement
ADO RDD xHarbour
New AdoRdd and tryadordd at <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd.git">https://github.com/AHFERREIRA/adordd.git</a><!-- m -->
ADO RDD xHarbour
My main work now with AdoRdd its database with tables between 5.000 and 10.000.000 records building recordsets between 5.000 and 100.000 records and 70 columns in average. The work its on a 1Gb LAN. In the bigger tables if the server has indexes for the WHERE clause its pretty fast < 3 Secs building the recordset. The memory consumption gets to max 600Mb. I can have > 50 recordset opened at same time. With the cached recordsets memory consumption will not increase. AdoRdd can cache the recordsets in the beginning of the application with: SET ADO PRE OPEN THRESHOLD TO In this case app waits a little more to start but then all table opening its lightning fast. Normally to display a window with > 20 tables its less < 1sec. If we choose not to use this SET AdoRdd will use as cache already opened tables. Thus the second time it will be also very fast. With tables of this dimension we absolutely need a default open WHERE clause otherwise application would crawl and crash. use SET RECORDSET OPEN WHERE CLAUSE TO. Please pay attention to these WHERE clauses otherwise you might not be able to see new additions as soon as AdoRdd requery. Punctuality we might need to reduce the recordset for ex for sum SUM operations. This is where we use: cOldSql := adowhereclause( Select(), "where clause" ) SUM ... adowhereclause( Select(), cOldSql ) Hope this might help you.
ADO RDD xHarbour
[quote="Rick Lipkin":18uicnv8]Gemtleman I have been using ( plain ) ADO ( class and methods ) for many years .. 32 and 64 bits ... Have a look in the samples folder and compile AdoRick.prg .. Uses all the Fivewin code .. xbrowse, panels, folders ... etc. You can use ADO to connect to MS Sql Server, MS Access and ( most ) all the other Sql databases as well ... Rao has made the ADO connection syntax with many FiveWin wrappers .. Look in the \source\functions\adofuncs.prg .. Thanks Rick Lipkin[/quote:18uicnv8] Rick, In your experience with mainly viewing large Xbrowse setups with many tags and editing mostly from inside the Xbrowse : Would you think that ADO (with the Mr. Rao tools) and FW give a better performance than with DBF files, DBFCDX, TAG and FW ?
ADO RDD xHarbour
Marc, Do you also have speed problems on the PC where you saved your DBF files. Regards, Otto
ADO RDD xHarbour
Necesito ayuda, cuando estoy usando dos aplicaciones, cuando incluyo una, en la otra aplicación no aparece.
ADO RDD xHarbour
¿ Quien no aparece ?
ADO RDD xHarbour
no aparece el elemento que agregué en el otro sistema, Ej: dejo ambos sistemas en la pantalla de registro de grupo con xbrowse, al incluir en un sistema, en el otro si voy a incluir el mismo código porque no actualizo el registro, y en xbrowse tampoco aparece . Ahora cuando hago un cambio, cambia normal en ambos
ADO RDD xHarbour
o estoy usando asi [code=fw:plwh7zjm]<div class="fw" id="{CB}" style="font-family: monospace;"><br />REQUEST DBFCDX<br />REQUEST ORDKEYNO<br />REQUEST ORDKEYCOUNT<br />REQUEST ORDKEYGOTO<br />REQUEST ADORDD, ADOVERSION, RECSIZE<br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   RddRegister<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ADORDD"</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />   RddSetDefault<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ADORDD"</span><span style="color: #000000;">&#41;</span><br /><br />   SET DATE <span style="color: #0000ff;">TO</span> BRIT   <br />   SET CENTURY <span style="color: #0000ff;">ON</span><br />   SET EPOCH <span style="color: #0000ff;">TO</span> <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">YEAR</span><span style="color: #000000;">&#40;</span>DATE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">-50</span><span style="color: #000000;">&#41;</span><br />   SET DELETED <span style="color: #0000ff;">ON</span><br />   SET SOFTSEEK OFF<br /><br />   <span style="color: #00C800;">IF</span> RDDSETDEFAULT<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"ADORDD"</span><br /><br />      SET ADODBF TABLES <span style="color: #0000ff;">INDEX</span> LIST <span style="color: #0000ff;">TO</span> <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"SLGRUP"</span>,<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"SLGRUP1"</span>,<span style="color: #ff0000;">"STRZERO(GRU_COD,3)"</span><span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"SLGRUP2"</span>,<span style="color: #ff0000;">"GRU_DES"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span>,;<br />                                       <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"SLSGRU"</span>,<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"SLSGRU1"</span>,<span style="color: #ff0000;">"STRZERO(SGR_COD,3)"</span><span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"SLSGRU2"</span>,<span style="color: #ff0000;">"SGR_DES"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />      SET ADODBF MULTIBAG <span style="color: #0000ff;">INDEX</span> LIST <span style="color: #0000ff;">TO</span> <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"SLGRUP"</span>,<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"SLGRUP1"</span>,<span style="color: #ff0000;">"SLGRUP2"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span>,;<br />                                         <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"SLSGRU"</span>,<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"SLSGRU1"</span>,<span style="color: #ff0000;">"SLSGRU2"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />      SET ADO TEMPORAY NAMES <span style="color: #0000ff;">INDEX</span> LIST <span style="color: #0000ff;">TO</span> <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"TMP"</span>,<span style="color: #ff0000;">"TEMP"</span><span style="color: #000000;">&#125;</span><br /><br />      SET ADO <span style="color: #0000ff;">INDEX</span> UDFS <span style="color: #0000ff;">TO</span> <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"IF"</span>,<span style="color: #ff0000;">"&"</span>,<span style="color: #ff0000;">"SUBSTR"</span>,<span style="color: #ff0000;">"=="</span>,<span style="color: #ff0000;">"DESCEND"</span>,<span style="color: #ff0000;">"MYFUNC"</span>,<span style="color: #ff0000;">"PAD"</span><span style="color: #000000;">&#125;</span><br /><br />      SET ADODBF <span style="color: #0000ff;">INDEX</span> LIST FIELDTYPE NUMBER <span style="color: #0000ff;">TO</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"SLGRUP"</span>,<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"GRU_COD"</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />      <span style="color: #B900B9;">//SET ADO TABLES DECIMAL FIELDS LIST TO {}</span><br /><br />      <span style="color: #B900B9;">//SET ADO TABLES LOGICAL FIELDS LIST TO {};</span><br /><br />      SET ADO <span style="color: #00C800;">DEFAULT</span> RECNO FIELD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"ID"</span><br />      <span style="color: #B900B9;">//SET ADO FIELDRECNO TABLES LIST TO {{"SLGRUP","ID"}}      </span><br />            <br />      SET ADO <span style="color: #00C800;">DEFAULT</span> DELETED FIELD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"HBDELETE"</span><br />      <span style="color: #B900B9;">//SET ADO FIELDDELETED TABLES LIST TO {{"SLGRUP","HBDELETE"}}</span><br /><br />      SET ADO FORCE LOCK <span style="color: #0000ff;">ON</span><br />      SET ADO LOCK CONTROL SHAREPATH <span style="color: #0000ff;">TO</span> HB_DIRBASE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"TEMP"</span> RDD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"DBFCDX"</span><br /><br />      SET ADO <span style="color: #00C800;">DEFAULT</span> DATABASE <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"dbfnew"</span> <span style="color: #00C800;">SERVER</span> <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"localhost"</span> ENGINE <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"MYSQL"</span> USER <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"new"</span> PASSWORD <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"123"</span><br />      <br />      <span style="color: #B900B9;">// with thsi set the path becomes part of the table name.</span><br />      SET ADO TABLENAME WITH PATH OFF <br /><br />      <span style="color: #B900B9;">// uploaded with one path working now with another</span><br />      SET ADO ROOT PATH <span style="color: #0000ff;">TO</span> HB_DIRBASE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"DADOS"</span> INSTEAD <span style="color: #0000ff;">OF</span> HB_DIRBASE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />        <br />      SET ADO CACHESIZE <span style="color: #0000ff;">TO</span> <span style="color: #000000;">100</span> ASYNC <span style="color: #0000ff;">ON</span> ASYNCNOWAIT <span style="color: #0000ff;">ON</span><br /><br />      SET ADO PRE OPEN THRESHOLD <span style="color: #0000ff;">TO</span> <span style="color: #000000;">5000</span> <span style="color: #B900B9;">//MASK { "TABLE" }</span><br /><br />      SET EXCLUSIVE OFF<br />      SET AUTORDER <span style="color: #0000ff;">TO</span> <span style="color: #000000;">1</span><br />      SET AUTOPEN <span style="color: #0000ff;">ON</span><br /><br />      hb_AdoUpload<span style="color: #000000;">&#40;</span> HB_DIRBASE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"DADOS<span style="color: #000000;">\"</span> , "</span>DBFCDX<span style="color: #ff0000;">" , "</span>MYSQL<span style="color: #ff0000;">", .f. )<br /><br />   ENDIF<br /><br />   USE SLGRUP ALIAS "</span>SLGRUP<span style="color: #ff0000;">"  VIA "</span>ADORDD<span style="color: #ff0000;">" NEW    <br />   USE SLSGRU ALIAS "</span>SLSGRU<span style="color: #ff0000;">" VIA "</span>ADORDD<span style="color: #ff0000;">" NEW<br /><br />RETURN .T.<br /></span></div>[/code:plwh7zjm]
ADO RDD xHarbour
A la luz del fuente: <!-- m --><a class="postlink" href="https://github.com/AHFERREIRA/adordd/blob/master/adordd.prg">https://github.com/AHFERREIRA/adordd/bl ... adordd.prg</a><!-- m --> quizás necesites incluir en tu codigo un SKIP 0 (refresh())
ADO RDD xHarbour
Usé SKIP 0, aun así no actualiza el último registro. Abro dos aplicaciones y dejo un stop en la pantalla de xbrowse, y en la otra creo un registro nuevo, y no actualiza en la otra que esta parada en xbrowse. La única forma que pude, fue terminar el banco y abrirlo de nuevo, luego aparece el último registro creado. ¿Tienes alguna otra manera? [code=fw:2zrzlqa0]<div class="fw" id="{CB}" style="font-family: monospace;"><br />CLOSE SLGRUP<br />USE SLGRUP<br />SLGRUP-><span style="color: #000000;">&#40;</span>DBSETORDER<span style="color: #000000;">&#40;</span><span style="color: #000000;">01</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />DBSKIP<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />oGruLbx:<span style="color: #000000;">oDbf</span>:= <span style="color: #ff0000;">"SLGRUP"</span><br />oGruLbx:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:2zrzlqa0]
ADO RDD xHarbour
Hola, Supongo que el SKIP 0 lo hiciste en el otro lado, en el lado que no añadio el registro. Siendo lo anterior ¿ Podrias probar a hacer un GO TOP ? Hay un mensaje que habla de este tema... pero no resuelve mucho.. Seria este: <!-- m --><a class="postlink" href="https://groups.google.com/g/comp.lang.xharbour/c/SY9iigGmnho/m/jfPvXVkzCAAJ">https://groups.google.com/g/comp.lang.x ... PvXVkzCAAJ</a><!-- m --> En todo caso, en el fuente de ADORDD parece que este tema esta previsto y la nativa fundamental ADO_REFRESH lo contempla. Asi un SKIP 0 o un GO TOP deberian funcionar [code=fw:2gk8js6u]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_REFRESH<span style="color: #000000;">&#40;</span> nWA, lRequery <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//22.08.15</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aWAData := USRRDD_AREADATA<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nReccount<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nRecno, xKey, aSeek, oRs, cSql<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> lOnlyfirstField := .T., oClone<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> !ADOCON_CHECK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> HB_FAILURE<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;nReccount := ADORECCOUNT<span style="color: #000000;">&#40;</span> nWA, aWAData<span style="color: #000000;">&#91;</span> WA_RECORDSET <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;lRequery := <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> lRequery == <span style="color: #00C800;">NIL</span>, .F., lRequery <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> !aWAData<span style="color: #000000;">&#91;</span> WA_RECORDSET <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .AND.!aWAData<span style="color: #000000;">&#91;</span> WA_RECORDSET <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nRecno := aWAData<span style="color: #000000;">&#91;</span> WA_RECORDSET <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span>aWAData<span style="color: #000000;">&#91;</span>WA_FIELDRECNO<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> HB_SUCCESS<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> lRequery<br />&nbsp; &nbsp; &nbsp; ADO_REQUERY<span style="color: #000000;">&#40;</span> nWA , aWAData<span style="color: #000000;">&#91;</span> WA_RECORDSET <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_RECCOUNT <span style="color: #000000;">&#93;</span> := nReccount<br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_LREQUERY <span style="color: #000000;">&#93;</span> := .T. <span style="color: #B900B9;">//already requeried set to .f.</span><br /><br />&nbsp; &nbsp; &nbsp; ADO_GOTO<span style="color: #000000;">&#40;</span> nWA, nRecNo <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> aWAData<span style="color: #000000;">&#91;</span> WA_RECORDSET <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// record does not exist anymore other app delete it!</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">THROW</span><span style="color: #000000;">&#40;</span> ErrorNew<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADORDD"</span>, <span style="color: #000000;">10002</span>, <span style="color: #000000;">10002</span>, <span style="color: #ff0000;">"Record move "</span>+aWAData <span style="color: #000000;">&#91;</span> WA_TABLENAME<span style="color: #000000;">&#93;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;STR<span style="color: #000000;">&#40;</span> &nbsp;nRecNo <span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">"was deleted by other app and ADORDD cant reposition "</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> HB_SUCCESS<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> VALTYPE<span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_RECCOUNT <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"U"</span> <span style="color: #B900B9;">//initialize</span><br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_RECCOUNT <span style="color: #000000;">&#93;</span> := nReccount<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> HB_SUCCESS<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// NEW RECORDS ADDED BY OTHERS?</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> aWAData<span style="color: #000000;">&#91;</span> WA_RECCOUNT <span style="color: #000000;">&#93;</span> < nReccount <span style="color: #B900B9;">//only new records</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//PAY ATTENTION TO ADOWHERECLAUSE AND SET RECORDSET OPEN WHERE CLAUSE BECAUSE THE NEW RECORD MIGHT NOT BE VISIBLE!</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ADO_REQUERY<span style="color: #000000;">&#40;</span> nWA , aWAData<span style="color: #000000;">&#91;</span> WA_RECORDSET <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_LREQUERY <span style="color: #000000;">&#93;</span> := .T. <span style="color: #B900B9;">//already requeried set to .f.</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//re initialize</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_RECCOUNT <span style="color: #000000;">&#93;</span> := nReccount<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ADO_GOTO<span style="color: #000000;">&#40;</span> nWA, nRecNo <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> aWAData<span style="color: #000000;">&#91;</span> WA_RECORDSET <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// record does not exist anymore other app delete it!</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">THROW</span><span style="color: #000000;">&#40;</span> ErrorNew<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADORDD"</span>, <span style="color: #000000;">10002</span>, <span style="color: #000000;">10002</span>, <span style="color: #ff0000;">"Record move "</span>+aWAData <span style="color: #000000;">&#91;</span> WA_TABLENAME<span style="color: #000000;">&#93;</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;STR<span style="color: #000000;">&#40;</span> &nbsp;nRecNo <span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">"was deleted by other app and ADORDD cant reposition "</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> HB_SUCCESS</div>[/code:2gk8js6u] Salu2
ADO RDD xHarbour
Así que intenté poner SKIP 0 y GO TOP después de escribir el registro y no actualiza xbrowse en el otro. También intente actualizar xbrowse y no aparece, solo aparece el registro nuevo en el sistema que lo lanzó, en el otro no aparece.
ADO RDD xHarbour
Intenta contactar con el autor de la clase. Quizá él pueda dar alguna pauta
ADO RDD xHarbour
Gemtleman I have been using ( plain ) ADO ( class and methods ) for many years .. 32 and 64 bits ... Have a look in the samples folder and compile AdoRick.prg .. Uses all the Fivewin code .. xbrowse, panels, folders ... etc. You can use ADO to connect to MS Sql Server, MS Access and ( most ) all the other Sql databases as well ... Rao has made the ADO connection syntax with many FiveWin wrappers .. Look in the \source\functions\adofuncs.prg .. Thanks Rick Lipkin
ADO RDD xHarbour
[quote="Otto":10iinzd9]Marc, Do you also have speed problems on the PC where you saved your DBF files. Regards, Otto[/quote:10iinzd9] No, On the pc with the dbf's the program is ok. On the peer to peer (like it is) speed improvement would be nice. But I can absolutely be a issue of hardware / settings on de pc's.. I'm not a IT guy.... So I take a PC out of the box, connect it to the netwerk and have a //PCMARC//.... path I have I7 an I5, SSD and 1000 g/Network
ADO RDD xHarbour
Marc, use your software form the other PCs with RDP. Best regards, Otto
ADO RDD xHarbour
To All As far as updating any .dbf record ... I use goto Recno() .. that in many cases mimics dbCommit() .. goto Recno() forces the record pointer to move albeit .. back to itself. Rick Lpkin
ADO RDD xHarbour
Resolvido, com a ajuda do AHF, descobri que na função do ADORECCOUNT não estava definido o MYSQL. Adicionei o aAWData[ WA_ENGINE ]== "MYSQL" no final do primeiro IF. Obrigado. [code=fw:xi793poa]<div class="fw" id="{CB}" style="font-family: monospace;">   <span style="color: #B900B9;">// 30.06.15</span><br />   <span style="color: #00C800;">IF</span> aAWData<span style="color: #000000;">&#91;</span> WA_ENGINE <span style="color: #000000;">&#93;</span> = <span style="color: #ff0000;">"ACCESS"</span> .OR. aAWData<span style="color: #000000;">&#91;</span> WA_ENGINE <span style="color: #000000;">&#93;</span> = <span style="color: #ff0000;">"SQLITE"</span> .OR.;<br />      aAWData<span style="color: #000000;">&#91;</span> WA_ENGINE <span style="color: #000000;">&#93;</span> = <span style="color: #ff0000;">"FIREBIRD"</span> .OR. aAWData<span style="color: #000000;">&#91;</span> WA_ENGINE <span style="color: #000000;">&#93;</span>== <span style="color: #ff0000;">"POSTGRE"</span> .OR.;<br />      aAWData<span style="color: #000000;">&#91;</span> WA_ENGINE <span style="color: #000000;">&#93;</span>== <span style="color: #ff0000;">"ORACLE"</span> .OR. aAWData<span style="color: #000000;">&#91;</span> WA_ENGINE <span style="color: #000000;">&#93;</span>== <span style="color: #ff0000;">"MYSQL"</span> <span style="color: #B900B9;">// ADICIONADO MYSQL</span><br />      <span style="color: #B900B9;">//6.08.15 ONLY WITH ACCESSIT TAKES LONGER IN BIG TABLES</span><br />      cSql := <span style="color: #ff0000;">"SELECT MAX("</span>+<span style="color: #000000;">&#40;</span> ADO_GET_FIELD_RECNO<span style="color: #000000;">&#40;</span> aAWData<span style="color: #000000;">&#91;</span>WA_TABLEINDEX<span style="color: #000000;">&#93;</span>  <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">")+1 FROM "</span>+aAWData<span style="color: #000000;">&#91;</span>WA_TABLENAME<span style="color: #000000;">&#93;</span><br /><br />   ELSEIF aAWData<span style="color: #000000;">&#91;</span> WA_ENGINE <span style="color: #000000;">&#93;</span> = <span style="color: #ff0000;">"MSSQL"</span><br />      cSql := <span style="color: #ff0000;">"SELECT IDENT_CURRENT('"</span>+aAWData<span style="color: #000000;">&#91;</span>WA_TABLENAME<span style="color: #000000;">&#93;</span>+<span style="color: #ff0000;">"')+1 AS AUTO_INCREMENT"</span><br /><br />   <span style="color: #00C800;">ELSE</span><br />      <span style="color: #B900B9;">//30.06.15 REPLACED BY RAO NAGES IDEA next incremente key</span><br />      cSql := <span style="color: #ff0000;">"SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES"</span>+;<br />              <span style="color: #ff0000;">" WHERE TABLE_SCHEMA = '"</span>+aAWData<span style="color: #000000;">&#91;</span> WA_CATALOG <span style="color: #000000;">&#93;</span>+<span style="color: #ff0000;">"' AND TABLE_NAME = '"</span>+aAWData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span>+<span style="color: #ff0000;">"'"</span><br />   <span style="color: #00C800;">ENDIF</span></div>[/code:xi793poa]
ADO RDD xHarbour
Does anyone know if there is any way to increase the conversion speed of hb_adoupload?
ADO RecordSet Fetch() ?
Hi, I use ODBC in my programs to connect to database and want to change it and use ADO Is there a method Fetch() In ADODB.Recordset I want to execute sql but fetching records manyaly one by one. AND PLEASE ... Where i can find manual about all methods and DATA variables for ADODB.Recordset and ADODB.Connection Best regards,
ADO RecordSet Fetch() ?
Avista Here is the Wiki on using ADO and Fivewin that many of our friends have contributed .. <!-- m --><a class="postlink" href="http://wiki.fivetechsoft.com/doku.php?id=ado-related_stuffs">http://wiki.fivetechsoft.com/doku.php?i ... ted_stuffs</a><!-- m --> To Answer your question .. Fetch() is not a method ( as far as I know ) .. Here are the most common methods and their xBase counter parts .. [code=fw:1v1saruk]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Append --> oRecordSet:<span style="color: #000000;">AddNew</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />Close --> oRecordSet:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />Commit --> oRecordSet:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />Delete --> oRecordSet:<span style="color: #000000;">Delete</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />Deleted<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> --> oRecordSet:<span style="color: #000000;">Status</span> == adRecDeleted<br />EOF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> --> oRecordSet:<span style="color: #000000;">EOF</span> or oRecordSet:<span style="color: #000000;">AbsolutePosition</span> == <span style="color: #000000;">-3</span><br />Field<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> --> oRecordSet:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> nField - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Name</span>, :<span style="color: #000000;">Value</span>, :<span style="color: #000000;">Type</span><br />FCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> --> oRecordSet:<span style="color: #000000;">Fields</span>:<span style="color: #0000ff;">Count</span><br />GoTop --> oRecordSet:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />GoBottom --> oRecordSet:<span style="color: #000000;">MoveLast</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />Locate --> oRecordSet:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span> cFor, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lContinue, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />Open --> oRecordSet:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cQuery, hConnection <span style="color: #000000;">&#41;</span><br />OrdListClear<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> --> oRecordSet:<span style="color: #0000ff;">Index</span> := <span style="color: #ff0000;">""</span><br />RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, LastRec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> --> oRecordSet:<span style="color: #000000;">RecordCount</span><br />RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> --> oRecordSet:<span style="color: #000000;">AbsolutePosition</span><br />Skip --> oRecordSet:<span style="color: #000000;">MoveNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:1v1saruk] Here is the official Microsoft page on Ado methods.. <!-- 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
ADO RecordSet Fetch() ?
thanks regards
ADO RecordSet Fetch() ?
Avista: An other one <!-- m --><a class="postlink" href="http://www.w3schools.com/ado/">http://www.w3schools.com/ado/</a><!-- m --> Best regards
ADO RecordSet Fetch() ?
Avista .. Please send me your Mail.
ADO RecordSet Fetch() ?
Adolfo, This is my e-mail <!-- e --><a href="mailto:sunrised@t-home.mk">sunrised@t-home.mk</a><!-- e --> Regards,
ADO RecordSet Fetch() ?
This is what i am doing usung tOdbc and tDbOdbcd classes [code=fw:28i6v7do]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oOdbc := TOdbc<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> sConnectionString <span style="color: #000000;">&#41;</span><br />cSql  := <span style="color: #ff0000;">"SELECT * FROM MyTable"</span><br />oDbf  := TDbOdbcDirect<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> cSql, oOdbc <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">IF</span> lAutoComplete <span style="color: #B900B9;">// Fill all records</span><br />   oDbf:<span style="color: #000000;">Complete</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> <span style="color: #00C800;">ELSE</span><br />   <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> .t.<br />      <span style="color: #00C800;">IF</span> oDbf:<span style="color: #000000;">Fill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Fill one record</span><br />         nRecords := nRecords + <span style="color: #000000;">1</span><br />         oSayRecords:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span>ALLTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>nRecords<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />       <span style="color: #00C800;">ELSE</span><br />         EXIT<br />      <span style="color: #00C800;">ENDIF</span><br /><br />      <span style="color: #00C800;">IF</span> lBreak<br />         <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Break by user"</span><span style="color: #000000;">&#41;</span><br />         EXIT<br />      <span style="color: #00C800;">ENDIF</span><br />   <span style="color: #00C800;">ENDDO</span><br /><span style="color: #00C800;">ENDIF</span><br /> </div>[/code:28i6v7do] HOW TO DO THIS using ADO Rick: Fetch() is method from tOdbc class which using SqlFetch() fill one records from executed SQL I need something similar using ADO Best regards,
ADO RecordSet Fetch() ?
PLEASE i need some sugestions about this ... Why i need this For example if i use sql "SELECT * FROM MyTable" and MyTable have 15.000.000 records I want to have a view while collecting (importing) data and chance to break it Best regards,
ADO RecordSet Fetch() ?
Avista [quote:3a1qxujl] Why i need this For example if i use sql "SELECT * FROM MyTable" and MyTable have 15.000.000 records I want to have a view while collecting (importing) data and chance to break it [/quote:3a1qxujl] You are correct .. it becomes 'expensive' to open a Sql table with "Select * From Table" .. Generally, you open a table looking for a set of records that pertain to a certain criteria such as between two dates dDate1 := ctod("01/10/2013") dDate2 := Date() cSql := "Select * from [Table] where [DateField] >= '"+dtoc(dDate1)+"'" cSql += " and [DateField] <= "'"+dtoc(dDate2)+"'" or If you just want to open a blank recordset knowing you are going to Add records to it you can do it like this: cSql := "Select * from [Table] where 1 = 2" // will never be true so it opens an empty recordset Lots of possibilities! Rick Lipkin
ADO RecordSet Fetch() ?
Rick, Thanks for reply in this case dDate1 >= ctod("01/01/2013") user can by mistake write "01/01/2003" so all record will be selected that will be going too long and user dont know if program is working or is blocked becouse of that i need solution liike in my source sample in reply before ... if using odbc using Fetch() and collecting records one by one second reason is that i want to have a view while collecting and have chance to break it for example [code=fw:29eefcwi]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> .t.<br />      <span style="color: #00C800;">IF</span> oDbf:<span style="color: #000000;">Fill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Fill one record</span><br />         nRecords := nRecords + <span style="color: #000000;">1</span><br />         oSayRecords:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span>ALLTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>nRecords<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />       <span style="color: #00C800;">ELSE</span><br />         EXIT<br />      <span style="color: #00C800;">ENDIF</span><br /><br />      <span style="color: #00C800;">IF</span> lBreak<br />         <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Break by user"</span><span style="color: #000000;">&#41;</span><br />         EXIT<br />      <span style="color: #00C800;">ENDIF</span><br />   <span style="color: #00C800;">ENDDO</span></div>[/code:29eefcwi] IF i use cSql := "Select * from [Table] where 1 = 2" How i can adding records one by one PLEASE some sample if it is possible (if it is possible probably that is what i need) Thanks a lot Regards,
ADO RecordSet Fetch() ?
There is no way to read and add records one by one to a recordset in ADO. We open RecordSet once and all records matching the Query are read into the recordset. If we expect that the Query may result in too many records, then specify oRs:MaxRecords := <yourlimit> and then open the recordset. If oRs:RecordCount() < oRs:MaxRecords then we know all records are read and if not there are more rows meeting the criteria that are not read. In such a case we may narrow down the where clause or take any other appropriate action. Example: oRs := TOleAuto():New( "ADODB.RecordSet" ) oRs:MaxRecords := 1000 <other clauses> oRs:Open( .... ) if oRs:RecordCount() < oRs:MaxRecords // oRs contains all records else // oRs contains only part and there are more records meeting the criteria endif This is equivalent to "SELECT TOP <n> ...." query, but the SQL query syntax is different for different DBMS.
ADO RecordSet Fetch() ?
Rao Thanks for reply One more question Is it possible to define a TIMER and every second read value from oRs:RecordCount() before collecting is finished and dysplay it on the screen and if nned to execute oRs:Close() before collecting is finished If it is possible will be a good tip Best regards,
ADO RecordSet Fetch() ?
Yes, atleast theoritically. When we open a RecordSet, we can specify adAsyncFetch ( value is 32 ) by or'ing it with nOption parameter. Then after reading first batch of records ( set by us in oRs:CatcheSize ), rest of the records are read and added to the recordset Asynchronously. We can also examine the events generated to asertain the number of records read so far and if the entire recordset is fetched. It should be easy to do it with VB, VC# etc. I said "theoritically", because I tried long ago but could not make it work with Harbour code. I too am interested to learn if any other friends have done it with (x)Harbour. Through this posting I request our friends to try and educate us if they succeed. For further information please refer <!-- m --><a class="postlink" href="http://www.w3schools.com/ado/ado_ref_recordset.asp">http://www.w3schools.com/ado/ado_ref_recordset.asp</a><!-- m -->
ADO RecordSet Fetch() ?
I have try to define TIMER But not success Nothing is working until [b:1kax5rnc]oRs:Open()[/b:1kax5rnc] finish. That is big problem becouse user dont know is program working or it is blocked. Probably [b:1kax5rnc]adAsyncFetch[/b:1kax5rnc] combined with [b:1kax5rnc]oRs:CatcheSize[/b:1kax5rnc] can give results but i have no idea what to do. I have readed many forums about this but found nothing useful. I think Rick and Rao have most expperiance with ADO and i please too Antonio, Enrico ... and all others to help Best regards,
ADO RecordSet Fetch() ?
We can forget about adAsyncFetch. This does not work with C. This and ADO event handling is possible only with VB etc and not with normal C. Let us address your issue. Normally opening a client side recordset should not take unduly long time as long as we judiciously select the size of the the data to be read. Still if you want to mimic the ODBC fetch() record by record and then copy into your own memory, I suggest the following way: Open serverside recordset with adOpenForwardOnly and adLockReadOnly. Keep reading the recordset as and when you need and copy to your memory ( array or whatever you were using with ODBC ). This is the fastest cursor possible. Example: I assume you have already opened the connection. [code=fw:1jmaoubo]<div class="fw" id="{CB}" style="font-family: monospace;">oRs   := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.RecordSet"</span> <span style="color: #000000;">&#41;</span><br /><br />WITH OBJECT oRs<br />   :<span style="color: #000000;">Source</span>           := <your sql statement><br />   :<span style="color: #000000;">ActiveConnection</span> := oCn<br />   :<span style="color: #000000;">CursorLocation</span>   := <span style="color: #000000;">2</span>  <span style="color: #B900B9;">// adUseServer</span><br />   :<span style="color: #000000;">LockType</span>         := <span style="color: #000000;">1</span>  <span style="color: #B900B9;">// adLockReadOnly</span><br />   :<span style="color: #000000;">CursorType</span>       := <span style="color: #000000;">0</span>  <span style="color: #B900B9;">// adOpenForwardOnly</span><br />   <span style="color: #B900B9;">//</span><br />   :<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />END<br /> </div>[/code:1jmaoubo] Whenever you want to fetch a record, execute code something like this: if oRs:Eof() // Already fetched all records. No more records else for n := 1 to oRs:Fields:Count() aRow[ n ] := oRs:Fields( n - 1 ):Value next n AAdd( aData, aRow ) oRs:MoveNext() endif If you like, I give you here a shortcut code for the above: [code=fw:1jmaoubo]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">if</span> ! oRs:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   AAdd<span style="color: #000000;">&#40;</span> aData, oRs:<span style="color: #000000;">GetRows</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">endif</span><br /> </div>[/code:1jmaoubo] With this you can do what you were doing using ODBC fetch() method. My personal opinion is that you should stop thinking the ODBC way and start thinking the ADO way, same way as we should stop thinking the DBF way and start thinking the RDBMS way when we move to Relational Database systems.
ADO RecordSet Fetch() ?
Rao, Thanks so myuch, you are right I have one more quewstion (problem) with ERROR object of oRs:Open() oErr:Description always return DISP_E_UNKNOWNNAME and oErr:Number, oErr:Source, oErr:NativeError... dont exist. oErr:modulename return nothing empty string oErr:osthreadid return 0 oErr:procline return 0 oErr:procname return TOLEAUTO:OPEN oErr:runningthreads return 0 oErr:vmthreadid return 0 Please some sugestion how to detect the error returned from server. I use Informix database Best Regards,
ADO RecordSet Fetch() ?
Harbour shows the Ado Error correctly. xHarbour does not. I suggest you use FWH function FW_ShowAdoError( oCn ), where oCn is the connection object. TRY oRs:Open( .... ) CATCH FW_ShowAdoError( oCn ) << decide what to do >> END
ADO RecordSet Fetch() ?
Rao, In which version of fwh is addes function FW_ShowAdoError() I still use 13.03 [quote:n82ualmk]Harbour shows the Ado Error correctly. xHarbour does not.[/quote:n82ualmk] This mean that if i move to harbour from xharbour will work ok ? If yes can i use FWH + bcc582 or i must use something else MSVC or ? What kindd of changes i must to do if i move to harbour in my source ? What is better choice xharbour or harbour ? Global WHAT is the diference between harbour and xharbour ? Best best regards,
ADO RecordSet Fetch() ?
The function FW_ShowAdoError() was first included in FWH 13.05. The logic is well known to all users and it should be fine for me to share the code here. You may even find the main part of this code already posted in these forums [code=fw:1efo5am4]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> FW_ShowAdoError<span style="color: #000000;">&#40;</span> oCn, lSilent <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nErr, oErr, cErr<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lSilent := .f.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> nErr := oCn:<span style="color: #000000;">Errors</span>:<span style="color: #0000ff;">Count</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; oErr &nbsp;:= oCn:<span style="color: #000000;">Errors</span><span style="color: #000000;">&#40;</span> nErr - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! lSilent<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WITH OBJECT oErr<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cErr &nbsp; &nbsp; := oErr:<span style="color: #000000;">Description</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cErr &nbsp; &nbsp; += CRLF + <span style="color: #ff0000;">'Source &nbsp; &nbsp; &nbsp; : '</span> + oErr:<span style="color: #000000;">Source</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cErr &nbsp; &nbsp; += CRLF + <span style="color: #ff0000;">'NativeError &nbsp;: '</span> + cValToChar<span style="color: #000000;">&#40;</span> oErr:<span style="color: #000000;">NativeError</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cErr &nbsp; &nbsp; += CRLF + <span style="color: #ff0000;">'Error Source : '</span> + oErr:<span style="color: #000000;">Source</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cErr &nbsp; &nbsp; += CRLF + <span style="color: #ff0000;">'Sql State &nbsp; &nbsp;: '</span> + oErr:<span style="color: #000000;">SQLState</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cErr &nbsp; &nbsp; += CRLF + Replicate<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'-'</span>, <span style="color: #000000;">50</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cErr &nbsp; &nbsp; += CRLF + ProcName<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"( "</span> + cValToChar<span style="color: #000000;">&#40;</span> ProcLine<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" )"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgAlert<span style="color: #000000;">&#40;</span> cErr, IfNil<span style="color: #000000;">&#40;</span> oCn:<span style="color: #000000;">Provider</span>, <span style="color: #ff0000;">"ADO ERROR"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;END<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADO ERROR UNKNOWN"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> oErr<br />&nbsp;</div>[/code:1efo5am4] You may include this function in your libraries. You may even modify as you like. For this purpose alone you need consider changing (x)Harbour. Which is better is better explained by friends who are more knowledgeable than me. I work with both xHarbour and Harbour for testing my contributions to FWH library. Personally I still continue to use bcc582. For my personal software work using ADO, I still continue xHarbour. There is some functionality available in xHarbour but not in Harbour and I need that for some advanced usage of ADO. I am waiting for Harbour to provide similar functionality.
ADO RecordSet Fetch() ?
Rao, Rick, ... Many thanks for reply and help Many thanks to Adolfo for great manual which he send to me for ADO 2.8 i think someone need to put this manual on place where everyone can download it Best regards to all
ADO RecordSet Fetch() ?
Hello, You can sent it to <!-- e --><a href="mailto:alinares@fivetechsoft.com">alinares@fivetechsoft.com</a><!-- e --> so he could upload to contributions. Many thanks.
ADO RecordSet Fetch() ?
Thanks Already sent Regards,
ADO RecordSet open error
Does anyone know why I am getting this error? [code=fw:113g9l7s]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; oRs:= createObject<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ADODB.RecordSet"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> valtype<span style="color: #000000;">&#40;</span>oRS<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// returns "O"</span><br />&nbsp; &nbsp;oRs:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;I <span style="color: #0000ff;">get</span> this error <span style="color: #0000ff;">on</span> the last line above:<br /><br />&nbsp; &nbsp;<span style="color: #000000;">Error</span> description: <span style="color: #000000;">Error</span> ADODB.RecordSet/<span style="color: #000000;">6</span> &nbsp;DISP_E_UNKNOWNNAME: <span style="color: #000000;">OPEN</span></div>[/code:113g9l7s] I am using FWH ver 10.3 with xHarbour. Regards, James
ADO RecordSet open error
James Start here when you define your object .. then you can add additional parameters as I have .. I would definitly use the local cache option when you create your recordset .. being local makes listboxes just really fast. Rick Lipkin [code=fw:36szsz4h]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRs := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:36szsz4h] [code=fw:36szsz4h]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cSQL := <span style="color: #ff0000;">"SELECT * from GAS where AGENEID = '"</span>+xAGENEID+<span style="color: #ff0000;">"' order by DATE,LICENSE desc"</span><br /><br />oRs := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />oRs:<span style="color: #000000;">CursorType</span> &nbsp; &nbsp; := <span style="color: #000000;">1</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// opendkeyset</span><br />oRs:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// local cache</span><br />oRs:<span style="color: #000000;">LockType</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">3</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// lockoportunistic</span><br /><br /><span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp;oRs:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cSQL,<span style="color: #ff0000;">'Provider='</span>+xPROVIDER+<span style="color: #ff0000;">';Data Source='</span>+xSOURCE+<span style="color: #ff0000;">';Initial Catalog='</span>+xCATALOG+<span style="color: #ff0000;">';User Id='</span>+xUSERID+<span style="color: #ff0000;">';Password='</span>+xPASSWORD <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />&nbsp; &nbsp;<span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening GAS table"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br />&nbsp;</div>[/code:36szsz4h]
ADO RecordSet open error
Mr. Rick When CursorLocation is 3 ( adUseClient) the RecordSet is always opened as Static. No use specifying keyset or dynamic. After opening please check ? oRs:CursorType.
ADO RecordSet open error
Mr James For opening recordset, minimum *two things should be specified. 1. Source ( Sql statement, Table name, URL ). In our case mostly sql statement 2. Either connection object or connection string. Either we can specify then initially: oRs:Source := <sql statement> oRs:ActiveConnection := oCon and then oRs:Open() .. works Or oRs:Open( <cSqlStatement>, <ConnObject>/<ConnString> ) also works. Please review testxbr3.prg. Opens connection to Access database ( test.mdb ) in the \fwh\samples folder and opens recordsets.
ADO RecordSet open error
Rao, I have tried testxbr3.prg and it works fine. This is using an Access database. I note that this code calls oRs:Open() without any parameters and it doesn't error out. The other test code you provided is using a DBF database. This is the one that errors out on the oRs:Open() call (with or without parameters). James
ADO RecordSet open error
I have to open Access databases and Progress databases. I get that error if I get the connect string wrong or the DSN entry is wrong. Those semicolons and sometimes spaces really mean something. Here is a DSN-less connect string I use for an Access database that does not need username and password. cConnectString := [DRIVER={Microsoft Access Driver (*.mdb)};dbq=\\Trg210\webcenter\Database\webcenter40.mdb;] cSqlString := [Select * From Customers Where Customers.Active ='Yes' AND Customers.Customer_Username = 'gale'] oRecordSet := CreateObject( "ADODB.Recordset" ) oRs := oRecordSet:Open( cSqlString, cConnectString, 0, 1 )
ADO RecordSet open error
Gale, I is not the connection that is the problem. The problem turns out to be that the WHERE clause in the SELECT statement is causing the crash. For more details see this thread. <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=19334&start=30">viewtopic.php?f=3&t=19334&start=30</a><!-- l --> Rao, is not having the same problem. We have not figured out why I am. Thanks for the suggestions. James
ADO RecordSet open error
[quote="James Bott":37j4p8oe]Does anyone know why I am getting this error?[/quote:37j4p8oe] Can you show the exact sample you are trying? EMG
ADO RecordSet open error
Enrico, It is in the third message on this page: <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=19334&start=30">viewtopic.php?f=3&t=19334&start=30</a><!-- l --> James
ADO RecordSet open error
Your sample works fine here as it is. EMG
ADO RecordSet open error
James: Just an idea, do have the ado heder included ? #Include "Ado.ch" Regards
ADO RecordSet open error
Armando, I didn't have the ado.ch header included, but I just added it and I still get the same error. Thanks for the idea. James
ADO RecordSet open error
[quote="James Bott":bvf9uyk8]Armando, I didn't have the ado.ch header included, but I just added it and I still get the same error. Thanks for the idea. James[/quote:bvf9uyk8] including or not including ado.ch does not make any difference because the program does not use any constants defined in the ado.ch. ado.ch contains just definitions of constants. The issue is : No problem with connection. Connection is getting established. Even recordset can be opened as long as sql statement does not contain 'WHERE' or 'ORDER' clause. The reasons to be found is why WHERE and ORDER clauses are failing and that too only on Mr. James PC.
ADO RecordSet open error
Rao, Actually, the ORDER clause is working. That error was caused by a syntax error on my part. Only the WHERE clause is not working. James
ADO RecordSet to DBF
Hi all, I need help how to create DBF file and insert data from ADO Recordset Best regards,
ADO RecordSet to DBF
Avista Here is the psudo code .. 1) Create your .dbf 2) Open your recordset ... [code=fw:2pnkl73d]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRs:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Do</span> <span style="color: #00C800;">While</span> .not. oRs:<span style="color: #000000;">Eof</span><br />      <br />     <span style="color: #0000ff;">Select</span> <span style="color: #000000;">1</span><br />     Append Blank<br /><br />     a->Field1 := oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Field1"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br />     a->Field2 := oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Field2"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br /><br />     oRs:<span style="color: #000000;">MoveNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Enddo</span><br /><br />CLose Databases<br />oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:2pnkl73d] Rick Lipkin
ADO RecordSet to DBF
Rick, Thanks for reply, [quote:2ud58ilj]1) Create your .dbf[/quote:2ud58ilj] That is my problem ... i cant create .DBF becouse i dont know fields ... becouse RecordSet is openet berore that and contains data from executed SQL I want to export data from opened recordset to .dbf file So i mean to read first the fields from recordset, (filedname, fieldtype, fieldlen, fielddec ) and after that to create .dbf and insert data in .dbf file Any solution please ? Best regards,
ADO RecordSet to DBF
FWH already provides a ready made function for this. FW_AdoExportToDBF( oRs, cDbf, lEditStruct )
ADO RecordSet to DBF
Rao Thanks for reply [quote:gs83syox]FWH already provides a ready made function for this. FW_AdoExportToDBF( oRs, cDbf, lEditStruct )[/quote:gs83syox] I have seen on this forum that this functuins are includer in version 13.08 I still use 13.04 and not ready in this moment to change version and test apps <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=28708&start=30">viewtopic.php?f=3&t=28708&start=30</a><!-- l --> [quote:gs83syox] Re: DBF to SQL script tool New postby nageswaragunupudi » Fri Jul 11, 2014 2:37 am Mr Hakan ONEMLI FWH Ado functions work for Access, MS Sql, MySql, Oracle and SQLite3. Regards G. N. Rao. Hyderabad, India nageswaragunupudi [/quote:gs83syox] BTW I use Informix and i am not ready now to test it. [b:gs83syox]Can i find the source of functions:[/b:gs83syox] function FWAdoDelRecord( oRs ) --> lSuccess function FWAdoFieldType( oRs, n ) --> cType (xbase type) function FWAdoFieldDec( oRs, n ) --> nDecs (xbase) function FWAdoFieldSize( oRs, n ) --> nSize (xbase) function FWAdoLoadRecord( oRs ) --> aRecord function FWAdoSaveRecord( oRS, aRecord, nRecNo ) --> nil function FWAdoStruct( oRs ) --> aStruct function FWAdoFieldStruct( oRs, n/cname/ofield) or (oField) -> field strut info { cName, cDbtype, nDblen, nDbdec, nAdotype, lReadwrite } function FW_AdoExportToDBF( oRs, cDbfName, [lEditStruct] ) --> lSuccess Best regards,
ADO RecordSet to DBF
Understand. We might consider expanding the coverage to other SQL DBMSs depending on the users' requirements.
ADO RecordSet to DBF
Thanks Rao [quote:1i36gxcg]Understand. We might consider expanding the coverage to other SQL DBMSs depending on the users' requirements.[/quote:1i36gxcg] [b:1i36gxcg]But please any other solution or Can i find the source of functions:[/b:1i36gxcg] function FWAdoDelRecord( oRs ) --> lSuccess function FWAdoFieldType( oRs, n ) --> cType (xbase type) function FWAdoFieldDec( oRs, n ) --> nDecs (xbase) function FWAdoFieldSize( oRs, n ) --> nSize (xbase) function FWAdoLoadRecord( oRs ) --> aRecord function FWAdoSaveRecord( oRS, aRecord, nRecNo ) --> nil function FWAdoStruct( oRs ) --> aStruct function FWAdoFieldStruct( oRs, n/cname/ofield) or (oField) -> field strut info { cName, cDbtype, nDblen, nDbdec, nAdotype, lReadwrite } function FW_AdoExportToDBF( oRs, cDbfName, [lEditStruct] ) --> lSuccess or sample .PRG for my case how to detect type, size, dec ...for fields Best regards,
ADO RecordSet to DBF
Rick, Rao, anyone ? Any sugestion please ? REgards,
ADO RecordSet to DBF
Look <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=19&t=27296#p151744">viewtopic.php?f=19&t=27296#p151744</a><!-- l --> <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=19&t=27296&start=15#p151819">viewtopic.php?f=19&t=27296&start=15#p151819</a><!-- l -->
ADO RecordSet to DBF
Navarro thanks for reply I urgent need the source of function [b:e9u9wag2]FW_AdoExportToDBF( oRs, cDbfName, [lEditStruct] )[/b:e9u9wag2] or same similar source sample Best regards,
ADO RecordSet to DBF
[quote="avista":211guxk9]Rao Thanks for reply [quote:211guxk9]FWH already provides a ready made function for this. FW_AdoExportToDBF( oRs, cDbf, lEditStruct )[/quote:211guxk9] I have seen on this forum that this functuins are includer in version 13.08 I still use 13.04 and not ready in this moment to change version and test apps <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=28708&start=30">viewtopic.php?f=3&t=28708&start=30</a><!-- l --> [quote:211guxk9] Re: DBF to SQL script tool New postby nageswaragunupudi » Fri Jul 11, 2014 2:37 am Mr Hakan ONEMLI FWH Ado functions work for Access, MS Sql, MySql, Oracle and SQLite3. Regards G. N. Rao. Hyderabad, India nageswaragunupudi [/quote:211guxk9] BTW I use Informix and i am not ready now to test it. [b:211guxk9]Can i find the source of functions:[/b:211guxk9] function FWAdoDelRecord( oRs ) --> lSuccess function FWAdoFieldType( oRs, n ) --> cType (xbase type) function FWAdoFieldDec( oRs, n ) --> nDecs (xbase) function FWAdoFieldSize( oRs, n ) --> nSize (xbase) function FWAdoLoadRecord( oRs ) --> aRecord function FWAdoSaveRecord( oRS, aRecord, nRecNo ) --> nil function FWAdoStruct( oRs ) --> aStruct function FWAdoFieldStruct( oRs, n/cname/ofield) or (oField) -> field strut info { cName, cDbtype, nDblen, nDbdec, nAdotype, lReadwrite } function FW_AdoExportToDBF( oRs, cDbfName, [lEditStruct] ) --> lSuccess Best regards,[/quote:211guxk9] They are all functions in the later versions of FWH and the proper way to get the source code of these functions is by upgrading FWH. FWH being a priced product, we can not share the source code of FWH libraries freely over the forum or otherwise. But the above functions are not really difficult and one can write by himself.
ADO RecordSet to DBF
Avista, We can help you with FW_AdoExportToDBF() (I will check it with Rao and I may send you some code by email) but as Rao has clearly explained to you, if you want to use the result of our hard work, you should upgrade your FWH version, thanks for understanding it.
ADO RecordSet to DBF
You can keep using FWH 13.04, upgrade to FWH 14.06, copy the required functions that you need and continue using 13.04. I am sure that you also ask your customers to get paid by your work <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
ADO RecordSet to DBF
Thanks to all In start i only asked how to detect from ado recordset [quote:1wc3u31t]filedname, fieldtype, fieldlen, fielddec[/quote:1wc3u31t] I use informix [quote:1wc3u31t]Re: DBF to SQL script tool New postby nageswaragunupudi » Fri Jul 11, 2014 2:37 am Mr Hakan ONEMLI FWH Ado functions work for Access, MS Sql, MySql, Oracle and SQLite3. Regards G. N. Rao. Hyderabad, India nageswaragunupudi[/quote:1wc3u31t] [quote:1wc3u31t]Understand. We might consider expanding the coverage to other SQL DBMSs depending on the users' requirements. Regards G. N. Rao. Hyderabad, India[/quote:1wc3u31t] So probably FW_AdoExportToDBF( oRs, cDbfName, [lEditStruct] ) will not help for informix database [quote:1wc3u31t]But the above functions are not really difficult and one can write by himself. Regards G. N. Rao. Hyderabad, India[/quote:1wc3u31t] If possible i need some help about that how to write function which detect filedname, fieldtype, fieldlen, fielddec from ado recordset and after that i will create .dbf aind insert data from ado recordset. Antonio, If you can please send me some start sample source code <!-- e --><a href="mailto:sunrised@t-home.mk">sunrised@t-home.mk</a><!-- e --> Tnanks, Regards,
ADO RecordSet to DBF
Thanks, Possible help for now how to detect filedname, fieldtype, fieldlen, fielddec from ado recordset ? If no it is ok ...i will go back to ODBC for now <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> BEST best regards, Thanks
ADO RecordSet to DBF
[quote:2fjr8x3k]FWH Ado functions work for Access, MS Sql, MySql, Oracle and SQLite3. [/quote:2fjr8x3k] That means "all" functions in adofuncs.prg work for these DBMSs. Just a clarification. Many functions work for *all* DBMSs. For example, for creation of Table on DBMS, we need to know specific datatypes of the DBMS. Also if keywords are used as some field names we need to know how to quote such field names which conflict with keywords. This is different for different DBMSs. Except create table and sql generation functions, all pure ADO functions work for all DBMSs. In particular, Fw_OpenAdoConnection( cConnString ) FW_OpenRecordSet(...) And all function listed above in this post including FW_AdoExportToDBF(..) work for all DBMSs.
ADO RecordSet to DBF
oField := oRs:Fields( n ) // n is zero based or oField := oRs:Fields( "<fieldname>" ) Then oField:Name --> field name oField:Type --> Ado Type of the field as numeric You can find all ado field types here <!-- m --><a class="postlink" href="http://www.w3schools.com/asp/ado_datatypes.asp">http://www.w3schools.com/asp/ado_datatypes.asp</a><!-- m --> For character fields: oField:DefinedSize --> Field length For Numeric fields of type Decimal and Number: oField:Precision --> Length oField:NumericScale --> number of decimals For numeric fields like double, float, etc. we need to set Len and Dec on our own. If you go through METHOD SetColFromADO() in the xbrowse.prg you can find how to use all the above how to derive DBF style types, etc from the above information. This should be enough to answer all your questions.
ADO RecordSet: What is the best CursorType to use?
What is the most desirable cursor type to use while opening a Recordset in ADO? adOpenKeySet or adOpenDynaic or adOpenStatic? We almost always open RecordSet on client side, using CursorLocation as adUseClient (3) [u:1pjlktcq]Brief note on CursorLocation:[/u:1pjlktcq] It is not necessary that we specify "oRs:CursorLocation = adUseClient // 3 " everytime we open a recordset. If we set connection object's CursorLocation property to adUseClient, all recordsets opened with that connection are all by default clientside only. We save one line of code while opening every recordset. Even otherwise it is always desirable to set connection object's CursorLocation to adUseClient. We can not specify cursor location of recordset opened with methods like oCn:OpenSchema(...), oCn:Execute( cSql ), etc. It defaults to the cusrorlocation of the connection object. If we do not set oCn:CursorLocation to adUseClient, this recordset is opened on serverside and we can not navigate the recordset backwards and not all methods and data work like clientside recordset. [u:1pjlktcq]Back to CursorType:[/u:1pjlktcq] When we look around we see many postings setting custor type either to adOpenKeySet or adOpenDynamic but never adOpenForwardOnly or adOpenStatic. [quote:1pjlktcq]adOpenKeySet ( 1 ) keyset cursor. Like a dynamic cursor, except that you can't see records that other users add, although records that other users delete are inaccessible from your Recordset. Data changes by other users are still visible. adOpenDynamic ( 2 ) Uses a dynamic cursor. Additions, changes, and deletions by other users are visible, and all types of movement through the Recordset are allowed, except for bookmarks, if the provider doesn't support them. adOpenStatic ( 3 ) Uses a static cursor. A static copy of a set of records that you can use to find data or generate reports. Additions, changes, or deletions by other users are not visible. When we read the above descriptions we consider using one of them and never adOpenStatic. [/quote:1pjlktcq] But what we ignore is that when we open a recordset on the client-side, only permitted cursortype is adOpenStatic. Let us read this: [quote:1pjlktcq]Note: If the CursorLocation property is set to adUseClient, the only valid setting for the CursorType property is adOpenStatic. Note: No error will occur if an unsupported value is set, the provider will just change to a supported CursorType instead. [/quote:1pjlktcq] So whatever CursorType we specify adUseKeySet or adUseDynamic, expecting all those benefits described above, ADO will totally ignore our settings and open the recordset as adOpenStatic ONLY. After opening the recordset with any CursorType, if we ever care to query ? oRs:CursorLocation thee result will always be 3 (adOpenStatic). So why this useless and purposeless code oRs:CursorLocation := adOpenDynamic in our program, wasting oneline of code and about 40 keystrokes every time? [u:1pjlktcq]Isn't this better? [/u:1pjlktcq] Once set oCn:CursorLication := adUseclient // 3 and while opening recodsets, save time, energy, space and codesize (and that too with false expectations) by not specifying oRs:CursorLocation and oRs:CursorType. The recordset opened would be exactly the same as the one we open even after specifying them. When we open with connection string (not connection object) we need to specify cursorlocation, otherwise it will default to server-side cursor.
ADO RecordSet: What is the best CursorType to use?
NageswaraRao, [quote="nageswaragunupudi":2l6vjwug]Note: If the CursorLocation property is set to adUseClient, the only valid setting for the CursorType property is adOpenStatic.[/quote:2l6vjwug] You missed "Remote Data Service Usage". <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
ADO RecordSet: What is the best CursorType to use?
According to MSDN, RDS has been removed from Windows 8 and Windows Server 2012. The way to go now is WCFDS.