Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DSN for VFP & FPW
Message
De
14/05/1998 09:44:52
 
 
À
14/05/1998 09:42:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00099397
Message ID:
00099399
Vues:
22
>>What is the proper syntax for prgrammically
>>setting up a DSN for FoxPro tables.
>>
>>Access has :
>> driver={Microsoft Access Driver {*.mdb}"
>>
>>What is it for VFP and FPW?
>
>Gene,
>
>For VFP its:
>
>'Microsoft Visual FoxPro Driver'
>
>HTH

the full syntax is:

DECLARE INTEGER SQLConfigDataSource IN odbccp32.dll INTEGER, INTEGER, STRING, STRING

DO CASE
CASE LOWER( tcMode) = 'vfp'
lcType = 'Microsoft Visual FoxPro Driver'
lcODBC = 'DSN=' + tcDSN + CHR(0) + ;
'SourceDB=' + tcPath + tcDatabase + CHR(0) + ;
'SourceType=DBC' + CHR(0) + ;
'BackGroundFetch=No' + CHR(0) + ;
'Exclusive=No' + CHR(0) + ;
'SetNoCountOn=No' + CHR(0) + ;
'Description=' + tcDSN
.
.
.
ENDCASE

lnStatus = 0
IF !EMPTY( lcODBC)
*-- Delete the data source if it is there
*-- This is needed as SQL behaves differently to Fox for SQL drivers
SQLConfigDataSource( 0, 3, lcType, lcODBC)
*-- Now add it
lnStatus = SQLConfigDataSource( 0, 1, lcType, lcODBC)
IF lnStatus = 0
*-- Different error code?
lnStatus = _CreatError
ELSE
lnStatus = 0
ENDIF
ENDIF

RETURN lnStatus
regards

Ian
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform