ADO RDD xHarbour
Re: ADO RDD xHarbour
Lucas,
Error lines dont match that version.
Can you post lines here?
Tlocks file does not exist? Was not created?
Error lines dont match that version.
Can you post lines here?
Tlocks file does not exist? Was not created?
Regards
Antonio H Ferreira
Antonio H Ferreira
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: ADO RDD xHarbour
Hello,
Please, try this sample:
Please, try this sample:
Code: Select all
#include "fivewin.ch"
#include "adordd\adordd.ch"
#include "adordd\adordd.prg"
REQUEST ADORDD, DBFCDX
function Main()
RddRegister("ADORDD",1)
RddSetDefault("ADORDD")
SET ADODBF TABLES INDEX LIST TO { { "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"}} }
SET ADO TABLES INDEX LIST TO {{ "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"}} }
SET ADO DEFAULT RECNO FIELD TO "ID"
// SET AUTOPEN ON //might be OFF if you wish
// SET AUTORDER TO 1 // first index opened can be other
SET ADO DEFAULT DATABASE TO "LUCASTABLE.MDB" ENGINE TO "ACCESS" USER TO "" PASSWORD TO ""
// SET ADO LOCK CONTROL SHAREPATH TO "C:" RDD TO "DBFCDX"
IF !FILE( "LUCASTABLE.MDB" )
msginfo("creating LUCASTABLE.MDB")
DbCreate( "TABLE1", { { "FIRST", "C", 30, 0 },;
{ "LAST", "C", 30, 0 },;
{ "AGE", "N", 8, 0 },;
{ "ID" ,"+",10, 0} }, "ADORDD" )
DbCreate( "LUCAS", { { "NOMBRE", "C", 30, 0 },;
{ "ID" ,"+",10, 0} }, "ADORDD" )
ENDIF
//
// Open DBFS
USE LUCAS NEW ALIAS "LUCAS"
LUCAS->(ORDSETFOCUS("LUCAS1"))
?ordsetfocus()
BROWSE()
//
USE TABLE1 ALIAS "TEST2" NEW
OrdSetFocus("TEST1")
?ordsetfocus()
TEST2->( OrdSetFocus("TEST2") )
msginfo(ordsetfocus() + SPACE(20), "Changed to TEST2" )
XBROWSER FASTEDIT
APPEND BLANK
test2->First := "HOMER si no Homer"
test2->Last := "Simpson"
test2->Age := 45
APPEND BLANK
test2->First := cValToChar( nRandom() ) + " aaa Lara"
test2->Last := "Croft si no"
test2->Age := 32
GO TOP
Browse()
DbCloseAll()
return nil
Muchas gracias. Many thanks.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: ADO RDD xHarbour
Antonio,
Also indexes with conditions do not work, here LUCAS2:
SET ADODBF TABLES INDEX LIST TO { { "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
{"LUCAS2", "NOMBRE", "FOR NOMBRE = 'AGAMENON'"} } }
Also indexes with conditions do not work, here LUCAS2:
SET ADODBF TABLES INDEX LIST TO { { "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
{"LUCAS2", "NOMBRE", "FOR NOMBRE = 'AGAMENON'"} } }
Muchas gracias. Many thanks.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
Re: ADO RDD xHarbour
Lucas,
Your trial its working ok!
Please note as in Harbour before ORDSETFOCUS() you need to SET INDEX TO if SET AUTO OPEN not defined.
Appends are done ok.
Tlocks its created ok.
Your trial its working ok!
Please note as in Harbour before ORDSETFOCUS() you need to SET INDEX TO if SET AUTO OPEN not defined.
Appends are done ok.
Tlocks its created ok.
Regards
Antonio H Ferreira
Antonio H Ferreira
Re: ADO RDD xHarbour
Lucas,
Im not working with xBrowse so I didnt try with it.
Is the problem with xbrowse? Does browse works ok?
Im not working with xBrowse so I didnt try with it.
Is the problem with xbrowse? Does browse works ok?
Regards
Antonio H Ferreira
Antonio H Ferreira
Re: ADO RDD xHarbour
Lucas,
Its working ok.
Correct syntax:
Its working ok.
Correct syntax:
Code: Select all
SET ADODBF TABLES INDEX LIST TO { { "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE","NOMBRE = 'AGAMENON'"}} }
SET ADO TABLES INDEX LIST TO {{ "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE","WHERE NOMBRE = 'AGAMENON'"}}
Regards
Antonio H Ferreira
Antonio H Ferreira
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: ADO RDD xHarbour
Antonio,
Xbrowse seems to be working fine.
I delete tlocks and it seems to be working now.
But indexes with conditions no:
LUCAS2 index does not eval the condition.
Xbrowse seems to be working fine.
I delete tlocks and it seems to be working now.
But indexes with conditions no:
Code: Select all
SET ADO TABLES INDEX LIST TO {{ "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
{"LUCAS2", "NOMBRE" } } }
SET ADODBF TABLES INDEX LIST TO { { "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
{"LUCAS2", "NOMBRE", "WHERE NOMBRE = 'AGAMENON'"} } }
//
// Open DBFS
USE LUCAS NEW ALIAS "LUCAS"
LUCAS->(ORDSETFOCUS("LUCAS1"))
?ordsetfocus()
BROWSE()
LUCAS->(ORDSETFOCUS("LUCAS2"))
dbgotop()
?ordsetfocus()
xbrowser fastedit
LUCAS2 index does not eval the condition.
Muchas gracias. Many thanks.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
Re: ADO RDD xHarbour
Lucas,
Place in adordd at line 2231 MSGINFO(CSQL) is teh select correct?
Place in adordd at line 2231 MSGINFO(CSQL) is teh select correct?
Regards
Antonio H Ferreira
Antonio H Ferreira
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: ADO RDD xHarbour
In wich function?.
I had to remove some of your starting code at adordd.prg so as to compile with Harbour.
I had to remove some of your starting code at adordd.prg so as to compile with Harbour.
Muchas gracias. Many thanks.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
Re: ADO RDD xHarbour
Lucas,
Index condition its working
Lucas table its empty I try it with:
{"TEST3", "AGE","WHERE AGE = 32"} }
Please place this function in your trials to check rdd status.
Index condition its working
Lucas table its empty I try it with:
{"TEST3", "AGE","WHERE AGE = 32"} }
Please place this function in your trials to check rdd status.
Code: Select all
FUNCTION rddreport()
LOCAL cerrorlog := "",n,j,ntarget,x
for n = 1 to 255
if ! Empty( Alias( n ) )
cErrorLog += CRLF + Str( n, 3 ) + ": " + If( Select() == n,"=> ", " " ) + ;
PadR( Alias( n ), 15 ) + Space( 20 ) + "NomeRDD: " + ;
( Alias( n ) )->( RddName() ) + CRLF
cErrorLog += " ==============================" + CRLF
cErrorLog += " RecNo RecCount BOF EOF" + CRLF
cErrorLog += " " + Transform( ( Alias( n ) )->( RecNo() ), "99999" ) + ;
" " + Transform( ( Alias( n ) )->( RecCount() ), "99999" ) + ;
" " + cValToChar( ( Alias( n ) )->( BoF() ) ) + ;
" " + cValToChar( ( Alias( n ) )->( EoF() ) ) + CRLF + CRLF
cErrorLog += " Índices em uso " + Space( 23 ) + "TagName" + CRLF
for j = 1 to 15
if ! Empty( ( Alias( n ) )->( IndexKey( j ) ) )
cErrorLog += Space( 8 ) + ;
If( ( Alias( n ) )->( IndexOrd() ) == j, "=> ", " " ) + ;
PadR( ( Alias( n ) )->( IndexKey( j ) ), 35 ) + ;
( Alias( n ) )->( OrdName( j ) ) + ;
CRLF
endif
next
cErrorLog += CRLF + " Relações em uso " + CRLF
for j = 1 to 8
if ! Empty( ( nTarget := ( Alias( n ) )->( DbRSelect( j ) ) ) )
cErrorLog += Space( 8 ) + Str( j ) + ": " + ;
"TO " + ( Alias( n ) )->( DbRelation( j ) ) + ;
" INTO " + Alias( nTarget ) + CRLF
// uValue = ( Alias( n ) )->( DbRelation( j ) )
// cErrorLog += cValToChar( &( uValue ) ) + CRLF
endif
next
x := (alias(n))->(dbrlocklist())
cErrorLog += Space( 8 ) +"Registos fechados "+CRLF
for j = 1 to len(x)
cErrorLog += Space( 8 ) + "Registo nr "+str(x[j])+CRLF
next
endif
next
SHOWMEMO(cerrorlog)
RETURN .t.
Regards
Antonio H Ferreira
Antonio H Ferreira
Re: ADO RDD xHarbour
Lucas,
Can you help me with this?May be you can help me.
Im still with a problems with dates in MYSQL.
1) Edit a date field and place any date ok.
2) Delete that date and leave it blank date ok
3) Edit again and place a new date ok bu if edit iit again and keep the date blank error!
I try with adoshowerror but nothing only unknown error.
Do you have any clue?
How can we set a date field with empty date?
Regards
Antonio H Ferreira
Antonio H Ferreira
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: ADO RDD xHarbour
Antonio,
Where are you putting this?
{"TEST3", "AGE","WHERE AGE = 32"} }
In SET ADO TABLES or in SET ADODBF TABLES?.
As long as I can´t use adordd in a full working application, I can´t test dates behaviour.
Where are you putting this?
{"TEST3", "AGE","WHERE AGE = 32"} }
In SET ADO TABLES or in SET ADODBF TABLES?.
As long as I can´t use adordd in a full working application, I can´t test dates behaviour.
Muchas gracias. Many thanks.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
Re: ADO RDD xHarbour
Lucas,
In SET ADODBF TABLES only clipper expressions. In conditions please don't place FOR or WHILE keyword but only the condition.Ex "AGE = 32"
That s it.
In SET ADO TABLES the sql expressions never clipper expressionWhere are you putting this?
{"TEST3", "AGE","WHERE AGE = 32"} }
In SET ADO TABLES or in SET ADODBF TABLES?.
In SET ADODBF TABLES only clipper expressions. In conditions please don't place FOR or WHILE keyword but only the condition.Ex "AGE = 32"
That s it.
If you create a date field in your trail DB you will see what is the problem when changing it to empty.As long as I can´t use adordd in a full working application, I can´t test dates behaviour.
Regards
Antonio H Ferreira
Antonio H Ferreira
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: ADO RDD xHarbour
Antonio,
It´s not working:
SET ADO TABLES INDEX LIST TO {{ "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
{"LUCAS2", "NOMBRE", },;
{"LUCAS3", "NOMBRE"} } }
SET ADODBF TABLES INDEX LIST TO { { "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
{"LUCAS2", "NOMBRE", "NOMBRE = 'AGAMENON'"},;
{"LUCAS3", "NOMBRE", "ACTIVO = .T." } } }
I set ordsetfocus to LUCAS2 or LUCAS3 with NO LUCK.
It´s not working:
SET ADO TABLES INDEX LIST TO {{ "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
{"LUCAS2", "NOMBRE", },;
{"LUCAS3", "NOMBRE"} } }
SET ADODBF TABLES INDEX LIST TO { { "TABLE1", {"TEST1", "FIRST"} ,;
{"TEST2", "LAST"} ,;
{"TEST3", "AGE"} },;
{"LUCAS", {"LUCAS1", "NOMBRE"} ,;
{"LUCAS2", "NOMBRE", "NOMBRE = 'AGAMENON'"},;
{"LUCAS3", "NOMBRE", "ACTIVO = .T." } } }
I set ordsetfocus to LUCAS2 or LUCAS3 with NO LUCK.
Muchas gracias. Many thanks.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: ADO RDD xHarbour
1: => LUCAS NomeRDD: ADORDD
==============================
RecNo RecCount BOF EOF
2 3 .F. .F.
Índices em uso TagName
NOMBRE LUCAS1
NOMBRE LUCAS2
=> NOMBRE LUCAS3
Relações em uso
Registos fechados
Muchas gracias. Many thanks.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.