Table log en access
Résolu/Fermé
lys65
-
6 déc. 2007 à 16:45
Sergio63 Messages postés 53 Date d'inscription lundi 12 décembre 2005 Statut Membre Dernière intervention 9 juin 2011 - 19 déc. 2007 à 16:36
Sergio63 Messages postés 53 Date d'inscription lundi 12 décembre 2005 Statut Membre Dernière intervention 9 juin 2011 - 19 déc. 2007 à 16:36
A voir également:
- Table log en access
- Table ascii - Guide
- Table des matières word - Guide
- Access appdata - Guide
- Access runtime ✓ - Forum Access
- Quick access service - Forum Logiciels
1 réponse
Sergio63
Messages postés
53
Date d'inscription
lundi 12 décembre 2005
Statut
Membre
Dernière intervention
9 juin 2011
24
19 déc. 2007 à 16:36
19 déc. 2007 à 16:36
Bonjour,
Pour récupérer le user de Windows il faut utiliser l'API.
Personnellement j'utilise ce code sur Excel avec Win XP pro, mais ça devrait aussi marcher sur Access :
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Dim V_LongUtil As Long
Function NomUtil() As String
'Récupération du nom de l'utilisateur
' pour rechercher le dossier correspondant à son bureau
Dim V_Util As Long
Dim V_NomUtil As String
V_LongUtil = 16
V_NomUtil = String(16, " ")
V_Util = apiGetUserName(V_NomUtil, V_LongUtil)
If V_Util <> 0 Then
NomUtil = Left(V_NomUtil, V_LongUtil - 1)
Else
NomUtil = ""
End If
End Function
Cordialement
Sergio
Pour récupérer le user de Windows il faut utiliser l'API.
Personnellement j'utilise ce code sur Excel avec Win XP pro, mais ça devrait aussi marcher sur Access :
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Dim V_LongUtil As Long
Function NomUtil() As String
'Récupération du nom de l'utilisateur
' pour rechercher le dossier correspondant à son bureau
Dim V_Util As Long
Dim V_NomUtil As String
V_LongUtil = 16
V_NomUtil = String(16, " ")
V_Util = apiGetUserName(V_NomUtil, V_LongUtil)
If V_Util <> 0 Then
NomUtil = Left(V_NomUtil, V_LongUtil - 1)
Else
NomUtil = ""
End If
End Function
Cordialement
Sergio