Delphi - Abrir informe de microsoft access

 
Vista:
sin imagen de perfil

Abrir informe de microsoft access

Publicado por Conetl (3 intervenciones) el 25/03/2003 01:30:49
ALguien me puede decir como abro un informe que esta contenido en una base de datos de access, actualmente trabajo los componentes KADAO pero no se como abrir el informe, desde ya gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Abrir informe de microsoft access

Publicado por Ernesto D'Spirito (706 intervenciones) el 25/03/2003 03:39:57
Tengo entendio que los informes no se pueden abrir desde las aplicaciones de manera autónoma, o sea, la única forma sería con automatización OLE para abrir el Access y hacer que abra la BD y muestre el informe.

Ernesto D'Spirito
http://www.latiumsoftware.com/es/index.php
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Abrir informe de microsoft access

Publicado por Victor (102 intervenciones) el 25/03/2003 15:52:50
Este código esta publicado en delphi3000.com:

var
Access: Variant;
begin
// open the Access application
try
Access := GetActiveOleObject('Access.Application');
except
Access := CreateOleObject('Access.Application');
end;
Access.Visible := True;

// open the database
//The second parameter specifies whether you want to open the
database in Exclusive mode
Access.OpenCurrentDatabase('C:\My Documents\Books.mdb', True);

// open the report
{The value for the second parameter should be one of
acViewDesign, acViewNormal, or acViewPreview. acViewNormal, which is the default, prints the report immediately. If you are not using the type library, you can define these values like this:

const
acViewNormal = $00000000;
acViewDesign = $00000001;
acViewPreview = $00000002;

The third parameter is for the name of a query in the current
database. The fourth parameter is for a SQL WHERE clause - the string must be valid SQL, minus the WHERE.}

Access.DoCmd.OpenReport('Titles by Author', acViewPreview,
EmptyParam, EmptyParam);

<...>
// close the database
Access.CloseCurrentDatabase;

// close the Access application
{const
acQuitPrompt = $00000000;
acQuitSaveAll = $00000001;
acQuitSaveNone = $00000002;}
Access.Quit(acQuitSaveAll);
end;

Se debe agregar el OleAuto en USES.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar