browse in xbase - for SQL - how can it be easiest done

SQL Express von Boris Borzic

Moderator: Moderatoren

Antworten
Benutzeravatar
engindenizoglu
Cut&Paste-Entwickler
Cut&Paste-Entwickler
Beiträge: 39
Registriert: Mi, 08. Nov 2017 20:58
Wohnort: ISTANBUL
Kontaktdaten:

browse in xbase - for SQL - how can it be easiest done

Beitrag von engindenizoglu » Do, 14. Mär 2019 23:21

Below i have showed a sample code for browsing a dbf file and selecting the right record.

Is there a sample prg which can browse from a SQL DATABANK (the name of the sql databank can be IPADRES ; field names ; NR, TANIM ;
(a similar sample like below) ?

Or a similar method of browsing and selecting a record from a SQL DATABANK (in xbase 2.0).


---------------------------- browse program ; the dbf file has 2 fields NR and TANIM ---------------------

******* DBF FILE *****************
SELECT 8
USE IP-ADRES SHARED
IF NETERR()=.T.
CLOSE ALL
RETURN
ENDIF
***********************************
GO TOP

APPBROWSE INTO oBrowse ;
for SUBSTR(CINS,1,1)="P";
TITLE "select the record" ;
FONT "14.MS Sans Serif";
POSITION CENTER, CENTER ;
SIZE 55,40 PERCENT;

APPFIELD ALLTRIM(NR) INTO oBROWSE CAPTION "NO";
ALIGN CENTER FONT "14.MS Sans Serif" COLOR GRA_CLR_WHITE,GRA_CLR_DARKGREEN READONLY

APPFIELD ALLTRIM(TANIM) INTO oBROWSE CAPTION "ANA TANIM";
ALIGN CENTER FONT "14.MS Sans Serif" COLOR GRA_CLR_WHITE,GRA_CLR_DARKGREEN READONLY

APPDISPLAY oBrowse MODELESS // Display Application Parts


KEYBOARD CHR(13)

DO WHILE nEvent <> xbeP_Close // Process events
nEvent := AppEvent( @mp1, @mp2, @obj )
obj:handleEvent( nEvent, mp1, mp2 )

IF NEVENT=1048609 /* MOUSE SOL TIKLA */
EXIT
ENDIF

IF NEVENT=1048977 /* ENTER to exit */
EXIT
ENDIF

IF NEVENT=1048628 .or. NEVENT=1048632 /* ESCAPE or mouse click to exit */
obrowse:DESTROY()
CLOSE ALL
RETURN
ENDIF


ENDDO


obrowse:DESTROY()

-----------------------------------------------------------------------------------------------------------------------------------------------------


İyi çalışmalar\Regards
Engin René D.
ENGIN RENE D.

LARA ltd
hhtp:\\www.core-winder.com
http:\\www.laraelectromechanical.com

georg
Foren-Administrator
Foren-Administrator
Beiträge: 2349
Registriert: Fr, 08. Feb 2008 21:29

Re: browse in xbase - for SQL - how can it be easiest done

Beitrag von georg » Fr, 15. Mär 2019 7:52

Good morning -


you should start by making yourself familiar with the "normal" XbpBrowse() class. The APPBROWSE command is quite old (I would like to say "outdated") and assumes that you work with a "normal" Clipper-style workarea.

For a starter, you can copy the first example from the Xbase++ documentation and run it using the debugger.

Going back to your question:

Instead of accessing a fields' data with workarea->fieldname you need to use oData:fieldget("fieldname"), where oData is the DataSet() that you created using SQLExpress. You also need to change/rewrite the DbSkipper() function to work on your dataset.

I'll try to find an example in my programs and post it here.
Liebe Grüsse aus der Eifel,

Georg S. Lorrig
Vorsitzender des Deutschsprachige Xbase-Entwickler e. V.
Redakteur der Wiki des Deutschprachigen Xbase-Entwickler e.V.

Benutzeravatar
AUGE_OHR
Marvin
Marvin
Beiträge: 11827
Registriert: Do, 16. Mär 2006 7:55
Wohnort: Hamburg

Re: browse in xbase - for SQL - how can it be easiest done

Beitrag von AUGE_OHR » Fr, 15. Mär 2019 8:38

as i remember Engin want to use M$SQL Server but that is not include in Xbase++ v2.x
Xbase++ have PgDBE for PostgreSQL only

SQLExpress using ODBC can access M$SQL but there is no ISAM Emulator like in PgDBE
download SQLExpress from https://www.xb2.net/sqlxpp/index.htm

have a look at those Sample if you understand it.
gruss by OHR
Jimmy

Benutzeravatar
engindenizoglu
Cut&Paste-Entwickler
Cut&Paste-Entwickler
Beiträge: 39
Registriert: Mi, 08. Nov 2017 20:58
Wohnort: ISTANBUL
Kontaktdaten:

Re: browse in xbase - for SQL - how can it be easiest done

Beitrag von engindenizoglu » Fr, 15. Mär 2019 22:08

I do use SQL EXPRESS and XBASE 2.0.
ENGIN RENE D.

LARA ltd
hhtp:\\www.core-winder.com
http:\\www.laraelectromechanical.com

Benutzeravatar
AUGE_OHR
Marvin
Marvin
Beiträge: 11827
Registriert: Do, 16. Mär 2006 7:55
Wohnort: Hamburg

Re: browse in xbase - for SQL - how can it be easiest done

Beitrag von AUGE_OHR » Sa, 16. Mär 2019 9:01

i guess SQLExpress have a lot of Sample.

Boris have also a Forum at www.xbwin.com -> forum -> SQLexpress so i recommend to ask there.
gruss by OHR
Jimmy

Benutzeravatar
engindenizoglu
Cut&Paste-Entwickler
Cut&Paste-Entwickler
Beiträge: 39
Registriert: Mi, 08. Nov 2017 20:58
Wohnort: ISTANBUL
Kontaktdaten:

Re: browse in xbase - for SQL - how can it be easiest done

Beitrag von engindenizoglu » So, 17. Mär 2019 8:46

I asked Boris about it he said its not related about sql rather about xbase alaska programming language.

Does anyone have a samples in xbase about browsing and selecting a record ?
ENGIN RENE D.

LARA ltd
hhtp:\\www.core-winder.com
http:\\www.laraelectromechanical.com

Benutzeravatar
Tom
Der Entwickler von "Deep Thought"
Der Entwickler von "Deep Thought"
Beiträge: 7591
Registriert: Do, 22. Sep 2005 23:11
Wohnort: Berlin
Kontaktdaten:

Re: browse in xbase - for SQL - how can it be easiest done

Beitrag von Tom » So, 17. Mär 2019 10:00

You may take a look at Roger Donnay's eXpress++ - there is a free trial, and the framework - including source - doesn't cost much. It has several samples for SQL-browsing in almost all situations. www.donnay-software.com
Herzlich,
Tom

Antworten