Page 1 of 2

Xbase++ Workarea and ADO dataset

Posted: Tue Nov 12, 2013 7:05 am
by unixkd
Hi all

I have a control that accepts and ADO dataset as a parameter. Can anybody tell me how to convert an Xbase++ workarea to an ADO dataset in 1.9SL1 ?

Joe.

Re: Xbase++ Workarea and ADO dataset

Posted: Tue Nov 12, 2013 10:34 am
by patito
Hi
Post a simple example and one using activex browse, hopes this is what you need
If you want to use dc browse, you must modify

Best regards
Hector

Re: Xbase++ Workarea and ADO dataset

Posted: Tue Nov 12, 2013 11:42 am
by unixkd
NOT what I am looking for.

I use ADSDBE with Advantage Database Server. Now I have an activex control that accepts ADO recordset as parameters. I open my tables via ADSDBE and
I just wonder if there is a way to translate a workarea to ADO recordset ?

Joe.

Re: Xbase++ Workarea and ADO dataset

Posted: Tue Nov 12, 2013 12:55 pm
by patito
Hi

you can use ado with advantage odbc driver
(free distribution )

greetings
Hector

Re: Xbase++ Workarea and ADO dataset

Posted: Wed Nov 13, 2013 7:36 am
by rdonnay
Here's a program that uses the ADO ActiveX control that's built into Microsoft Windows.

This program reads a database named BookSale.Mdb.

I'm working on a sample that will create an ADORecordSet from a Dbf.

Code: Select all

#INCLUDE "dcdialog.CH"

#DEFINE adCmdText  1

#Pragma Library("ascom10.lib")

FUNCTION Main

LOCAL oADOConnection, oADORecordset, oADOFields, oADOField, value

// Creating the wrapping class instance for the ADO connection.
oADOConnection := ActiveXObject():create('ADODB.Connection')

// Opening the ADO connection, targeting an Access database.
oADOConnection:ConnectionString := ;
   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+DC_CurPath()+"\BookSale.mdb"

oADOConnection:Open()

// Creating a new ADO Recordset
oADORecordset := ActiveXObject():create('ADODB.Recordset')

// Filling the ADO RecordSet with the result of an SQL request executed through the newly opened ADO connection
oADORecordset:Open("SELECT * FROM Publishers ORDER BY Name",oADOConnection,,,adCmdText)

oADORecordset:MoveFirst()
DO WHILE .NOT. oADORecordset:EOF
  // Obtaining the 'Name' field value of the current record
  value := oADORecordset:Fields("Name"):Value
  // Dumping the field value to the screen
  ? "oADORecordset:Fields('Name'):Value=" + value
  // Move to the next record
  oADORecordset:MoveNext()
ENDDO

// Required: release the ADO RecordSet ActiveX
oADORecordset:Destroy()

// Required: close and release the ADO Connection ActiveX
oADOConnection:Close()
oADOConnection:Destroy()

wait

return nil

Re: Xbase++ Workarea and ADO dataset

Posted: Wed Nov 13, 2013 11:52 am
by Auge_Ohr
unixkd wrote:Can anybody tell me how to convert an Xbase++ workarea to an ADO dataset in 1.9SL1 ?
ALIAS belong to DBE and we do not have Information about DBE API.
as Roger say you can build a Record Set ( Dataset() ) from Result Set.

for pgDBE we got this Information :
Re: New build 470: furthermore errors with PGDBE
preview.xbase++.20
24. Oktober 2013
Till Warweg

Universal SQL exists in two flavors (local and
remote) and the behaviour differs in terms
of which form a result set can be retrieved in.

As a general rule:
1. Remote SQL: result sets can currently only be
retrieved as a work area
2. Local SQL: results can currently only be retrieved
as an array, an array of objects, or as a single value

Re: Xbase++ Workarea and ADO dataset

Posted: Sun Nov 17, 2013 12:44 pm
by patito
Hi
Attach bitmap with Ado and FlexGrid activex
sources above, this FlexGrid prg and prueba.xpj

These sources are free to use
Best Regard

Re: Xbase++ Workarea and ADO dataset

Posted: Mon Nov 18, 2013 6:17 am
by skiman
Hi Hector,

Can you post your screenshot and sources for the Flexgrid?

Re: Xbase++ Workarea and ADO dataset

Posted: Mon Nov 18, 2013 10:26 am
by patito
Hi
attach flexgrid.jpg and sources
1.- flexgrid.prg -> prueba .xpj
2.- other


Best Regard
Hector

Re: Xbase++ Workarea and ADO dataset

Posted: Tue Dec 03, 2013 7:20 am
by unixkd
Thanks Roger,

Do let me know when you are thru with dbf sample for ADO recordset. That is exactly what I want.

Joe