Page 1 of 1

Tdsn

Posted: Tue Nov 08, 2005 8:32 pm
by Silvio
I have a class Tdsn
I saw the esamples but I must create a dsn of USER
the class say if you set 1 the type you can set dsnUser or 0 if you can set dsnSystem
I create the string :

Code: Select all

FUNCTION Main()
LOCAL oDsn
  LOCAL nTypeDsn

  oDsn := TDsn():New( "MwWind" )
//--------------------------------------------------------
  // Si nStatus da error, el DSN no existe
  //--------------------------------------------------------
  IF oDsn:nStatus <> TDSN_NO_ERROR
    IF MsgYesNo( OemToAnsi( "ยจ Desideri settare la configuazione per Mwwind ?" ) ,;
          "Mwwind" ) == .F.
      nTypeDsn := 1
    ENDIF
oDsn:Create( "MwWind", ;
                 "DSN creato per Mwwind", ;
                 "Microsoft Access Driver (*.mdb)", ;
                 "", ;
                 "", nTypeDsn,, )
  ENDIF

  MsgInfo( oDsn:cGenPrg(), "Demo TDSN")
  oDsn:Del()
oDsn:End()
RETURN NIL
the nTypeDsn := 1 it must set the dsnUser but it set dsnSystem

why it set the dsnSystem ?

Tdsn

Posted: Fri Nov 11, 2005 1:00 pm
by Lautaro
Here the information

#define TDSN_SYSTEM_DSN 0
#define TDSN_USER_DSN 1

This define are in the TDSN.CH

Atte,
Lautaro Moreira

Posted: Fri Nov 11, 2005 10:06 pm
by Silvio
Sorry but I make with nTypeDsn := 1