Imo must be extended rdd structure
Follow my link
http://www.masfoxpro.com/index.php?title=XBase&printable=yes
PROCEDURE Main
LOCAL cConnect := "DBE=ODBCDBE;DSN=OrderProcessing"
LOCAL oSession := DacSession():new( cConnect )
IF .NOT. oSession:isConnected()
? "Unable to connect to server !"
? oSession:getLastMessage()
QUIT
ENDIF
< Business Logic As Usual >
DbCloseAll()
oSession:disconnect()
RETURN
Procedure main
XDBQ:=CURDRIVE()+":\"+CURDIR()+"\"+STRTRAN(G_CAMINO,"\","")
cCon := "DBE=ODBCDBE;DRIVER={Microsoft dBase Driver
(*.dbf)};DBQ="+XDBQ+";DATABASE="+XDBQ
oSessionDBF:=DacSession():new(cCon)
oSessionDBF:setProperty(ODBCSSN_INDEX_AUTOOPEN, .T.)
IF !oSessionDBF:isconnected()
MSGBOX( "Unable to connect..." )
QUIT
ENDIF
DbeSetDefault( "ODBCDBE" )
SQL("CREATE INDEX TIPOS ON TIPOS(TIPO_COMP)")
USE TIPOS NEW
MSGBOX(INDEXKEY()) // Result= TIPO_COMP
* DBGOBOTTOM() //If this line is not commented, it works OK!
IF DBSEEK("EG")
MSGBOX("Found!")
ELSE
MSGBOX("Not found")
ENDIF
RETURN
Function tr_open()
LOCAL oSession
DbeSetDefault("ADSDBE")
cConnStr :=
"SERVER=\\testweb.dnsalias.com:3232\test\data\test.ADD;ADS_REMOTE_SERVER;ADS_COMPRESS_INTERNET;UID=test;PWD=test"
oSession := DacSession():New("DBE=ADSDBE;"+cConnStr)
DbeInfo( COMPONENT_DATA , ADSDBE_TBL_MODE, ADSDBE_CDX )
DbeInfo( COMPONENT_ORDER, ADSDBE_TBL_MODE, ADSDBE_CDX )
If (oSession:isConnected())
If !DbUseArea(.T.,oSession, "adress","wadress",.t.,.t.)
MsgBox("Status:"+Alias()+" kann nicht geöffnet werden")
EndIf
Set Index to Adress
trconnect:=.t.
Else
trconnect:=.f.
MsgBox("Status:"+Alias()+" kann nicht geöffnet werden")
EndIf
2010/3/15 Mindaugas Kavaliauskas <[email protected]>:
> Hi,
>
>
> Shum wrote:
>>
>> It possible to implement the database connection number as a class ...
>> like the DacSession class in Xbase++ ...??
>
> I know nothing about DacSession, but I guess it could be implemented on the
> top of current code.
>
>
> Regards,
> Mindaugas
--
Massimo Belgrano
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour