Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Close all private datasession table/databases
Message
 
 
À
19/11/2001 21:19:23
Ls Wong
Vista Solution Sdn. Bhd.
Ampang, Malaisie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00583732
Message ID:
00583742
Vues:
16
>I'm using private datasession for my project, i need to know how to i close all private datasession table/databases with a command or with a simple coding
>thanks

Hi Ls,

This is not exactly, what you want, but you can borrow some ideas:
********************************************************************
*  Description.......: GetTableDS - returns owner DS ID for passed alias
*  Calling Samples...: ?GetTableDS('TranMstr')
*  Parameter List....: pcAlias
*  Created by........: Alex Wieder  #031264
*  Modified by.......: Nadya Nosonovsky 10/17/2000 04:34:25 PM
********************************************************************
lparameter pcAlias && Alias for which we want to find owner DS
** Parameter check
if empty(pcAlias) or vartype(pcAlias)<>'C'
     return 0
endif
pcAlias=upper(pcAlias)

local lnMaxDS, llValidSession, li, lnTableCount, lnRetDS, lcOldError, lcOldExact
lnRetDS=0
lnMaxDS = 20 && Max No. of sessions I want to go through
local array laAlias[1]
lcOldError=on('error')
lcOldExact=set('exact')
on error llValidSession = .f. && Supress Error mesages
set exact on && To perform full string comparision
for li = 1 to lnMaxDS
     llValidSession = .t.
     lnTableCount = aused(laAlias,li) && If DS doesn't exist, this line throw an 1540 error
     if llValidSession and lnTableCount>0
          if ascan(laAlias,pcAlias)>0 && This alias is found in this DS
               lnRetDS=li
               exit
          endif
     endif
next
on error &lcOldError
if lcOldExact='OFF'
     set exact off
endif
return lnRetDS
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform