Hola a Todos !
Mirando en el codigo de AdsDataSource.prg
AdsCreateSqlStatement( "ADSSQL", 2 )
AdsExecuteSqlDirect( cCommand )
He estado buscando en todos los archivos de ayuda de Advantage y no veo esas
funciones, no si son de Xharbour o de Advantage ?
Gracias....
Saludos.
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para los Gurus de Advantage
-
- Mensajes: 114
- Registrado: Dom Dic 18, 2005 7:50 pm
- ignacio
- Site Admin
- Mensajes: 9457
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Para los Gurus de Advantage
Martin,
Son de xHarbour, pero logicamente acceden a sus equivalentes de Advantage:
HB_FUNC( ADSCREATESQLSTATEMENT )
{
UNSIGNED32 u32RetVal;
ADSAREAP pArea;
ADSHANDLE adsStatementHandle;
char szAlias[ HARBOUR_MAX_RDD_ALIAS_LENGTH + 1 ];
BOOL fResult = FALSE;
ADSHANDLE hConnect = HB_ADS_PARCONNECTION( 3 );
if( hConnect )
{
u32RetVal = AdsCreateSQLStatement( hConnect, &adsStatementHandle );
if( u32RetVal == AE_SUCCESS )
{
if( hb_parni( 2 ) == ADS_CDX )
{
AdsStmtSetTableType( adsStatementHandle, ADS_CDX );
}
if( !hb_rddInsertAreaNode( "ADS" ) )
{
AdsCloseSQLStatement( adsStatementHandle );
}
else
{
pArea = hb_rddGetADSWorkAreaPointer();
if( pArea )
{
hb_strncpy( szAlias, ISCHAR( 1 ) ? hb_parc( 1 ) : "ADSSQL",
HARBOUR_MAX_RDD_ALIAS_LENGTH );
pArea->atomAlias = hb_rddAllocWorkAreaAlias( szAlias,
pArea->uiArea );
if( !pArea->atomAlias )
{
hb_rddReleaseCurrentArea();
}
else
{
pArea->hTable = 0;
pArea->hOrdCurrent = 0;
pArea->hStatement = adsStatementHandle;
fResult = TRUE;
}
}
}
}
}
hb_retl( fResult );
}
HB_FUNC( ADSEXECUTESQLDIRECT )
{
UNSIGNED32 ulRetVal;
ADSHANDLE hCursor = 0;
ADSAREAP pArea;
/* -----------------10/9/2005 2:51PM-----------------
bh removed test for adsConnectHandle as it is not actually used;
the func was just trying to confirm a real connection existed
but we're trying to remove dependence on statics;
if we saved the nConnection to a WA, that would take care of it.
As is, it requires pArea->hStatement which we only allow created if
there's Connection so we should be OK.
* --------------------------------------------------*/
if( /*adsConnectHandle &&*/ ( pArea = hb_rddGetADSWorkAreaPointer() ) !=
0
&& pArea->hStatement && ISCHAR( 1 ) )
{
char * pucStmt = hb_adsOemToAnsi( hb_parc( 1 ), hb_parclen( 1 ) );
ulRetVal = AdsExecuteSQLDirect( pArea->hStatement, (UNSIGNED8 *)
pucStmt, &hCursor );
hb_adsOemAnsiFree( pucStmt );
if( ulRetVal == AE_SUCCESS )
{
if( hCursor )
{
DBOPENINFO pInfo;
memset( &pInfo, 0, sizeof( DBOPENINFO ) );
pInfo.abName = ( BYTE * ) "";
pInfo.fReadonly = TRUE;
pArea->hTable = hCursor;
SELF_OPEN( ( AREAP ) pArea, &pInfo );
}
else
{
adsCloseCursor( pArea );
}
hb_retl( TRUE );
}
else
{
AdsShowError( (UNSIGNED8 *) "ExecuteSQL error:" );
hb_retl( FALSE );
}
}
else
{
hb_retl( FALSE );
}
}
HB_FUNC( ADSPREPARESQL )
{
UNSIGNED32 ulRetVal;
ADSAREAP pArea;
/* -----------------10/9/2005 2:51PM-----------------
bh removed test for adsConnectHandle as it is not actually used;
the func was just trying to confirm a real connection existed
but we're trying to remove dependence on statics;
if we saved the nConnection to a WA, that would take care of it.
As is, it requires pArea->hStatement which we only allow created if
there's Connection so we should be OK.
* --------------------------------------------------*/
if( /*adsConnectHandle &&*/ ( pArea = hb_rddGetADSWorkAreaPointer() ) !=
0
&& pArea->hStatement && ISCHAR( 1 ) )
{
char * pucStmt = hb_adsOemToAnsi( hb_parc( 1 ), hb_parclen( 1 ) );
ulRetVal = AdsPrepareSQL( pArea->hStatement, (UNSIGNED8 *) pucStmt );
hb_adsOemAnsiFree( pucStmt );
if( ulRetVal == AE_SUCCESS )
{
hb_retl( TRUE );
}
else
{
AdsShowError( (UNSIGNED8 *) "PrepareSQL error:" );
hb_retl( FALSE );
}
}
else
{
hb_retl( FALSE );
}
}
HB_FUNC( ADSEXECUTESQL )
{
UNSIGNED32 ulRetVal;
ADSHANDLE hCursor = 0;
ADSAREAP pArea;
/* -----------------10/9/2005 2:51PM-----------------
bh removed test for adsConnectHandle as it is not actually used;
the func was just trying to confirm a real connection existed
but we're trying to remove dependence on statics;
if we saved the nConnection to a WA, that would take care of it.
As is, it requires pArea->hStatement which we only allow created if
there's Connection so we should be OK.
* --------------------------------------------------*/
if( /*adsConnectHandle &&*/ ( pArea = hb_rddGetADSWorkAreaPointer() ) !=
0
&& pArea->hStatement )
{
ulRetVal = AdsExecuteSQL( pArea->hStatement, &hCursor );
if( ulRetVal == AE_SUCCESS )
{
if( hCursor )
{
DBOPENINFO pInfo;
memset( &pInfo, 0, sizeof( DBOPENINFO ) );
pInfo.abName = ( BYTE * ) "";
pInfo.fReadonly = TRUE;
pArea->hTable = hCursor;
SELF_OPEN( ( AREAP ) pArea, &pInfo );
}
else
{
adsCloseCursor( pArea );
}
hb_retl( 1 );
}
else
{
AdsShowError( (UNSIGNED8 *) "ExecuteSQL error:" );
hb_retl( 0 );
}
}
else
{
hb_retl( 0 );
}
}
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Martin del Angel" <martindelangel@msn.com> escribió en el mensaje
news:[email=46523e4c@ozsrv2.ozlan.local...]46523e4c@ozsrv2.ozlan.local...[/email]
> Hola a Todos !
>
> Mirando en el codigo de AdsDataSource.prg
>
>
> AdsCreateSqlStatement( "ADSSQL", 2 )
> AdsExecuteSqlDirect( cCommand )
>
> He estado buscando en todos los archivos de ayuda de Advantage y no veo
> esas funciones, no si son de Xharbour o de Advantage ?
>
>
>
> Gracias....
>
>
> Saludos.
>
>
>
>
Son de xHarbour, pero logicamente acceden a sus equivalentes de Advantage:
HB_FUNC( ADSCREATESQLSTATEMENT )
{
UNSIGNED32 u32RetVal;
ADSAREAP pArea;
ADSHANDLE adsStatementHandle;
char szAlias[ HARBOUR_MAX_RDD_ALIAS_LENGTH + 1 ];
BOOL fResult = FALSE;
ADSHANDLE hConnect = HB_ADS_PARCONNECTION( 3 );
if( hConnect )
{
u32RetVal = AdsCreateSQLStatement( hConnect, &adsStatementHandle );
if( u32RetVal == AE_SUCCESS )
{
if( hb_parni( 2 ) == ADS_CDX )
{
AdsStmtSetTableType( adsStatementHandle, ADS_CDX );
}
if( !hb_rddInsertAreaNode( "ADS" ) )
{
AdsCloseSQLStatement( adsStatementHandle );
}
else
{
pArea = hb_rddGetADSWorkAreaPointer();
if( pArea )
{
hb_strncpy( szAlias, ISCHAR( 1 ) ? hb_parc( 1 ) : "ADSSQL",
HARBOUR_MAX_RDD_ALIAS_LENGTH );
pArea->atomAlias = hb_rddAllocWorkAreaAlias( szAlias,
pArea->uiArea );
if( !pArea->atomAlias )
{
hb_rddReleaseCurrentArea();
}
else
{
pArea->hTable = 0;
pArea->hOrdCurrent = 0;
pArea->hStatement = adsStatementHandle;
fResult = TRUE;
}
}
}
}
}
hb_retl( fResult );
}
HB_FUNC( ADSEXECUTESQLDIRECT )
{
UNSIGNED32 ulRetVal;
ADSHANDLE hCursor = 0;
ADSAREAP pArea;
/* -----------------10/9/2005 2:51PM-----------------
bh removed test for adsConnectHandle as it is not actually used;
the func was just trying to confirm a real connection existed
but we're trying to remove dependence on statics;
if we saved the nConnection to a WA, that would take care of it.
As is, it requires pArea->hStatement which we only allow created if
there's Connection so we should be OK.
* --------------------------------------------------*/
if( /*adsConnectHandle &&*/ ( pArea = hb_rddGetADSWorkAreaPointer() ) !=
0
&& pArea->hStatement && ISCHAR( 1 ) )
{
char * pucStmt = hb_adsOemToAnsi( hb_parc( 1 ), hb_parclen( 1 ) );
ulRetVal = AdsExecuteSQLDirect( pArea->hStatement, (UNSIGNED8 *)
pucStmt, &hCursor );
hb_adsOemAnsiFree( pucStmt );
if( ulRetVal == AE_SUCCESS )
{
if( hCursor )
{
DBOPENINFO pInfo;
memset( &pInfo, 0, sizeof( DBOPENINFO ) );
pInfo.abName = ( BYTE * ) "";
pInfo.fReadonly = TRUE;
pArea->hTable = hCursor;
SELF_OPEN( ( AREAP ) pArea, &pInfo );
}
else
{
adsCloseCursor( pArea );
}
hb_retl( TRUE );
}
else
{
AdsShowError( (UNSIGNED8 *) "ExecuteSQL error:" );
hb_retl( FALSE );
}
}
else
{
hb_retl( FALSE );
}
}
HB_FUNC( ADSPREPARESQL )
{
UNSIGNED32 ulRetVal;
ADSAREAP pArea;
/* -----------------10/9/2005 2:51PM-----------------
bh removed test for adsConnectHandle as it is not actually used;
the func was just trying to confirm a real connection existed
but we're trying to remove dependence on statics;
if we saved the nConnection to a WA, that would take care of it.
As is, it requires pArea->hStatement which we only allow created if
there's Connection so we should be OK.
* --------------------------------------------------*/
if( /*adsConnectHandle &&*/ ( pArea = hb_rddGetADSWorkAreaPointer() ) !=
0
&& pArea->hStatement && ISCHAR( 1 ) )
{
char * pucStmt = hb_adsOemToAnsi( hb_parc( 1 ), hb_parclen( 1 ) );
ulRetVal = AdsPrepareSQL( pArea->hStatement, (UNSIGNED8 *) pucStmt );
hb_adsOemAnsiFree( pucStmt );
if( ulRetVal == AE_SUCCESS )
{
hb_retl( TRUE );
}
else
{
AdsShowError( (UNSIGNED8 *) "PrepareSQL error:" );
hb_retl( FALSE );
}
}
else
{
hb_retl( FALSE );
}
}
HB_FUNC( ADSEXECUTESQL )
{
UNSIGNED32 ulRetVal;
ADSHANDLE hCursor = 0;
ADSAREAP pArea;
/* -----------------10/9/2005 2:51PM-----------------
bh removed test for adsConnectHandle as it is not actually used;
the func was just trying to confirm a real connection existed
but we're trying to remove dependence on statics;
if we saved the nConnection to a WA, that would take care of it.
As is, it requires pArea->hStatement which we only allow created if
there's Connection so we should be OK.
* --------------------------------------------------*/
if( /*adsConnectHandle &&*/ ( pArea = hb_rddGetADSWorkAreaPointer() ) !=
0
&& pArea->hStatement )
{
ulRetVal = AdsExecuteSQL( pArea->hStatement, &hCursor );
if( ulRetVal == AE_SUCCESS )
{
if( hCursor )
{
DBOPENINFO pInfo;
memset( &pInfo, 0, sizeof( DBOPENINFO ) );
pInfo.abName = ( BYTE * ) "";
pInfo.fReadonly = TRUE;
pArea->hTable = hCursor;
SELF_OPEN( ( AREAP ) pArea, &pInfo );
}
else
{
adsCloseCursor( pArea );
}
hb_retl( 1 );
}
else
{
AdsShowError( (UNSIGNED8 *) "ExecuteSQL error:" );
hb_retl( 0 );
}
}
else
{
hb_retl( 0 );
}
}
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Martin del Angel" <martindelangel@msn.com> escribió en el mensaje
news:[email=46523e4c@ozsrv2.ozlan.local...]46523e4c@ozsrv2.ozlan.local...[/email]
> Hola a Todos !
>
> Mirando en el codigo de AdsDataSource.prg
>
>
> AdsCreateSqlStatement( "ADSSQL", 2 )
> AdsExecuteSqlDirect( cCommand )
>
> He estado buscando en todos los archivos de ayuda de Advantage y no veo
> esas funciones, no si son de Xharbour o de Advantage ?
>
>
>
> Gracias....
>
>
> Saludos.
>
>
>
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
-
- Mensajes: 620
- Registrado: Jue Mar 23, 2006 2:39 am
Para los Gurus de Advantage
Martin:
Asi es, si quieres la refrencia completa de funciones descargate de
xHarbour.org las "contribuciones" y busca "RDDADS", ahi vienen todas las
fuciones del motor de 32 bits de ADS para xHarbour.
La documentacion la puedes ver en el manual de ADS, si ves el manual del
ARC, ahi viene la documentacion de las funciones.
Saludos
Rene Flores
http://www.ciber-tec.com
del Angel escribió:
> Hola a Todos !
>
> Mirando en el codigo de AdsDataSource.prg
>
>
> AdsCreateSqlStatement( "ADSSQL", 2 )
> AdsExecuteSqlDirect( cCommand )
>
> He estado buscando en todos los archivos de ayuda de Advantage y no veo esas
> funciones, no si son de Xharbour o de Advantage ?
>
>
>
> Gracias....
>
>
> Saludos.
>
>
>
>
Asi es, si quieres la refrencia completa de funciones descargate de
xHarbour.org las "contribuciones" y busca "RDDADS", ahi vienen todas las
fuciones del motor de 32 bits de ADS para xHarbour.
La documentacion la puedes ver en el manual de ADS, si ves el manual del
ARC, ahi viene la documentacion de las funciones.
Saludos
Rene Flores
http://www.ciber-tec.com
del Angel escribió:
> Hola a Todos !
>
> Mirando en el codigo de AdsDataSource.prg
>
>
> AdsCreateSqlStatement( "ADSSQL", 2 )
> AdsExecuteSqlDirect( cCommand )
>
> He estado buscando en todos los archivos de ayuda de Advantage y no veo esas
> funciones, no si son de Xharbour o de Advantage ?
>
>
>
> Gracias....
>
>
> Saludos.
>
>
>
>