New AdoRDD (free)
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- goosfancito
- Posts: 1392
- Joined: Fri Oct 07, 2005 7:08 pm
Re: Sample
Hello,
Can you post one example Insert, Update, browse using ADO + ORACLE? thank´s.
Gustavo.
Can you post one example Insert, Update, browse using ADO + ORACLE? thank´s.
Gustavo.
digicad wrote:#include "adordd.ch"
REQUEST ADORDD
function Main()
LOCAL db
/*
// Example for creation of Oracle connection string
cDataSource := ""
cUserID := "digi"
cPassword := "digi"
OPEN CONNECTION "Provider=MSDAORA.1;Persist Security Info=False"+IIF( cDataSource == "", "", ";Data source=" + cDataSource ) + ";User ID=" + cUserID + ";Password=" + cPassword TO db
USE NewQuery VIA "ADORDD" QUERY "SELECT Objekat# AS Sifra, Naziv, NVL(X,0) AS XCOOR, NVL(Y,0) AS YCOOR FROM Objekat ORDER BY Sifra" NEW
*/
// Example for creation of MySQL connection string
cServer := "www.freesql.org"
cUserID := "myuser"
cPassword := "mypass"
cDatabase := "test00"
OPEN CONNECTION "DRIVER={MySQL ODBC 3.51 Driver};database="+cDatabase+";server=" + cServer + ";uid=" + cUserID + ";pwd=" + cPassword TO db
USE Accounts VIA "ADORDD" TABLE "ACCOUNTS" NEW
/*
// Example for creation of Access connection string
cDatabase := "Test.MDB"
OPEN CONNECTION "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + cDataBase TO db
USE SampleAccess VIA "ADORDD" TABLE "Tabla1" NEW
*/
Browse()
CLOSE ALL
return nil
Un aporte chico hace grandes cambios.
Apoyemos al proyecto "Hogar pimpinela"
Bajate la aplicación (gratuita) y encuentra en ella toda la info de como podes colaborar.
GRACIAS!
https://play.google.com/store/apps/deta ... .acomprar
Apoyemos al proyecto "Hogar pimpinela"
Bajate la aplicación (gratuita) y encuentra en ella toda la info de como podes colaborar.
GRACIAS!
https://play.google.com/store/apps/deta ... .acomprar
-
- Posts: 603
- Joined: Sun May 04, 2008 8:44 pm
Re: New AdoRDD (free)
I´m tring use more show me GPF when execute mysql.EXE
Re: New AdoRDD (free)
Hi antonio
i copied from a mail posted by Roberto lopez on harbour developer mailing list
testing adordd with harbour beta3 and found a problem with rddado sample.
Harbour 2.0 Beta 3 http://www.syenar.hu/harbour/
will the problem due by new ole?
The sample (contrib\rddado\access1.prg) works, but exiting browse with [ESC] it gives the following error:
Error BASE/3012 Argument error: FIND
Called from WIN_OLEAUTO:FIND(0) OPEN
Called from ADO_LOCATE(0) N(0)
Called from __DBLOCATE(0)
Called from MAIN(34) 0)
Called from MAIN(11)
I've compiled with: 'hbmk2 access2.prg'
If you modify the sample to display recno() value you'll find that it always return 0 (It worked fine in Harbour 1.01)
This problem causes that HMG RDDADO Browse samples to crash, since HMG browse control relies on values returned by recno() function (of course, this is a problem for non-HMG users too).
Will be usefull a function that return ado version using oConnection.Version
The only source of rddado.lib is rddado.prg & adordd.ch a rdd wil be
done in prg thanks to usrrd
i copied from a mail posted by Roberto lopez on harbour developer mailing list
testing adordd with harbour beta3 and found a problem with rddado sample.
Harbour 2.0 Beta 3 http://www.syenar.hu/harbour/
will the problem due by new ole?
The sample (contrib\rddado\access1.prg) works, but exiting browse with [ESC] it gives the following error:
Error BASE/3012 Argument error: FIND
Called from WIN_OLEAUTO:FIND(0) OPEN
Called from ADO_LOCATE(0) N(0)
Called from __DBLOCATE(0)
Called from MAIN(34) 0)
Called from MAIN(11)
I've compiled with: 'hbmk2 access2.prg'
If you modify the sample to display recno() value you'll find that it always return 0 (It worked fine in Harbour 1.01)
This problem causes that HMG RDDADO Browse samples to crash, since HMG browse control relies on values returned by recno() function (of course, this is a problem for non-HMG users too).
Will be usefull a function that return ado version using oConnection.Version
The only source of rddado.lib is rddado.prg & adordd.ch a rdd wil be
done in prg thanks to usrrd
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: New AdoRDD (free)
Massimo,
In Harbour's OLE implementation, the error value returned in HRESULT from a Method call is reported as an arguments error, without providing any extra OLE error information:
A workaround to get more info about the OLE error is to modify the error block:
that way Roberto will be able to get a better feedback about the error
In xharbour, the equivalent function name is OLE2TXTERROR()
In Harbour's OLE implementation, the error value returned in HRESULT from a Method call is reported as an arguments error, without providing any extra OLE error information:
Code: Select all
if( lOleError != S_OK )
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
A workaround to get more info about the OLE error is to modify the error block:
Code: Select all
ErrorBlock( { | o | MsgInfo( WIN_OLEERRORTEXT(), ProcLine( 2 ) ) } )
In xharbour, the equivalent function name is OLE2TXTERROR()
Re: New AdoRDD (free)
I receive error DISP_E_EXCEPTION after press esc to exit from browse
and after my recno() display 0
Please Antonio
Can you help me?
#include "adordd.ch"
REQUEST ADORDD
function Main()
ErrorBlock( { | o | alert( WIN_OLEERRORTEXT(), ProcLine( 2 ) ) } )
DbCreate( "test2.mdb;table1", { { "FIRST", "C", 10, 0 },;
{ "LAST", "C", 10, 0 },;
{ "AGE", "N", 8, 0 } }, "ADORDD" )
USE test2.mdb VIA "ADORDD" TABLE "table1"
APPEND BLANK
test2->First := "Homer"
test2->Last := "Simpson"
test2->Age := 45
APPEND BLANK
test2->First := "Lara"
test2->Last := "Croft"
test2->Age := 32
GO TOP
Browse()
GO TOP
locate for TEST2->First = "Lara"
? FOUND()
? "Recno"
?? recno() // here display 0
USE
return nil
and after my recno() display 0
Please Antonio
Can you help me?
#include "adordd.ch"
REQUEST ADORDD
function Main()
ErrorBlock( { | o | alert( WIN_OLEERRORTEXT(), ProcLine( 2 ) ) } )
DbCreate( "test2.mdb;table1", { { "FIRST", "C", 10, 0 },;
{ "LAST", "C", 10, 0 },;
{ "AGE", "N", 8, 0 } }, "ADORDD" )
USE test2.mdb VIA "ADORDD" TABLE "table1"
APPEND BLANK
test2->First := "Homer"
test2->Last := "Simpson"
test2->Age := 45
APPEND BLANK
test2->First := "Lara"
test2->Last := "Croft"
test2->Age := 32
GO TOP
Browse()
GO TOP
locate for TEST2->First = "Lara"
? FOUND()
? "Recno"
?? recno() // here display 0
USE
return nil
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: New AdoRDD (free)
Massimo,
Have you tested it in Windows 7 ?
Have you tested it in Windows 7 ?
Re: New AdoRDD (free)
I try win7 in next hours (it is at home)
is sufficent run executable?
or want recompile entire harbour, or application
is sufficent run executable?
or want recompile entire harbour, or application
Re: New AdoRDD (free)
Follow result on win 7 (32 bit) seem similarof WINDOWS VISTA
Harbour with rddado Recompiled from CVS
access1.prg
Error base 3012 argument error Open
access2.prg
Work dbedit
after dbedit receive Error base 3012 argument error find
accesstst.prg modified version under Antonio's indication
DISP_E_EXCEPTION
if you send me via mail your executable renamed and zipped i can try with it Windows 7 32/64
Harbour with rddado Recompiled from CVS
access1.prg
Error base 3012 argument error Open
access2.prg
Work dbedit
after dbedit receive Error base 3012 argument error find
accesstst.prg modified version under Antonio's indication
DISP_E_EXCEPTION
if you send me via mail your executable renamed and zipped i can try with it Windows 7 32/64
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: New AdoRDD (free)
Massimo,
We get the same errors here
It seems as Harbour new OLE is broken somehow or that ADO for MDB is different now.
We get the same errors here
It seems as Harbour new OLE is broken somehow or that ADO for MDB is different now.
Re: New AdoRDD (free)
Imo the problem non seem ole related
IMO adordd not undestrand xbase alias
// http://msdn.microsoft.com/en-us/library ... S.10).aspx
Follow sample try reproduce two problem recno,find
FUNCTION MAIN()
LOCAL oRs := CREATEOBJECT( "ADODB.Recordset" )
oRs:Open( "SELECT * FROM table1 ORDER BY First", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.mdb", 2, 1 )
ORS:FIND("First = 'Lara'",0) // OK
? "recno"
?? iif( oRS:AbsolutePosition == -3, oRS:RecordCount() + 1, oRS:AbsolutePosition )
? "second"
ORS:FIND("Table1->First = 'Lara'",0) // ERROR
RETURN
// error also
ORS:FIND("[Table1]![First] = 'Lara'",0) // ERROR
IMO adordd not undestrand xbase alias
// http://msdn.microsoft.com/en-us/library ... S.10).aspx
Follow sample try reproduce two problem recno,find
FUNCTION MAIN()
LOCAL oRs := CREATEOBJECT( "ADODB.Recordset" )
oRs:Open( "SELECT * FROM table1 ORDER BY First", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.mdb", 2, 1 )
ORS:FIND("First = 'Lara'",0) // OK
? "recno"
?? iif( oRS:AbsolutePosition == -3, oRS:RecordCount() + 1, oRS:AbsolutePosition )
? "second"
ORS:FIND("Table1->First = 'Lara'",0) // ERROR
RETURN
// error also
ORS:FIND("[Table1]![First] = 'Lara'",0) // ERROR
Antonio Linares wrote:Massimo,
We get the same errors here
It seems as Harbour new OLE is broken somehow or that ADO for MDB is different now.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: New AdoRDD (free)
Massimo,
You have to do it this way:
ORS:FIND( "First = 'Lara'", 0 )
as the recordset already selected the Table1 table
You have to do it this way:
ORS:FIND( "First = 'Lara'", 0 )
as the recordset already selected the Table1 table
Re: New AdoRDD (free)
problem is that in original sample msaccess2.prg work fine with :
locate for First = "Lara"
istead not work
locate for TEST2->First = "Lara"
IMO is a internal problem of adordd that is not able manage alias
need in sqltranslate SOMETHING LIKE
cExpr := StrTran( cExpr, ALIAS()+"->", "" )
but case insensitive
locate for First = "Lara"
istead not work
locate for TEST2->First = "Lara"
IMO is a internal problem of adordd that is not able manage alias
need in sqltranslate SOMETHING LIKE
cExpr := StrTran( cExpr, ALIAS()+"->", "" )
but case insensitive
Antonio Linares wrote:Massimo,
You have to do it this way:
ORS:FIND( "First = 'Lara'", 0 )
as the recordset already selected the Table1 table
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: New AdoRDD (free)
Massimo,
Alias are automatically managed by the Harbour RDD engine.
ADO does not need to manage alias at all
Alias are automatically managed by the Harbour RDD engine.
ADO does not need to manage alias at all
Re: New AdoRDD (free)
I have printed in ado_locate find
and AWADATA[WA_SCOPEINFO][UR_SI_CFOR]
contain alias so generate error
Have you a solution or better not wasting our time on rddado?
Intresting for future replacement od ADO http://pear.php.net/package/MDB2
and AWADATA[WA_SCOPEINFO][UR_SI_CFOR]
contain alias so generate error
Have you a solution or better not wasting our time on rddado?
Intresting for future replacement od ADO http://pear.php.net/package/MDB2
Antonio Linares wrote:Massimo,
Alias are automatically managed by the Harbour RDD engine.
ADO does not need to manage alias at all