Page 1 of 2

Uso de ADORDD con Access

Posted: Wed May 13, 2009 11:29 am
by claudiotedesco
Hola
Estoy comenzando a usar ADORDD con HMG 2.9.1 con ACCESS y probe el ejemplo que trae en la
carpeta samples/adordd-1/demo.prg
y funciona correctamente.
Ahora queria armar un query con otras tablas, alguien tiene un ejemplo porque no pude armarlo como yo pensaba que era.
Les agradezco mucho su ayuda
Claudio

Re: Uso de ADORDD con Access

Posted: Wed May 13, 2009 2:08 pm
by Vanguarda
Hi friend,

use this, for switch the table on AdoRDD

USE test2.mdb VIA "ADORDD" TABLE "table1"

Replace test2.mdb for you access.mdb file
Replace the table name with the name of a table that contains your file access.mdb

__________________________________________
USE test2.mdb VIA "ADORDD" TABLE "Clientes"
USE test2.mdb VIA "ADORDD" TABLE "Produtos"
USE test2.mdb VIA "ADORDD" TABLE "Cidades"
__________________________________________

a long time ago, i used this LIB. Today i use ODBC+SQL in any Files of data or SGDB. Is very simple, and fast.

I think it would be better to use directly the protocol ODBC with "query" in sql.

I hope I have helped,

regards,


ps: Sorry my bad english :lol:

Re: Uso de ADORDD con Access

Posted: Wed May 13, 2009 2:39 pm
by sudip
Hi,

Please go through C:\hmg\SAMPLES\ADORDD-1 sample. :)

Regards.

Sudip

Re: Uso de ADORDD con Access

Posted: Wed May 13, 2009 4:08 pm
by claudiotedesco
Yo arme este ejemplo pero me da error, esta bien armado el query?
Gracias.

#include "adordd.ch"
#include "minigui.ch"

function Main()

DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 640 HEIGHT 480 ;
TITLE 'MiniGUI Browse Demo)' ;
MAIN NOMAXIMIZE ;
ON INIT CreateTable() ;
ON RELEASE CloseTable()

@ 10,10 BROWSE Browse_1 ;
WIDTH 610 ;
HEIGHT 390 ;
HEADERS { 'NOMBRE' , 'DIRECCION' , 'TELEFONO' } ;
WIDTHS { 150 , 150 , 150 } ;
WORKAREA BASE ;
FIELDS { 'NOMC' , 'DIRT' , 'TELT' }

END WINDOW

CENTER WINDOW Form_1

Form_1.Browse_1.SetFocus

ACTIVATE WINDOW Form_1

return nil

Procedure CreateTable
wsql = "SELECT BASE.NOMC, BASE.DIRT, BASE.TELT FROM BASE ORDER BY BASE.NOMC"


USE BASE.mdb VIA "ADORDD" QUERY wsql ;

GO TOP

Return

Procedure CloseTable

USE

Return


Re: Uso de ADORDD con Access

Posted: Wed May 13, 2009 4:47 pm
by Vanguarda
Hi friend claudiotedesco,

when we working with AdoRdd, not is aply the Querys SQL.

Try This

USE test2.mdb VIA "ADORDD" TABLE "Clientes"

aAdd( MyArray_, Clientes->Field1 )
aAdd( MyArray_, Clientes->Field2 )
aAdd( MyArray_, Clientes->Field3 )

********************************************
Procedure CreateTable
wsql = "SELECT BASE.NOMC, BASE.DIRT, BASE.TELT FROM BASE ORDER BY BASE.NOMC"


USE BASE.mdb VIA "ADORDD" QUERY wsql ;

It don´t work,
*******************************************

See C:\hmg\SAMPLES\ADORDD-1 for details


with best regards,

Re: Uso de ADORDD con Access

Posted: Wed May 13, 2009 4:47 pm
by Vanguarda
Work with this like you work as Files .DBF, but don´t use Index Files or commands


with best regards,

Re: Uso de ADORDD con Access

Posted: Thu May 14, 2009 11:36 am
by claudiotedesco
Lo que queria yo era usar varias tablas que tengo en un archivo de access y relizar un Query para obtener una determinada información.
Entonces segun decis no se puede usar el Query para Access o comprendi mal?
Te agradezco tu ayuda
Claudio

Re: Uso de ADORDD con Access

Posted: Thu May 14, 2009 11:49 am
by sudip
Hi,

Is there any easy way to determine whether a particular table exists in a particular database with ADORDD?

With best regards.

Sudip

Re: Uso de ADORDD con Access

Posted: Thu May 14, 2009 11:52 am
by Vanguarda
Hi friend,

The QUERYS in Sql only used when you work whit ODBC.
In AdoRDD you can´t use QUERY SQL. You can use Commands xBase for manipulation of files. But the commands concerning the index it can´t use.

Per Example:

In xBase Standard Commands.

Use Test.Dbf Alias Teste1 Index Clientes New Shared

so we use
DbSeek()
Found()
and Index(s)

In AdoRdd

USE test2.mdb VIA "ADORDD" TABLE "Clientes"

Replace the command dbSeek for LOCATE and use SET SCOPE for delimit area on search, because LOCATE COMMAND is very slow in DBF´s very large.

LOCATE FOR EMPRESA = c_Variable_OfCod.

********************************************************************************

Now, if you want use QUERY´s SQL, you can try with ODBC.

See C:\hmg\SAMPLES\ODBC for details

i personally think is much better with ODBC. Try it. So you will can use all QUERY´s SQL, for search and ordering how you want.


i Hope i Have helped,

with best regards,

PS: Sorry my bad english. :)

Re: Uso de ADORDD con Access

Posted: Thu May 14, 2009 12:18 pm
by Vanguarda
sudip wrote:Hi,

Is there any easy way to determine whether a particular table exists in a particular database with ADORDD?

With best regards.

Sudip

Hi sudip,

if exist i don´t know, sorry. I don´t work with AdoRdd,
I used the library is a long time ago.

Today i use ODBC with Firebird (and many others) . But like very most firebird SGDB


Regards,