topic
stringlengths
1
63
text
stringlengths
1
577k
ADO RDD xHarbour
Antonio, I'm think the only low cost way to use ADO is through an RDD for it. If I'm startint from scratch or I have the process in a kind of Tdata object then pure ADO its ok but I think the big majority of Harbour users have still lots of "old" code thus it is very costly to adapt it. I'm not so aware how to write RDD's <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> .I'm checking adordd.prg but there are some things I do not know how they work. Is there some docs that can help me?
ADO RDD xHarbour
Antonio, lets do one thing. Go ahead and test it with some minor examples and I will help you from here. If you get blocked, I will help you how to solve it and you will start understading it. it is easier than it seems once you start working on it. And again, this could help lots of users. So surely others will help you <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Tomorrow I am flying to Barcelona and will stay busy for a week or so, I take my laptop with me and an android tablet to play with FiveTouch <!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) --> I will try to attend the forums and all of you, whenever I have some free time
ADO RDD xHarbour
Antonio, Agreed. I'm crossing my fingers. First I'm trying to connect to traditional DBF files. I have in Odbc UserDsn a VisualFoxpro driver. The properties are: "Microsoft FoxPro VFP Driver (*.dbf)" "DSN=DBF trial" "SourceDB="+folder with dbfs "Description=ODBC for ADO" "SourceType=DBF" "BackgroundFetch=Yes" "Exclusive=No" "Null=Yes" "Deleted=Yes" "Collate=Machine" "SetNoCountOn=No" My con string is : aWAData[ WA_CONNECTION ]:Open( "Provider=Microsoft.Jet.OLEDB.4.0;SourceDB=c:\dbfs" + ";Extended Properties=Microsoft foxpro VFP Driver (*.dbf);SourceType=DBF;User ID=;Password=;" ) It seems I get the connection. When I run oRecordSet:Open( aWAData[ WA_QUERY ] + aWAData[ WA_TABLENAME ], aWAData[ WA_CONNECTION ] ) I get this error: Args: [ 1] = C SELECT * FROM INSTALA [ 2] = O SELECT * FROM INSTALA argumentos { SELECT * FROM INSTALA, TOLEAUTO Object } descrição DISP_E_UNKNOWNNAME ficheiro <nenhuma> genCode 41: Unknown or reserved operação OPEN osCode (Não é erro do sistema operativo) severity 2 subCode 6 subSystem ADODB.Recordset tries 0 With or without path I get the same error. Shall I supply always path name in the fie string? With indexes the same? Besides this I notice there are missing some traditional RDD functions: OrdSetFocus() Recno() How do we implement Recno() in traditional SQLdatabases? Can I creat it like this: aMyFunc[ UR_ORDSETFOCUS ] := ( @ADO_ORDSETFOCUS() ) I assume that when callig OrdSetFocus() the ADO_ORDSETFOCUS() will execute.
ADO RDD xHarbour
I'm using xHarbour 30.09.2008 and FW 8 and ado.prg from harbour 3.0.0. I had to change in ado.prg win_OleCreateObject to CreateObject I make a connection ..... cStr := CFILEPATH(aOpenInfo[ UR_OI_NAME ]) cStr := SUBSTR(cStr,1,LEN(Cstr)-1) aWAData[ WA_CONNECTION ]:Open( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+cstr+; ";Extended Properties=dBASE IV;User ID=;Password=") ...... UR_SUPER_SETFIELDEXTENT( nWA, nTotalFields := oRecordSet:Fields:Count ) ..... Recordsetopen "SELECT * FROM [INSTALA.DBF] msginfo("Connected? "+cvaltochar(aWAData[ WA_CONNECTION ]:State= adStateOpen)) TRUE MSGINFO("NUMBER OF FIELDS "+STR(nTotalFields)) = 22 CORRECT FOR n := 1 TO nTotalFields aField := Array( UR_FI_SIZE ) [b:26olkfvu] aField[ UR_FI_NAME ] := oRecordSet:Fields( n - 1 ):Name[/b:26olkfvu] //ERROR LINE 428 aField[ UR_FI_TYPE ] := ADO_GETFIELDTYPE( oRecordSet:Fields( n - 1 ):Type ) aField[ UR_FI_TYPEEXT ] := 0 aField[ UR_FI_LEN ] := ADO_GETFIELDSIZE( aField[ UR_FI_TYPE ], oRecordSet:Fields( n - 1 ):DefinedSize ) aField[ UR_FI_DEC ] := 0 #ifdef UR_FI_FLAGS aField[ UR_FI_FLAGS ] := 0 #endif #ifdef UR_FI_STEP aField[ UR_FI_STEP ] := 0 #endif UR_SUPER_ADDFIELD( nWA, aField ) NEXT I get this error: Error description ================= Args: [ 1] = N 203000288 [ 2] = N 203000288 [ 3] = N 203000288 [ 4] = C 203000288 [ 5] = A 203000288 argumentos { 203000288, 0, 2, {00001564-0000-0010-8000-00AA006D2EA4}, } descrição Invoke failed ficheiro <nenhuma> genCode 1: EG_ARG operação __OLEINVOKEDISPATCH osCode (Não é erro do sistema operativo) severity 2 subCode 6001 subSystem BASE tries 0 ================= Stack Chamado de __OLEINVOKEDISPATCH(0) Chamado de (b)ADODB.RECORDSET.6.0:WRAPINTERFACE(801) Chamado de ADODB.RECORDSET.6.0:FIELDS(0) Chamado de ADO_OPEN(428) Chamado de DBUSEAREA(0) Used classes 25 TYPELIB 26 ENUMTYPEINFO 27 CONSTANTTYPEINFO 28 OBJECTTYPEINFO 29 INTERFACETYPEINFO 30 METHODTYPEINFO 31 ARGUMENTTYPEINFO 32 PROPERTYTYPEINFO 33 TOLEAUTO 34 OLEWRAPPER 35 ADODB.CONNECTION.6.0 36 {00000514-0000-0010-8000-00AA006D2EA4} 37 {00001550-0000-0010-8000-00AA006D2EA4} 38 {00001550-0000-0010-8000-00AA006D2EA4}._CONNECTION 39 {00001550-0000-0010-8000-00AA006D2EA4}.PROPERTIES 40 {00000504-0000-0010-8000-00AA006D2EA4} 41 {00001550-0000-0010-8000-00AA006D2EA4}.PROPERTY 42 {00000503-0000-0010-8000-00AA006D2EA4} 43 {00001550-0000-0010-8000-00AA006D2EA4}._RECORDSET 44 {00001556-0000-0010-8000-00AA006D2EA4} 45 {00001550-0000-0010-8000-00AA006D2EA4}.FIELDS 46 {00001564-0000-0010-8000-00AA006D2EA4} 47 {00001550-0000-0010-8000-00AA006D2EA4}.FIELD 48 {00001569-0000-0010-8000-00AA006D2EA4} 49 {00001550-0000-0010-8000-00AA006D2EA4}.ERRORS 50 {00000501-0000-0010-8000-00AA006D2EA4} 51 {00001550-0000-0010-8000-00AA006D2EA4}.ERROR 52 {00000500-0000-0010-8000-00AA006D2EA4} 53 {00001550-0000-0010-8000-00AA006D2EA4}._COMMAND 54 {986761E8-7269-4890-AA65-AD7C03697A6D} 55 {00001550-0000-0010-8000-00AA006D2EA4}._PARAMETER 56 {0000150C-0000-0010-8000-00AA006D2EA4} 57 {00001550-0000-0010-8000-00AA006D2EA4}.PARAMETERS 58 {0000150D-0000-0010-8000-00AA006D2EA4} 59 ADODB.RECORDSET.6.0 60 {00000535-0000-0010-8000-00AA006D2EA4} 61 {00001556-0000-0010-8000-00AA006D2EA4}._RECORDSET 62 {00001556-0000-0010-8000-00AA006D2EA4}.PROPERTIES 63 {00001556-0000-0010-8000-00AA006D2EA4}.PROPERTY 64 {00001556-0000-0010-8000-00AA006D2EA4}.FIELDS 65 {00001556-0000-0010-8000-00AA006D2EA4}.FIELD 66 {00001556-0000-0010-8000-00AA006D2EA4}.ERROR 67 ADOX.CATALOG.6.0 68 {00000602-0000-0010-8000-00AA006D2EA4} 69 {00000603-0000-0010-8000-00AA006D2EA4} 70 {00000603-0000-0010-8000-00AA006D2EA4}._CATALOG 71 {00000603-0000-0010-8000-00AA006D2EA4}.TABLES 72 {00000611-0000-0010-8000-00AA006D2EA4} 73 {00000603-0000-0010-8000-00AA006D2EA4}.PROCEDURES 74 {00000626-0000-0010-8000-00AA006D2EA4} 75 {00000603-0000-0010-8000-00AA006D2EA4}.PROCEDURE 76 {00000625-0000-0010-8000-00AA006D2EA4} 77 {00000603-0000-0010-8000-00AA006D2EA4}.VIEWS 78 {00000614-0000-0010-8000-00AA006D2EA4} 79 {00000603-0000-0010-8000-00AA006D2EA4}.VIEW 80 {00000613-0000-0010-8000-00AA006D2EA4} 81 {00000603-0000-0010-8000-00AA006D2EA4}.GROUPS 82 {00000617-0000-0010-8000-00AA006D2EA4} 83 {00000603-0000-0010-8000-00AA006D2EA4}.USERS 84 {0000061A-0000-0010-8000-00AA006D2EA4} What can I do to solve this?
ADO RDD xHarbour
Forget my previous post I must use TOleAuto():New instead of CreateObject. Now I get error : 1003 adordd 1: EG_ARG Source : ADO_OPEN -> UR_SUPER_ADDFIELD( nWA, aField )
ADO RDD xHarbour
Antonio, What ADORDD version are you using ? Where have you downloaded it from ?
ADO RDD xHarbour
Im using RDDADO.prg from harbour 3.0. Im only linking adordd.prg ( no other rdd lib explicit linked) to the app.
ADO RDD xHarbour
Please copy the source code of ADO_OPEN here, thanks
ADO RDD xHarbour
Im connecting dbf - DbaseIV [code=fw:323ea2lv]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_OPEN<span style="color: #000000;">&#40;</span> nWA, aOpenInfo <span style="color: #000000;">&#41;</span><br /><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> cName, aField, oError, nResult<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oRecordSet, nTotalFields, n,cstr<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">/* When there is no ALIAS we will create new one using file name */</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> Empty<span style="color: #000000;">&#40;</span> aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_ALIAS <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; HB_FNAMESPLIT<span style="color: #000000;">&#40;</span> aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span>, , @cName <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_ALIAS <span style="color: #000000;">&#93;</span> := cName<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span> += <span style="color: #ff0000;">".dbf"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;hb_adoSetTable<span style="color: #000000;">&#40;</span> aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;hb_adoSetEngine<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;hb_adoSetServer<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;hb_adoSetQuery<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;hb_adoSetUser<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;hb_adoSetPassword<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> Empty<span style="color: #000000;">&#40;</span> aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_CONNECT <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span> := &nbsp;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.Connection"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span> := t_cTableName<br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_QUERY <span style="color: #000000;">&#93;</span> &nbsp; &nbsp;:= t_cQuery<br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_USERNAME <span style="color: #000000;">&#93;</span> := t_cUserName<br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_PASSWORD <span style="color: #000000;">&#93;</span> := t_cPassword<br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_SERVER <span style="color: #000000;">&#93;</span> := t_cServer<br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_ENGINE <span style="color: #000000;">&#93;</span> := t_cEngine<br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_CONNOPEN <span style="color: #000000;">&#93;</span> := .T.<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> Lower<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Right</span><span style="color: #000000;">&#40;</span> aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">".dbf"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cStr := &nbsp; CFILEPATH<span style="color: #000000;">&#40;</span>aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cStr := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cStr,<span style="color: #000000;">1</span>,LEN<span style="color: #000000;">&#40;</span>Cstr<span style="color: #000000;">&#41;</span><span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="</span>+cstr+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">";Extended Properties=dBASE IV;User ID=;Password="</span><span style="color: #000000;">&#41;</span>&nbsp; &nbsp;<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">CASE</span> Lower<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Right</span><span style="color: #000000;">&#40;</span> aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">".mdb"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> Empty<span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_PASSWORD <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="</span> + aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="</span> + aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">";Jet OLEDB:Database Password="</span> + AllTrim<span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_PASSWORD <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">CASE</span> Lower<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Right</span><span style="color: #000000;">&#40;</span> aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">".xls"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="</span> + aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">";Extended Properties='Excel 8.0;HDR=YES';Persist Security Info=False"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">CASE</span> Lower<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Right</span><span style="color: #000000;">&#40;</span> aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">".db"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="</span> + aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">";Extended Properties='Paradox 3.x';"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">CASE</span> aWAData<span style="color: #000000;">&#91;</span> WA_ENGINE <span style="color: #000000;">&#93;</span> == <span style="color: #ff0000;">"MYSQL"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DRIVER={MySQL ODBC 3.51 Driver};"</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"server="</span> + aWAData<span style="color: #000000;">&#91;</span> WA_SERVER <span style="color: #000000;">&#93;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">";database="</span> + aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">";uid="</span> + aWAData<span style="color: #000000;">&#91;</span> WA_USERNAME <span style="color: #000000;">&#93;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">";pwd="</span> + aWAData<span style="color: #000000;">&#91;</span> WA_PASSWORD <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> aWAData<span style="color: #000000;">&#91;</span> WA_ENGINE <span style="color: #000000;">&#93;</span> == <span style="color: #ff0000;">"SQL"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Provider=SQLOLEDB;"</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"server="</span> + aWAData<span style="color: #000000;">&#91;</span> WA_SERVER <span style="color: #000000;">&#93;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">";database="</span> + aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">";uid="</span> + aWAData<span style="color: #000000;">&#91;</span> WA_USERNAME <span style="color: #000000;">&#93;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">";pwd="</span> + aWAData<span style="color: #000000;">&#91;</span> WA_PASSWORD <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">CASE</span> aWAData<span style="color: #000000;">&#91;</span> WA_ENGINE <span style="color: #000000;">&#93;</span> == <span style="color: #ff0000;">"ORACLE"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Provider=MSDAORA.1;"</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Persist Security Info=False"</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iif<span style="color: #000000;">&#40;</span> Empty<span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_SERVER <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">";Data source="</span> + aWAData<span style="color: #000000;">&#91;</span> WA_SERVER <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">";User ID="</span> + aWAData<span style="color: #000000;">&#91;</span> WA_USERNAME <span style="color: #000000;">&#93;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">";Password="</span> + aWAData<span style="color: #000000;">&#91;</span> WA_PASSWORD <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">CASE</span> aWAData<span style="color: #000000;">&#91;</span> WA_ENGINE <span style="color: #000000;">&#93;</span> == <span style="color: #ff0000;">"FIREBIRD"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Driver=Firebird/InterBase(r) driver;"</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Persist Security Info=False"</span> +;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">";Uid="</span> + aWAData<span style="color: #000000;">&#91;</span> WA_USERNAME <span style="color: #000000;">&#93;</span> +;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">";Pwd="</span> + aWAData<span style="color: #000000;">&#91;</span> WA_PASSWORD <span style="color: #000000;">&#93;</span> +;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">";DbName="</span> + aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDCASE</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span> := &nbsp;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.Connection"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span> := t_cTableName<br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_QUERY <span style="color: #000000;">&#93;</span> := t_cQuery<br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_USERNAME <span style="color: #000000;">&#93;</span> := t_cUserName<br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_PASSWORD <span style="color: #000000;">&#93;</span> := t_cPassword<br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_SERVER <span style="color: #000000;">&#93;</span> := t_cServer<br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_ENGINE <span style="color: #000000;">&#93;</span> := t_cEngine<br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_CONNOPEN <span style="color: #000000;">&#93;</span> := .F.<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">/* will be initilized */</span><br />&nbsp; &nbsp;t_cQuery := <span style="color: #ff0000;">""</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> Empty<span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_QUERY <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_QUERY <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"SELECT * FROM "</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;oRecordSet := &nbsp;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 />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> oRecordSet == <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp; &nbsp; oError := ErrorNew<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">GenCode</span> &nbsp; &nbsp; := EG_OPEN<br />&nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">SubCode</span> &nbsp; &nbsp; := <span style="color: #000000;">1001</span><br />&nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">Description</span> := HB_LANGERRMSG<span style="color: #000000;">&#40;</span> EG_OPEN <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">FileName</span> &nbsp; &nbsp;:= aOpenInfo<span style="color: #000000;">&#91;</span> UR_OI_NAME <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">OsCode</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">0</span> <span style="color: #B900B9;">/* TODO */</span><br />&nbsp; &nbsp; &nbsp; oError:<span style="color: #000000;">CanDefault</span> &nbsp;:= .T.<br /><br />&nbsp; &nbsp; &nbsp; UR_SUPER_ERROR<span style="color: #000000;">&#40;</span> nWA, oError <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> HB_FAILURE<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;oRecordSet:<span style="color: #000000;">CursorType</span> &nbsp; &nbsp; := adOpenDynamic<br />&nbsp; &nbsp;oRecordSet:<span style="color: #000000;">CursorLocation</span> := adUseClient<br />&nbsp; &nbsp;oRecordSet:<span style="color: #000000;">LockType</span> &nbsp; &nbsp; &nbsp; := adLockPessimistic<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span> := FW_QuotedColSQL<span style="color: #000000;">&#40;</span> &nbsp;CFILENOPATH<span style="color: #000000;">&#40;</span>aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> aWAData<span style="color: #000000;">&#91;</span> WA_QUERY <span style="color: #000000;">&#93;</span> == <span style="color: #ff0000;">"SELECT * FROM "</span><br />&nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_QUERY <span style="color: #000000;">&#93;</span> + aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span>, aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_QUERY <span style="color: #000000;">&#93;</span>, aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_CATALOG <span style="color: #000000;">&#93;</span> := &nbsp;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;">"ADOX.Catalog"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aWAData<span style="color: #000000;">&#91;</span> WA_CATALOG <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">ActiveConnection</span> := aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;CATCH<br />&nbsp; &nbsp;END<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> Empty<span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_CATALOG <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_CATALOG <span style="color: #000000;">&#93;</span> := aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">OpenSchema</span><span style="color: #000000;">&#40;</span> adSchemaIndexes <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; CATCH<br />&nbsp; &nbsp; &nbsp; END<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_RECORDSET <span style="color: #000000;">&#93;</span> := oRecordSet<br />&nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_BOF <span style="color: #000000;">&#93;</span> := aWAData<span style="color: #000000;">&#91;</span> WA_EOF <span style="color: #000000;">&#93;</span> := .F.<br /><br />&nbsp; &nbsp;UR_SUPER_SETFIELDEXTENT<span style="color: #000000;">&#40;</span> nWA, nTotalFields := oRecordSet:<span style="color: #000000;">Fields</span>:<span style="color: #0000ff;">Count</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> nTotalFields<br />&nbsp; &nbsp; &nbsp; aField := Array<span style="color: #000000;">&#40;</span> UR_FI_SIZE <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> UR_FI_NAME <span style="color: #000000;">&#93;</span> &nbsp; &nbsp;:= oRecordSet:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> n - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Name</span><br />&nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> UR_FI_TYPE <span style="color: #000000;">&#93;</span> &nbsp; &nbsp;:= ADO_GETFIELDTYPE<span style="color: #000000;">&#40;</span> oRecordSet:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> n - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Type</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> UR_FI_TYPEEXT <span style="color: #000000;">&#93;</span> := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> UR_FI_LEN <span style="color: #000000;">&#93;</span> &nbsp; &nbsp; := ADO_GETFIELDSIZE<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> UR_FI_TYPE <span style="color: #000000;">&#93;</span>, oRecordSet:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> n - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">ActualSize</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> UR_FI_DEC <span style="color: #000000;">&#93;</span> &nbsp; &nbsp; := <span style="color: #000000;">0</span><br />#ifdef UR_FI_FLAGS<br />&nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> UR_FI_FLAGS <span style="color: #000000;">&#93;</span> &nbsp; := <span style="color: #000000;">0</span><br />#endif<br />#ifdef UR_FI_STEP<br />&nbsp; &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> UR_FI_STEP <span style="color: #000000;">&#93;</span> &nbsp; &nbsp;:= <span style="color: #000000;">0</span><br />#endif<br />&nbsp; &nbsp; &nbsp; UR_SUPER_ADDFIELD<span style="color: #000000;">&#40;</span> nWA, aField <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">NEXT</span><br /><br />&nbsp; &nbsp;nResult := UR_SUPER_OPEN<span style="color: #000000;">&#40;</span> nWA, aOpenInfo <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> nResult == HB_SUCCESS<br />&nbsp; &nbsp; &nbsp; ADO_GOTOP<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> nResult</div>[/code:323ea2lv]
ADO RDD xHarbour
Hello, If you post a full working sample and the source code of RDDADO.prg we can try to help!. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
ADO RDD xHarbour
Antonio, This is how it is done from Harbour\src\rdd\arrayrdd.prg [code=fw:1konyn7q]<div class="fw" id="{CB}" style="font-family: monospace;">      aField := Array<span style="color: #000000;">&#40;</span> UR_FI_SIZE <span style="color: #000000;">&#41;</span><br />      aField<span style="color: #000000;">&#91;</span> UR_FI_NAME <span style="color: #000000;">&#93;</span>    := aFieldStruct<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span><br />      aField<span style="color: #000000;">&#91;</span> UR_FI_TYPE <span style="color: #000000;">&#93;</span>    := hb_Decode<span style="color: #000000;">&#40;</span> aFieldStruct<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span>, <span style="color: #ff0000;">"C"</span>, HB_FT_STRING, <span style="color: #ff0000;">"L"</span>, HB_FT_LOGICAL, <span style="color: #ff0000;">"M"</span>, HB_FT_MEMO, <span style="color: #ff0000;">"D"</span>, HB_FT_DATE, <span style="color: #ff0000;">"N"</span>, iif<span style="color: #000000;">&#40;</span> aFieldStruct<span style="color: #000000;">&#91;</span> DBS_DEC <span style="color: #000000;">&#93;</span> > <span style="color: #000000;">0</span>, HB_FT_DOUBLE, HB_FT_INTEGER <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      aField<span style="color: #000000;">&#91;</span> UR_FI_TYPEEXT <span style="color: #000000;">&#93;</span> := <span style="color: #000000;">0</span><br />      aField<span style="color: #000000;">&#91;</span> UR_FI_LEN <span style="color: #000000;">&#93;</span>     := aFieldStruct<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span><br />      aField<span style="color: #000000;">&#91;</span> UR_FI_DEC <span style="color: #000000;">&#93;</span>     := aFieldStruct<span style="color: #000000;">&#91;</span> DBS_DEC <span style="color: #000000;">&#93;</span><br />      UR_SUPER_ADDFIELD<span style="color: #000000;">&#40;</span> nWA, aField <span style="color: #000000;">&#41;</span></div>[/code:1konyn7q] Do MsgInfo( ADO_GETFIELDTYPE( oRecordSet:Fields( n - 1 ):Type ) ) and tell me what type you get. It seems as the error may come from there. [url:1konyn7q]https&#58;//github&#46;com/harbour/core/blob/master/src/rdd/usrrdd/rdds/arrayrdd&#46;prg[/url:1konyn7q]
ADO RDD xHarbour
MsgInfo( ADO_GETFIELDTYPE( oRecordSet:Fields( n - 1 ):Type ) ) type char value returned 1 type date value returned 3 type numeric value returned 7 type logic value returned 2 [code=fw:lwkzinm0]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_GETFIELDTYPE<span style="color: #000000;">&#40;</span> nADOFieldType <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nDBFFieldType := <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adEmpty<br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adTinyInt<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_INTEGER<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adSmallInt<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_INTEGER<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adInteger<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_INTEGER<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adBigInt<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_INTEGER<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adUnsignedTinyInt<br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adUnsignedSmallInt<br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adUnsignedInt<br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adUnsignedBigInt<br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adSingle<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adDouble<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_DOUBLE<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adCurrency<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_INTEGER<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adDecimal<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_LONG<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adNumeric<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_LONG<br /><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adError<br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adUserDefined<br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adVariant<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_ANY<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adIDispatch<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adIUnknown<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adGUID<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_STRING<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adDate<br />#ifdef HB_FT_DATETIME<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_DATETIME<br />#else<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_DATE<br />#endif<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adDBDate<br />#ifdef HB_FT_DATETIME<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_DATETIME<br />#else<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_DATE<br />#endif<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adDBTime<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adDBTimeStamp<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_TIMESTAMP<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adFileTime<br />#ifdef HB_FT_DATETIME<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_DATETIME<br />#else<br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//nDBFFieldType := HB_FT_DATE</span><br />#endif<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adBSTR<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_STRING<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adChar<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_STRING<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adVarChar<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_STRING<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adLongVarChar<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_STRING<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adWChar<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_STRING<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adVarWChar<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_STRING<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adBinary<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_OLE<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adVarBinary<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_OLE<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adLongVarBinary<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_OLE<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adChapter<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adVarNumeric<br /><span style="color: #B900B9;">/* CASE nADOFieldType == adArray */</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adBoolean<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_LOGICAL<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adLongVarWChar<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_MEMO<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">CASE</span> nADOFieldType == adPropVariant<br />&nbsp; &nbsp; &nbsp; nDBFFieldType := HB_FT_MEMO<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDCASE</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> nDBFFieldType</div>[/code:lwkzinm0]
ADO RDD xHarbour
Antonio, Please replace this line in AdoRdd.prg: aField[ UR_FI_TYPE ] := ADO_GETFIELDTYPE( oRecordSet:Fields( n - 1 ):Type ) with this: [code=fw:13v9q6zl]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> &nbsp;ADO_GETFIELDTYPE<span style="color: #000000;">&#40;</span> oRecordSet:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> n - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Type</span> == <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aField<span style="color: #000000;">&#91;</span> UR_FI_TYPE <span style="color: #000000;">&#93;</span> &nbsp;:= &nbsp;HB_FT_STRING<br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> &nbsp;ADO_GETFIELDTYPE<span style="color: #000000;">&#40;</span> oRecordSet:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> n - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Type</span> == <span style="color: #000000;">3</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aField<span style="color: #000000;">&#91;</span> UR_FI_TYPE <span style="color: #000000;">&#93;</span> &nbsp;:= &nbsp;HB_FT_DATE<br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> &nbsp;ADO_GETFIELDTYPE<span style="color: #000000;">&#40;</span> oRecordSet:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> n - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Type</span> == <span style="color: #000000;">7</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aField<span style="color: #000000;">&#91;</span> UR_FI_TYPE <span style="color: #000000;">&#93;</span> &nbsp;:= HB_FT_NUMERIC <span style="color: #B900B9;">// if there are no decimals this should be HB_FT_INTEGER</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> &nbsp;ADO_GETFIELDTYPE<span style="color: #000000;">&#40;</span> oRecordSet:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> n - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Type</span> == <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aField<span style="color: #000000;">&#91;</span> UR_FI_TYPE <span style="color: #000000;">&#93;</span> &nbsp;:= HB_FT_LOGICAL<br /><span style="color: #00C800;">endcase</span> <br />&nbsp;</div>[/code:13v9q6zl]
ADO RDD xHarbour
Antonio, Error: genCode 14: EG_NOVAR operação HB_FT_NUMERIC If I change it to HB_FT_INTEGER then I get the same error: genCode 1: EG_ARG severity 2 subCode 1003 subSystem ADORDD Chamado de UR_SUPER_ADDFIELD(0) Chamado de ADO_OPEN(448)
ADO RDD xHarbour
Antonio, Please add this include at the top of AdoRdd.prg #include "hbusrrdd.ch" and replace HB_FT_NUMERIC with HB_FT_DOUBLE if HB_FT_DOUBLE fails, try it with HB_FT_INTEGER
ADO RDD xHarbour
Antonio, #include "hbusrrdd.ch" was already there. HB_FT_NUMERIC its not defined in hbusrrdd.ch Passing the FOR clause in the first field I get: name user type 1 len 30 its correct according to dbf file. user c 30 Calling UR_SUPER_ADDFIELD( nWA, aField ) I get the same error: arguments none description Argument error genCode 1: EG_ARG osCode (Não é erro do sistema operativo) severity 2 subCode 1003 subSystem ADORDD tries 0
ADO RDD xHarbour
Antonio, Could you send me a small ZIP renamed as ZOP with the PRG and DBF ? thanks
ADO RDD xHarbour
Antonio, Sent to your email.
ADO RDD xHarbour
Antonio, I have not received it yet. Please remember to rename ZIPs as ZOPs or gmail will block them
ADO RDD xHarbour
Sento as zop to <!-- e --><a href="mailto:'alinares@fivetechsoft.com">'alinares@fivetechsoft.com</a><!-- e -->'
ADO RDD xHarbour
Antonio, Did you received my email?
ADO RDD xHarbour
Antonio, Where can I find FWAdoFieldSize() and FWAdoFieldDec( ) ?
ADO RDD xHarbour
Antonio, I have not received your email Please rename the attached files as *.zop or gmail will delete them
ADO RDD xHarbour
[quote="AHF":28wvb5kz]Antonio, Where can I find FWAdoFieldSize() and FWAdoFieldDec( ) ?[/quote:28wvb5kz] Those functions and much more are in FWH\source\function\adfuncs.prg
ADO RDD xHarbour
Antonio, Im working with FWH October 2008 and xHarbour Sept 2008 and I dont have such functions. Email resent
ADO RDD xHarbour
Antonio, It seems as you are not using the most recent adordd.prg. Please try it with this one: [url:45huubk2]https&#58;//github&#46;com/harbour/core/tree/master/extras/rddado[/url:45huubk2]
ADO RDD xHarbour
Antonio, Continue to get error UR_SUPER_ADDFIELD(0) EG_ARG 1003 SUBSSYSTEM ADORDD May be I have a wrong version of UR_SUPER_ADDFIELD What are the expected parameters of this function? Also the THREAD STATIC does not compile I have to take THREAD out. I dont have function hb_ntos, hb_stod Without "common.ch" HB_SYMBOL_UNUSED does not compile.
ADO RDD xHarbour
In [url:2qp9l10u]https&#58;//github&#46;com/harbour/core/blob/master/src/rdd/usrrdd/rdds/arrayrdd&#46;prg[/url:2qp9l10u] UR_SUPER_ADDFIELD() is used this way: [code=fw:2qp9l10u]<div class="fw" id="{CB}" style="font-family: monospace;">   <span style="color: #00C800;">FOR</span> EACH aFieldStruct IN aStruct<br />      aField := Array<span style="color: #000000;">&#40;</span> UR_FI_SIZE <span style="color: #000000;">&#41;</span><br />      aField<span style="color: #000000;">&#91;</span> UR_FI_NAME <span style="color: #000000;">&#93;</span>    := aFieldStruct<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span><br />      aField<span style="color: #000000;">&#91;</span> UR_FI_TYPE <span style="color: #000000;">&#93;</span>    := hb_Decode<span style="color: #000000;">&#40;</span> aFieldStruct<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span>, <span style="color: #ff0000;">"C"</span>, HB_FT_STRING, <span style="color: #ff0000;">"L"</span>, HB_FT_LOGICAL, <span style="color: #ff0000;">"M"</span>, HB_FT_MEMO, <span style="color: #ff0000;">"D"</span>, HB_FT_DATE, <span style="color: #ff0000;">"N"</span>, iif<span style="color: #000000;">&#40;</span> aFieldStruct<span style="color: #000000;">&#91;</span> DBS_DEC <span style="color: #000000;">&#93;</span> > <span style="color: #000000;">0</span>, HB_FT_DOUBLE, HB_FT_INTEGER <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      aField<span style="color: #000000;">&#91;</span> UR_FI_TYPEEXT <span style="color: #000000;">&#93;</span> := <span style="color: #000000;">0</span><br />      aField<span style="color: #000000;">&#91;</span> UR_FI_LEN <span style="color: #000000;">&#93;</span>     := aFieldStruct<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span><br />      aField<span style="color: #000000;">&#91;</span> UR_FI_DEC <span style="color: #000000;">&#93;</span>     := aFieldStruct<span style="color: #000000;">&#91;</span> DBS_DEC <span style="color: #000000;">&#93;</span><br />      UR_SUPER_ADDFIELD<span style="color: #000000;">&#40;</span> nWA, aField <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">NEXT</span></div>[/code:2qp9l10u] nWA seems to be the workarea number and aField is an array with those values.
ADO RDD xHarbour
[quote:h4q42lrm]I dont have function hb_ntos, hb_stod[/quote:h4q42lrm] Those functions are from harbour standard libraries. How do you get this error ?
ADO RDD xHarbour
Antonio, Im working with FWH October 2008 and xHarbour Sept 2008 . Is this the reason?
ADO RDD xHarbour
Antonio, As far as I understand I must send in aField[ UR_FI_TYPE ] with clipper standard field types C N L... But I still get te same error
ADO RDD xHarbour
Please post here the code that you are using when you fill aField and call the function
ADO RDD xHarbour
Here it is [code]FOR n := 1 TO nTotalFields aField := Array( UR_FI_SIZE ) aField[ UR_FI_NAME ] := oRecordSet:Fields( n - 1 ):Name ADO_FIELDINFO( nWA, n, DBS_TYPE, @uInfo ) aField[ UR_FI_TYPE ] := uInfo aField[ UR_FI_TYPEEXT ] := 0 ADO_FIELDINFO( nWA, n, DBS_LEN, @uInfo ) aField[ UR_FI_LEN ] := uInfo ADO_FIELDINFO( nWA, n, DBS_DEC, @uInfo ) aField[ UR_FI_DEC ] := uInfo /* #ifdef UR_FI_FLAGS aField[ UR_FI_FLAGS ] := 0 #endif #ifdef UR_FI_STEP aField[ UR_FI_STEP ] := 0 #endif */ MsgInfo( "name "+aField[ UR_FI_NAME ] +" Type "+ aField[ UR_FI_TYPE ] +" len "+str(aField[ UR_FI_LEN ])+" decimals "+str(aField[ UR_FI_DEC ] ) ) UR_SUPER_ADDFIELD( nWA, aField ) NEXT STATIC FUNCTION ADO_FIELDINFO( nWA, nField, nInfoType, uInfo ) LOCAL nType, nLen LOCAL oRecordSet := USRRDD_AREADATA( nWA )[ WA_RECORDSET ] DO CASE CASE nInfoType == DBS_NAME uInfo := oRecordSet:Fields( nField - 1 ):Name CASE nInfoType == DBS_TYPE nType := ADO_GETFIELDTYPE( oRecordSet:Fields( nField - 1 ):Type ) DO CASE CASE nType == HB_FT_STRING uInfo := "C" CASE nType == HB_FT_LOGICAL uInfo := "L" CASE nType == HB_FT_MEMO uInfo := "M" CASE nType == HB_FT_OLE uInfo := "G" #ifdef HB_FT_PICTURE CASE nType == HB_FT_PICTURE uInfo := "P" #endif CASE nType == HB_FT_ANY uInfo := "V" CASE nType == HB_FT_DATE uInfo := "D" #ifdef HB_FT_DATETIME CASE nType == HB_FT_DATETIME uInfo := "T" #endif CASE nType == HB_FT_TIMESTAMP uInfo := "@" CASE nType == HB_FT_LONG uInfo := "N" CASE nType == HB_FT_INTEGER uInfo := "I" CASE nType == HB_FT_DOUBLE uInfo := "B" OTHERWISE uInfo := "U" ENDCASE CASE nInfoType == DBS_LEN ADO_FIELDINFO( nWA, nField, DBS_TYPE, @nType ) IF nType == "N" nLen := oRecordSet:Fields( nField - 1 ):Precision ELSE nLen := [b:353xgxc1]ADO_GETFIELDSIZE( ADO_GETFIELDTYPE( oRecordSet:Fields( nField - 1 ):Type ), oRecordSet:Fields( nField - 1 ):DefinedSize )[/b:353xgxc1] ENDIF /* Un campo mayor de 1024 lo consideramos un campo memo */ uInfo := iif( nLen > 1024, 10, nLen ) CASE nInfoType == DBS_DEC ADO_FIELDINFO( nWA, nField, DBS_LEN, @nLen ) ADO_FIELDINFO( nWA, nField, DBS_TYPE, @nType ) IF oRecordSet:Fields( nField - 1 ):Type == adInteger uInfo := 0 ELSEIF nType == "N" //uInfo := Min( Max( 0, nLen - 1 - oRecordSet:Fields( nField - 1 ):DefinedSize ), 15 ) [b:353xgxc1]uInfo := oRecordSet:Fields( nField - 1 ):NumericScale[/b:353xgxc1] ELSE uInfo := 0 ENDIF #ifdef DBS_FLAG CASE nInfoType == DBS_FLAG uInfo := 0 #endif #ifdef DBS_STEP CASE nInfoType == DBS_STEP uInfo := 0 #endif OTHERWISE RETURN HB_FAILURE ENDCASE RETURN HB_SUCCESS /[code]
ADO RDD xHarbour
[code=fw:3kzvoxy9]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> nTotalFields<br />aField := Array<span style="color: #000000;">&#40;</span> UR_FI_SIZE <span style="color: #000000;">&#41;</span><br />aField<span style="color: #000000;">&#91;</span> UR_FI_NAME <span style="color: #000000;">&#93;</span> := oRecordSet:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> n - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Name</span><br />ADO_FIELDINFO<span style="color: #000000;">&#40;</span> nWA, n, DBS_TYPE, @uInfo <span style="color: #000000;">&#41;</span><br />aField<span style="color: #000000;">&#91;</span> UR_FI_TYPE <span style="color: #000000;">&#93;</span> := uInfo<br />aField<span style="color: #000000;">&#91;</span> UR_FI_TYPEEXT <span style="color: #000000;">&#93;</span> := <span style="color: #000000;">0</span><br />ADO_FIELDINFO<span style="color: #000000;">&#40;</span> nWA, n, DBS_LEN, @uInfo <span style="color: #000000;">&#41;</span><br />aField<span style="color: #000000;">&#91;</span> UR_FI_LEN <span style="color: #000000;">&#93;</span> := uInfo<br />ADO_FIELDINFO<span style="color: #000000;">&#40;</span> nWA, n, DBS_DEC, @uInfo <span style="color: #000000;">&#41;</span><br />aField<span style="color: #000000;">&#91;</span> UR_FI_DEC <span style="color: #000000;">&#93;</span> := uInfo<br /><span style="color: #B900B9;">/*<br />#ifdef UR_FI_FLAGS<br />aField[ UR_FI_FLAGS ] := 0<br />#endif<br />#ifdef UR_FI_STEP<br />aField[ UR_FI_STEP ] := 0<br />#endif<br />*/</span><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"name "</span>+aField<span style="color: #000000;">&#91;</span> UR_FI_NAME <span style="color: #000000;">&#93;</span> +<span style="color: #ff0000;">" Type "</span>+ aField<span style="color: #000000;">&#91;</span> UR_FI_TYPE <span style="color: #000000;">&#93;</span> +<span style="color: #ff0000;">" len "</span>+str<span style="color: #000000;">&#40;</span>aField<span style="color: #000000;">&#91;</span> UR_FI_LEN <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" decimals "</span>+str<span style="color: #000000;">&#40;</span>aField<span style="color: #000000;">&#91;</span> UR_FI_DEC <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />UR_SUPER_ADDFIELD<span style="color: #000000;">&#40;</span> nWA, aField <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">NEXT</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_FIELDINFO<span style="color: #000000;">&#40;</span> nWA, nField, nInfoType, uInfo <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">LOCAL</span> nType, nLen<br /><span style="color: #00C800;">LOCAL</span> oRecordSet := USRRDD_AREADATA<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span> WA_RECORDSET <span style="color: #000000;">&#93;</span><br /><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /><span style="color: #00C800;">CASE</span> nInfoType == DBS_NAME<br />uInfo := 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><br /><br /><span style="color: #00C800;">CASE</span> nInfoType == DBS_TYPE<br />nType := ADO_GETFIELDTYPE<span style="color: #000000;">&#40;</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: #000000;">Type</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /><span style="color: #00C800;">CASE</span> nType == HB_FT_STRING<br />uInfo := <span style="color: #ff0000;">"C"</span><br /><span style="color: #00C800;">CASE</span> nType == HB_FT_LOGICAL<br />uInfo := <span style="color: #ff0000;">"L"</span><br /><span style="color: #00C800;">CASE</span> nType == HB_FT_MEMO<br />uInfo := <span style="color: #ff0000;">"M"</span><br /><span style="color: #00C800;">CASE</span> nType == HB_FT_OLE<br />uInfo := <span style="color: #ff0000;">"G"</span><br />#ifdef HB_FT_PICTURE<br /><span style="color: #00C800;">CASE</span> nType == HB_FT_PICTURE<br />uInfo := <span style="color: #ff0000;">"P"</span><br />#endif<br /><span style="color: #00C800;">CASE</span> nType == HB_FT_ANY<br />uInfo := <span style="color: #ff0000;">"V"</span><br /><span style="color: #00C800;">CASE</span> nType == HB_FT_DATE<br />uInfo := <span style="color: #ff0000;">"D"</span><br />#ifdef HB_FT_DATETIME<br /><span style="color: #00C800;">CASE</span> nType == HB_FT_DATETIME<br />uInfo := <span style="color: #ff0000;">"T"</span><br />#endif<br /><span style="color: #00C800;">CASE</span> nType == HB_FT_TIMESTAMP<br />uInfo := <span style="color: #ff0000;">"@"</span><br /><span style="color: #00C800;">CASE</span> nType == HB_FT_LONG<br />uInfo := <span style="color: #ff0000;">"N"</span><br /><span style="color: #00C800;">CASE</span> nType == HB_FT_INTEGER<br />uInfo := <span style="color: #ff0000;">"I"</span><br /><span style="color: #00C800;">CASE</span> nType == HB_FT_DOUBLE<br />uInfo := <span style="color: #ff0000;">"B"</span><br /><span style="color: #00C800;">OTHERWISE</span><br />uInfo := <span style="color: #ff0000;">"U"</span><br /><span style="color: #00C800;">ENDCASE</span><br /><br /><span style="color: #00C800;">CASE</span> nInfoType == DBS_LEN<br />ADO_FIELDINFO<span style="color: #000000;">&#40;</span> nWA, nField, DBS_TYPE, @nType <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">IF</span> nType == <span style="color: #ff0000;">"N"</span><br />nLen := 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: #000000;">Precision</span><br /><span style="color: #00C800;">ELSE</span><br />nLen := <span style="color: #000000;">&#91;</span>b<span style="color: #000000;">&#93;</span>ADO_GETFIELDSIZE<span style="color: #000000;">&#40;</span> ADO_GETFIELDTYPE<span style="color: #000000;">&#40;</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: #000000;">Type</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: #000000;">DefinedSize</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span>/b<span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #B900B9;">/* Un campo mayor de 1024 lo consideramos un campo memo */</span><br />uInfo := iif<span style="color: #000000;">&#40;</span> nLen > <span style="color: #000000;">1024</span>, <span style="color: #000000;">10</span>, nLen <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">CASE</span> nInfoType == DBS_DEC<br />ADO_FIELDINFO<span style="color: #000000;">&#40;</span> nWA, nField, DBS_LEN, @nLen <span style="color: #000000;">&#41;</span><br />ADO_FIELDINFO<span style="color: #000000;">&#40;</span> nWA, nField, DBS_TYPE, @nType <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">IF</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: #000000;">Type</span> == adInteger<br />uInfo := <span style="color: #000000;">0</span><br />ELSEIF nType == <span style="color: #ff0000;">"N"</span><br /><span style="color: #B900B9;">//uInfo := Min( Max( 0, nLen - 1 - oRecordSet:Fields( nField - 1 ):DefinedSize ), 15 )</span><br />uInfo := <span style="color: #000000;">&#91;</span>b<span style="color: #000000;">&#93;</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: #000000;">NumericScale</span><span style="color: #000000;">&#91;</span>/b<span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">ELSE</span><br />uInfo := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">ENDIF</span><br />#ifdef DBS_FLAG<br /><span style="color: #00C800;">CASE</span> nInfoType == DBS_FLAG<br />uInfo := <span style="color: #000000;">0</span><br />#endif<br />#ifdef DBS_STEP<br /><span style="color: #00C800;">CASE</span> nInfoType == DBS_STEP<br />uInfo := <span style="color: #000000;">0</span><br />#endif<br /><span style="color: #00C800;">OTHERWISE</span><br /><span style="color: #00C800;">RETURN</span> HB_FAILURE<br /><span style="color: #00C800;">ENDCASE</span><br /><br /><span style="color: #00C800;">RETURN</span> HB_SUCCESS<br /><br /><br />&nbsp;</div>[/code:3kzvoxy9]
ADO RDD xHarbour
Hello Antonio, If you post a full working sample it would be easier to look into the problem. I tested ADORDD in the past and it worked nice, but indexes were not supported. Are thet now?.
ADO RDD xHarbour
Hello Lucas, Im using the rddado.prg and .ch posted by Antonio in previous post. I've proceed with the changes posted after because I always get an error . I'm trying to work first with dbf files like this. RddRegister("ADORDD",1) RddSetDefault("ADORDD") sele 0 use "whatever" shared Browse() I dont know if indexes work now. There is code for it but I still didnt tryed it. It depends also on the provider.
ADO RDD xHarbour
Antonio, All that we can do here is to double check that we have properly filled aField before calling that function. I doubt there is an error like this in the Harbour RDD engine, so I guess we are suplying wrong values to aField If everything is ok, we may need to low level trace the RDD code to find the exact value that generates the error.
ADO RDD xHarbour
Antonio, I checked with msginfo() and the values in aField passed to UR_SUPER_ADDFIELD( nWA, aField ) are: nWa = workarea number aField[ UR_FI_NAME ] := "name of field" aField[ UR_FI_TYPE ] := one of "C","L","D","N","M" aField[ UR_FI_TYPEEXT ] := 0 aField[ UR_FI_LEN ] := length of the field as number aField[ UR_FI_DEC ] := number of decimal places as number aField array 5 elements The first element shows: nWA 20 NAME "NRENCOMEND" TYPE "C" LEN 10 DEC 0 TYPEEXT 0 and it generates the error. In the original RDDADO the values were: nWa 20 NAME "NRENCOMEND" TYPE HB_FT_STRING LEN 10 DEC 0 TYPEEXT 0 Same result.
ADO RDD xHarbour
Have you compared it with the way it is called from ? [url:1am2q2oo]https&#58;//github&#46;com/harbour/core/blob/master/src/rdd/usrrdd/rdds/arrayrdd&#46;prg[/url:1am2q2oo]
ADO RDD xHarbour
Antonio, Yes and I checked with : msginfo(str(HB_Decode( aField[ DBS_TYPE ], "C", HB_FT_STRING, "L", HB_FT_LOGICAL, "M", HB_FT_MEMO, "D", HB_FT_DATE, "N", IIF( aField[ DBS_DEC ] > 0, HB_FT_DOUBLE, HB_FT_INTEGER ) ))) It returns HB_FT_STRING for "C" for example. All other elements are straight foward. The error 1003 its a variable not found. Can this be due for some other reason?
ADO RDD xHarbour
Antonio, I guess you have to supply HB_FT_STRING instead of "C"
ADO RDD xHarbour
Antonio, Tried it again. Same error.
ADO RDD xHarbour
Lets review Harbour's usrrdd.c code: [code=fw:2qpxqj5d]<div class="fw" id="{CB}" style="font-family: monospace;">HB_FUNC_UR_SUPER<span style="color: #000000;">&#40;</span> ADDFIELD <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;AREAP pArea = hb_usrGetAreaParam<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> pArea <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; DBFIELDINFO dbFieldInfo;<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> hb_usrItemToFieldInfo<span style="color: #000000;">&#40;</span> hb_param<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, HB_IT_ARRAY <span style="color: #000000;">&#41;</span>, &dbFieldInfo <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hb_retni<span style="color: #000000;">&#40;</span> SUPER_ADDFIELD<span style="color: #000000;">&#40;</span> pArea, &dbFieldInfo <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hb_usrErrorRT<span style="color: #000000;">&#40;</span> pArea, EG_ARG, EDBCMD_NOVAR <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hb_retni<span style="color: #000000;">&#40;</span> HB_FAILURE <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br /><span style="color: #000000;">&#125;</span></div>[/code:2qpxqj5d] It seems as hb_usrItemToFieldInfo( hb_param( 2, HB_IT_ARRAY ) takes the value from the array and fill a structure [code=fw:2qpxqj5d]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">static</span> HB_BOOL hb_usrItemToFieldInfo<span style="color: #000000;">&#40;</span> PHB_ITEM pItem, LPDBFIELDINFO pFieldInfo <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> pItem && hb_arrayLen<span style="color: #000000;">&#40;</span> pItem <span style="color: #000000;">&#41;</span> == UR_FI_SIZE <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; pFieldInfo->atomName &nbsp; &nbsp; &nbsp; = hb_usrArrayGetCPtr<span style="color: #000000;">&#40;</span> pItem, UR_FI_NAME <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; pFieldInfo->uiType &nbsp; &nbsp; &nbsp; &nbsp; = <span style="color: #000000;">&#40;</span> HB_USHORT <span style="color: #000000;">&#41;</span> hb_arrayGetNI<span style="color: #000000;">&#40;</span> pItem, UR_FI_TYPE <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; pFieldInfo->uiTypeExtended = <span style="color: #000000;">&#40;</span> HB_USHORT <span style="color: #000000;">&#41;</span> hb_arrayGetNI<span style="color: #000000;">&#40;</span> pItem, UR_FI_TYPEEXT <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; pFieldInfo->uiLen &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= <span style="color: #000000;">&#40;</span> HB_USHORT <span style="color: #000000;">&#41;</span> hb_arrayGetNI<span style="color: #000000;">&#40;</span> pItem, UR_FI_LEN <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; pFieldInfo->uiDec &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= <span style="color: #000000;">&#40;</span> HB_USHORT <span style="color: #000000;">&#41;</span> hb_arrayGetNI<span style="color: #000000;">&#40;</span> pItem, UR_FI_DEC <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> HB_TRUE;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">return</span> HB_FALSE;<br /><span style="color: #000000;">&#125;</span></div>[/code:2qpxqj5d] 5 elements
ADO RDD xHarbour
[url:3ugpccpb]https&#58;//github&#46;com/harbour/core/blob/master/src/rdd/usrrdd/usrrdd&#46;c[/url:3ugpccpb]
ADO RDD xHarbour
Antonio, Passed array its corrected.This is the print out: aField[ UR_FI_NAME ] = NRENCOMEND aField[ UR_FI_TYPE ] = 1 aField[ UR_FI_TYPEEXT ] = 0 aField[ UR_FI_LEN ] = 10 aField[ UR_FI_DEC ] = 0 It seems the error its not here.
ADO RDD xHarbour
Antonio, adordd is working with copy to and copy struct when the table source is opened with via adordd. Thus it goes directly to ado_trans and we have the control to do it either to another table via adordd or to other rdd. The problem is when the source table is for ex. dbfcdx then _dbcopy executes and calls ado_append and ado_putvalue and I cant find why on the last record it errors after :update() in ado_putvalue. With this done it will be very easy to export all tables from ex. dbfcdx to any adordd data source. Can you inform were can I find source __dbcopy ?
ADO RDD xHarbour
Antonio, What harbour version are you using ?
ADO RDD xHarbour
[quote="AHF":2t8c3q9j]Antonio, Im working with FWH October 2008 and xHarbour Sept 2008 . Is this the reason?[/quote:2t8c3q9j]
ADO RDD xHarbour
Antonio, I checked usrrdd.c from xHarbour and it expects aField[ UR_FI_FLAGS ] aField[ UR_FI_STEP ] that I now send := 0. Its ok now <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Will keep you posted
ADO RDD xHarbour
I save a password with functions FwEncrypt and Fwdecrypt but the charater returned doesnt correspond to what is in that field. I think this has something to do with charset Any solutions?
ADO RDD xHarbour
Antono, There is a problem with the field:type. When its dbf field "N" with 0 decimals it returns a double with 2 decimal places. How can we make this conversion when uploading dbfs as tables for ex to mysql or working with dbfs directly ?
ADO RDD xHarbour
[quote="AHF":3lfcbnos]Antonio, I checked usrrdd.c from xHarbour and it expects aField[ UR_FI_FLAGS ] aField[ UR_FI_STEP ] that I now send := 0. Its ok now <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Will keep you posted[/quote:3lfcbnos] Very good! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
ADO RDD xHarbour
[quote="AHF":3ss85ue0]Antono, There is a problem with the field:type. When its dbf field "N" with 0 decimals it returns a double with 2 decimal places. How can we make this conversion when uploading dbfs as tables for ex to mysql or working with dbfs directly ?[/quote:3ss85ue0] Lets ask Mr. Rao about this as he is a great expert with SQL.
ADO RDD xHarbour
[quote="AHF":3p8vi1tm]I save a password with functions FwEncrypt and Fwdecrypt but the charater returned doesnt correspond to what is in that field. I think this has something to do with charset Any solutions?[/quote:3p8vi1tm] Try to use Harbour encrypt/decrypt functions to see if that solves the problem. I don't remember right now the exact names that those functions have.
ADO RDD xHarbour
Antonio, The application crashes without any error in the following condition: ACTIVATE WINDOW … ON INIT initial() … Function Initial() Use dbf Do while !eof() ….. Dbskip() Enddo If the same function is called out of ON INIT clause its ok. If I call browse() before the Do While in any condition its ok The crash occours in the oRecordSet:move(nTotSkip) in ADO_SKIPRAW() inside the do while og Initial(). What might be the problem?
ADO RDD xHarbour
[quote="Antonio Linares":20b7ey5b][quote="AHF":20b7ey5b]I save a password with functions FwEncrypt and Fwdecrypt but the charater returned doesnt correspond to what is in that field. I think this has something to do with charset Any solutions?[/quote:20b7ey5b] Try to use Harbour encrypt/decrypt functions to see if that solves the problem. I don't remember right now the exact names that those functions have.[/quote:20b7ey5b] Antonio, The first password was created with ADS. ADORDD returns wrong chars. This is a charset problem because if I reset the password with ADORDD a create a new one its ok! How can I change the charset in ADO to be the same of ADS being ADS Collation=ansi or OEM character set = PORTUGUE Ansi CHARATER SET = Portuguese ?
ADO RDD xHarbour
Antonio, Can you test this and confirm it? [quote="AHF":35jcxuv4]Antonio, The application crashes without any error in the following condition: ACTIVATE WINDOW … ON INIT initial() … Function Initial() Use dbf Do while !eof() ….. Dbskip() Enddo If the same function is called out of ON INIT clause its ok. If I call browse() before the Do While in any condition its ok The crash occours in the oRecordSet:move(nTotSkip) in ADO_SKIPRAW() inside the do while og Initial(). What might be the problem?[/quote:35jcxuv4]
ADO RDD xHarbour
Antonio, Are you showing some data from the window ? try not to paint any data from the database on the window, so the RDD is only used once Later on we will find a way to solve it,
ADO RDD xHarbour
Antonio, I'm showing on a modal dialog with an array with several elements extracted from that table. The error does not occours in the modal dialog but when I close the table just after the do while and before the moda dialog. It seems crash occurs in ADO_CLOSE line with RETURN UR_SUPER_CLOSE( nWA )
ADO RDD xHarbour
Is it a GPF ? Do you get any log file ?
ADO RDD xHarbour
Antonio, Sorry I forgot to send it. Assinatura do problema: Nome do Evento de Problema: APPCRASH Nome da aplicação: fllup.exe Versão da aplicação: 10.0.0.0 Carimbo de Data/Hora da Aplicação: 5507d7fe Nome do Módulo com Falhas: OLEAUT32.dll Versão do Módulo com Falhas: 6.1.7601.17676 Carimbo de Data/Hora do Módulo com Falhas: 4e58702a Código de excepção: c0000005 Desvio de Excepção: 00004974 Versão do SO: 6.1.7601.2.1.0.256.48 ID de Região: 2070 Informações Adicionais 1: ae2c Informações Adicionais 2: ae2c80fe4dc0da3fe8c919694d2e67bb Informações Adicionais 3: 61a9 Informações Adicionais 4: 61a9386778096c577ec0f18cdcd7098d
ADO RDD xHarbour
Antonio, Please copy ADO_CLOSE source code here, thanks
ADO RDD xHarbour
Antonio, Here it is. [code=fw:1nhgmzvr]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ADO_CLOSE<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br /><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> oRecordSet := USRRDD_AREADATA<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span> WA_RECORDSET <span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; oRecordSet:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> ! Empty<span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_CONNOPEN <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">State</span> != adStateClosed<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">State</span> != adStateOpen<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Cancel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aWAData<span style="color: #000000;">&#91;</span> WA_CONNECTION <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;CATCH<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> UR_SUPER_CLOSE<span style="color: #000000;">&#40;</span> nWA <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:1nhgmzvr]
ADO RDD xHarbour
Antonio, We just found out that previous GPF occours with: oRecorset:Open("SELECT * FROM "+ cTableName.... GPFs in any condition oRecorset:Open(cTableName .....GPFs if oRecordSet:CursorLocation := adUseClient Its ok if oRecordSet:CursorLocation := adUseServer Any ideas why?
ADO RDD xHarbour
Antonio, No idea why, but its great that you found a workaround so you can continue testing and working on it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
ADO RDD xHarbour
Antonio, There are some issues that we must workaround in order to have full compatibility between ADO and normal RDD with no changes in the code if at all possible. These are the issues: 1) INDEX – In SQL these should be independent of the code itself. The programmer should only think about the data he needs, the rest its up to DB admin. By ordlistadd or createindex it would add to some array in the adordd the name of the indexes attached to that workarea. By ordsetfocus() the code simply asks for new recordset replacing the one in the same work area using SELECT …. ORDER BY…. The ORDER BY is extracted and parsed from the original index expression in an array of all dbfs used in the app in the form of: { {"TABLENAME",{"INDEXNAME","INDEXEXPRESSION"},{"INDEXNAME",”INDEXEXPRESSION"} }} if called by ordlistaad. If called by createindex the expression would be save in that array to the corresponding table name. Thus it doesnt matter to the programmer if the indexes do not physically exists in the database. The DB admin creates them enabling faster access for the app as the DB grows. We already use this kind of approach in queries in ADS with goods results. Using the SEEK we test if is supported otherwise FIND 2) RELATION – We must work with as many records sets as the relations and basically works the same as indexes with an array for all the relations in the current work area. If it has indexes FORCE REATION will use SEEK otherwise FIND and also verifies that the SQL expression corresponds to the expected INDEX RELATION expression if it doesn’t rises an exception as other rdd child not "indexed". 3) RECNO – Work with bookmarks if there isn’t any column AUTO INC named RECNO. Of course bookmarks have some compatibility limitations but I think its not big issue at least for our application. If it becomes a problem we must alter structure of the table and add RECNO field AUTO INC. 4) LOCKS – we need to save all record locked like any other rdd to be used by dbrlocklist() that are either Bookmarks or column RECNO. In our case this is very important because in our transactions we lock and append all needed records and when updating we go through an array of locked records returned by dbrlocklist() using dbgoto(). So it doenst matter so much the lock itself to prevent others from updating but the array of recnos locked. 5) CONCURRENT UPDATES – This is a big issue and the simplest and safe way its to treat everything as a transaction and here we have to place in the code in every update BEGINS TRANS and COMMIT TRANS. I think it’s the only way to prevent concurrent updates. In the errorsys ABORT TRANS in case of an error. Perhaps we could in the first LOCK issue BEGINS TRANS and COMMIT TRANS in the first UNLOCK. The second LOCK checks if it is in a TRANSACTION (I dont know how to check it) if it doenst starts one. On the other hand if one issues an unlock during a transaction because the fields information needed didn’t checked right and did not proceed with it issuing a COMMIT TRANS after the unlock isn’t a problem because there isn’t nothing to commit and the TRANSACTION is finished assuming that all info verification is done before ny writing to the table. With an open transaction concurrent updates will be in principle safe. Databases not supporting transactions I really don’t have any alternative. Doing this we could increase the level of abstraction to the database and it might function with any database no matter if supports or not INDEXES,RELATIONS, ROW LOCKS, whatever. If it is too slow DB Admin creates the needed indexes and the adorrdd issuing the SELECTS speed will increase drastically. I would forget CATALOGS and leave it to the DB Admin. My questions are: What are these arrays of information already in the adordd? What is your opinion ? Do you think this is feasible ? Do you think it’s the better approach or do you have any other ideas? By the way there are some FWAdo functions that I cant find anyware and could help doing the job. Looking foward to all comments,
ADO RDD xHarbour
Antonio, Check the functions for each task that you mention. There you will see where the indexes, etc. are placed: i.e. in ADO_ORDCREATE() [code=fw:cjrwsj4q]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> aWAData<span style="color: #000000;">&#91;</span> WA_CATALOG <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Tables</span><span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Indexes</span> == <span style="color: #00C800;">NIL</span> .OR. ! lFound<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oIndex := win_oleCreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADOX.Index"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oIndex:<span style="color: #0000ff;">Name</span> := iif<span style="color: #000000;">&#40;</span> ! Empty<span style="color: #000000;">&#40;</span> aOrderCreateInfo<span style="color: #000000;">&#91;</span> UR_ORCR_TAGNAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, aOrderCreateInfo<span style="color: #000000;">&#91;</span> UR_ORCR_TAGNAME <span style="color: #000000;">&#93;</span>, aOrderCreateInfo<span style="color: #000000;">&#91;</span> UR_ORCR_CKEY <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oIndex:<span style="color: #000000;">PrimaryKey</span> := .F.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oIndex:<span style="color: #000000;">Unique</span> := aOrderCreateInfo<span style="color: #000000;">&#91;</span> UR_ORCR_UNIQUE <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oIndex:<span style="color: #000000;">Columns</span>:<span style="color: #000000;">Append</span><span style="color: #000000;">&#40;</span> aOrderCreateInfo<span style="color: #000000;">&#91;</span> UR_ORCR_CKEY <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_CATALOG <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Tables</span><span style="color: #000000;">&#40;</span> aWAData<span style="color: #000000;">&#91;</span> WA_TABLENAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Indexes</span>:<span style="color: #000000;">Append</span><span style="color: #000000;">&#40;</span> oIndex <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span></div>[/code:cjrwsj4q] You have to try and check it for yourself. I never tested a large app with Adordd.prg, not sure if Miguel did it (see the copyright of adordd.prg)
ADO RDD xHarbour
Antonio, I need to alter function IndexKey() to work also with adordd. How can I do it ?
ADO RDD xHarbour
Antonio, IndexKey() se traduce en una llamada a OrdKey() y OrdKey() llama a ADO_ORDINFO() [url:234cfxg4]https&#58;//github&#46;com/harbour/core/blob/master/extras/rddado/adordd&#46;prg[/url:234cfxg4]
ADO RDD xHarbour
Antonio, At ADO_ORDLSTADD how can I save the all open index info to workarea array to be used in ADO_ORDINFO?
ADO RDD xHarbour
Antonio, Change this: #define WA_RECORDSET 1 #define WA_BOF 2 #define WA_EOF 3 #define WA_CONNECTION 4 #define WA_CATALOG 5 #define WA_TABLENAME 6 #define WA_ENGINE 7 #define WA_SERVER 8 #define WA_USERNAME 9 #define WA_PASSWORD 10 #define WA_QUERY 11 #define WA_LOCATEFOR 12 #define WA_SCOPEINFO 13 #define WA_SQLSTRUCT 14 #define WA_CONNOPEN 15 #define WA_PENDINGREL 16 #define WA_FOUND 17 #define WA_INDEXES 18 <==== New ! #define WA_SIZE 18 <==== Changed !
ADO RDD xHarbour
Antonio, The aOrderInfo[ UR_ORI_TAG ] can be Numeric or String. Is this behavior correct?
ADO RDD xHarbour
Antonio, What func calls the ADO_ORDDESTROY ?
ADO RDD xHarbour
Antonio, Place an error in ADO_ORDDESTROY() and you will see the calls stack list in example, write: x++ it will error and you will see what function calls it
ADO RDD xHarbour
Antonio, Where is information about the controling index in ADO RDD ?
ADO RDD xHarbour
The controlling index is set in the ADO recordset: oRecordSet:Index := aOrderInfo[ UR_ORI_BAG ]
ADO RDD xHarbour
Antonio, I needed an VAR to save the controling index. All indexes are "virtual" they really dont exist as files in ADORDD. The indexes are SELECTs Its solved. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Now I need to know RDD function to DBRLOCKLIST() What is aLockInfo[ UR_LI_METHOD ] := DBLM_MULTIPLE ?
ADO RDD xHarbour
Antonio, Very good, you are progressing <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> have a look at this: [url:2j0oyblq]http&#58;//www&#46;ousob&#46;com/ng/53tecref/ng42f2a&#46;php[/url:2j0oyblq]
ADO RDD xHarbour
Antonio, Ok got it! How can I have DBRLOCKLIST() to work?
ADO RDD xHarbour
Antonio, See how it is implemented in Harbour: [code=fw:18xx2qsy]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> DBRLOCKLIST <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;AREAP pArea = <span style="color: #000000;">&#40;</span> AREAP <span style="color: #000000;">&#41;</span> hb_rddGetCurrentWorkAreaPointer<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> pArea <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; PHB_ITEM pList = hb_itemArrayNew<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; SELF_INFO<span style="color: #000000;">&#40;</span> pArea, DBI_GETLOCKARRAY, pList <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; hb_itemReturnRelease<span style="color: #000000;">&#40;</span> pList <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; hb_errRT_DBCMD<span style="color: #000000;">&#40;</span> EG_NOTABLE, EDBCMD_NOTABLE, <span style="color: #00C800;">NULL</span>, HB_ERR_FUNCNAME <span style="color: #000000;">&#41;</span>;<br /><br /><span style="color: #000000;">&#125;</span></div>[/code:18xx2qsy]
ADO RDD xHarbour
Antonio, Sorry didnt catch it. I'm not familiar with harbour C ext. Where can I keep the locklist array updated in adordd everytime ADO_LOCK and ADO_UNLOCK are called? Locks dont really exist in the files its only for record position information.
ADO RDD xHarbour
Antonio, In that C code an array is created and filled with an array (DBI_GETLOCKARRAY) The question here is: Does it have sense to talk about this in ADO ? Do we just return an empty array ? Are we going to need those locks positions ? I guess no
ADO RDD xHarbour
Antonio, Its absolutly necessary to keep the locklist array. In transactions we lock and append all necessary records and then we loop trough the locklist with dbgoto to make all replaces. If a lock fails the transaction fails. Altough with ADO never fails as real locks dont matter we still need to have it filled with bookmarks to return to each record later.
ADO RDD xHarbour
Antonio, ok, you can save them using bookmarks, yes
ADO RDD xHarbour
Antonio, I need your support here because I still dont know how to do it.
ADO RDD xHarbour
Antonio, Please post your most recent adordd.prg file and I review it, thanks
ADO RDD xHarbour
Antonio, Sent to your email.
ADO RDD xHarbour
Antonio, Your code looks fine. What is missing ? If you don't mind I am going to share your version so other users may try it too, thanks [url:1z91ljii]https&#58;//bitbucket&#46;org/fivetech/fivewin-contributions/downloads/adordd&#46;prg[/url:1z91ljii]
ADO RDD xHarbour
Antonio, Dbrocklist() returns zero
ADO RDD xHarbour
Antonio, Please place a MsgInfo() in function ADO_ORDINFO() and check if it is shown when you call to Dbrlocklist()
ADO RDD xHarbour
Antonio, I did that already. Dbrlocklist doesnt call ado_ordinfo.
ADO RDD xHarbour
Antonio, Dbrlocklist is a area/table related information and not index. I think drblocklist is calling dbinfo with the corresponding #define. When we open a recorset we load to UR_SUPER_OPEN( nWA, aOpenInfo ) all openinfo. Can we do something of the kind with locks and unlocks to keep locklist always updated?
ADO RDD xHarbour
Antonio, Yes, you are right, it is DbInfo() What we are not going to lock any records, so what do you need that for ?
ADO RDD xHarbour
[quote="AHF":1st6raph]Antonio, Its absolutly necessary to keep the locklist array. In transactions we lock and append all necessary records and then we loop trough the locklist with dbgoto to make all replaces. If a lock fails the transaction fails. Altough with ADO never fails as real locks dont matter we still need to have it filled with bookmarks to return to each record later.[/quote:1st6raph]
ADO RDD xHarbour
Antonio, So the array that you have to return is aWdata[ WA_LOCKLIST ]
ADO RDD xHarbour
Antonio, Yes thats the array I created for that porpose and its already updated by ado_lock and ado_unlock.
ADO RDD xHarbour
Can't you return it from DbInfo() ?
ADO RDD xHarbour
Antonio, No. The problem is that I must pass somewhere the locklist array that I build but dont know where and how. I dont have any other rdd.prg source to check it out.
ADO RDD xHarbour
See the source code for dbinfo(): [code=fw:3ihvhqz9]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> DBINFO <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;AREAP pArea = <span style="color: #000000;">&#40;</span> AREAP <span style="color: #000000;">&#41;</span> hb_rddGetCurrentWorkAreaPointer<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> pArea <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; PHB_ITEM pIndex;<br /><br />&nbsp; &nbsp; &nbsp; pIndex = hb_param<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, HB_IT_NUMERIC <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> pIndex <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PHB_ITEM pInfo = hb_itemNew<span style="color: #000000;">&#40;</span> hb_param<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, HB_IT_ANY <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SELF_INFO<span style="color: #000000;">&#40;</span> pArea, <span style="color: #000000;">&#40;</span> HB_USHORT <span style="color: #000000;">&#41;</span> hb_itemGetNI<span style="color: #000000;">&#40;</span> pIndex <span style="color: #000000;">&#41;</span>, pInfo <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hb_itemReturnRelease<span style="color: #000000;">&#40;</span> pInfo <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hb_errRT_DBCMD<span style="color: #000000;">&#40;</span> EG_ARG, EDBCMD_DBINFOBADPARAMETER, <span style="color: #00C800;">NULL</span>, HB_ERR_FUNCNAME <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; hb_errRT_DBCMD<span style="color: #000000;">&#40;</span> EG_NOTABLE, EDBCMD_NOTABLE, <span style="color: #00C800;">NULL</span>, HB_ERR_FUNCNAME <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span></div>[/code:3ihvhqz9]
ADO RDD xHarbour
Antonio, I dont understand it. As I said before I dont know nothing about rdd specs and the way of working. I define #define WA_LOCKLIST 22 Cant we do with dbrlocklist something like aADOFunc[ UR_LOCK ] := (@ADO_LOCK()) Then I would have acess to my locklist array.