[MS Access]

dario21

Nuovo Utente
19 Feb 2019
9
0
1
roma
buongiorno,
premetto che da poco mi sto interfacciando con vba access e girando in rete h trovato un modulo che poteva interessarmi.
nel trascrivere il modulo di access 2003 nel mio database access 2016 mi restituisce numerosi eerori che non so correggere :(
se gentilmente qualcuno mi può aiutare ne sarei veramente grato
di seguito il codice di cui parlavo

Codice:
Option Compare Database
Option Explicit



Private Declare Function GetAllSettings Lib "kernel32" Alias "GetVersionExA" (lpOSInfo As OSVERSIONINFO) As Boolean
Private Declare Function api_GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function api_GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
'Declares for Version Verification
Private Declare Function ac_GetFileVersionInfoSize Lib "Version.dll" Alias "GetFileVersionInfoSizeA" (ByVal lptstrFilename As String, lpdwHandle As Long) As Long
Private Declare Function ac_GetFileVersionInfo Lib "Version.dll" Alias "GetFileVersionInfoA" (ByVal lptstrFilename As String, ByVal dwHandle As Long, ByVal dwLen As Long, lpData As Any) As Long
Private Declare Function ac_VerQueryValue Lib "Version.dll" Alias "VerQueryValueA" (pBlock As Any, ByVal lpSubBlock As String, lplpBuffer As Any, puLen As Long) As Long
Private Declare Sub ac_MoveMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As Any, ByVal Source As Long, ByVal length As Long)

Const Jet_FILENAME = "MSJT3032.DLL"
Const Jet35_FILE = "msjet35.dll"
Const SEM_FAILCRITICALERRORS = &H1
    
' Type returned by VER.DLL GetFileVersionInfo
Private Type VS_FIXEDFILEINFO
    dwSignature As Long
    dwStrucVersionl As Integer     '  e.g. = &h0000 = 0
    dwStrucVersionh As Integer     '  e.g. = &h0042 = .42
    dwFileVersionMSl As Integer    '  e.g. = &h0003 = 3
    dwFileVersionMSh As Integer    '  e.g. = &h0075 = .75
    dwFileVersionLSl As Integer    '  e.g. = &h0000 = 0
    dwFileVersionLSh As Integer    '  e.g. = &h0031 = .31
    dwProductVersionMSl As Integer '  e.g. = &h0003 = 3
    dwProductVersionMSh As Integer '  e.g. = &h0010 = .1
    dwProductVersionLSl As Integer '  e.g. = &h0000 = 0
    dwProductVersionLSh As Integer '  e.g. = &h0031 = .31
    dwFileFlagsMask As Long        '  = &h3F for version "0.42"
    dwFileFlags As Long            '  e.g. VFF_DEBUG Or VFF_PRERELEASE
    dwFileOS As Long               '  e.g. VOS_DOS_WINDOWS16
    dwFileType As Long             '  e.g. VFT_DRIVER
    dwFileSubtype As Long          '  e.g. VFT2_DRV_KEYBOARD
    dwFileDateMS As Long           '  e.g. 0
    dwFileDateLS As Long           '  e.g. 0
 End Type
Type fBuffer
    Item As String * 1024
End Type


Private Type OSVERSIONINFO
   dwOSVersionInfoSize As Long
   dwMajorVersion As Long
   dwMinorVersion As Long
   dwBuildNumber As Long
   dwPlatformId As Long
   strReserved As String * 128
End Type

Function atGetjetver() As String
'*******************************************
'Purpose:  Returns Version information on Jet DB Engine
'          Based on the Version of Access Used
'*******************************************
Dim Buffer As fBuffer
Dim VInfo As VS_FIXEDFILEINFO
Dim stBuf() As Byte
Dim lSize As Long
Dim stUnused As Long
Dim ErrCode As Long
Dim VerNum As Variant
Dim lVerPointer       As Long
Dim lVerbufferLen     As Long
Dim Jet$

If SysCmd(acSysCmdAccessVer) < "8" Then
    Jet = Jet_FILENAME
Else
    Jet = Jet35_FILE
End If
    
lSize = ac_GetFileVersionInfoSize(Jet, stUnused)
ReDim stBuf(lSize)
ErrCode = ac_GetFileVersionInfo(Jet, 0&, lSize, stBuf(0))
    
ErrCode = ac_VerQueryValue(stBuf(0), "\", lVerPointer, lVerbufferLen)
    
If ErrCode <> 0 Then
    ac_MoveMemory VInfo, lVerPointer, Len(VInfo)
    
    VerNum = Format$(VInfo.dwFileVersionMSh) & "." & _
    Format$(VInfo.dwFileVersionMSl) & "." & _
    Format$(VInfo.dwFileVersionLSh) & "." & _
    Format$(VInfo.dwFileVersionLSl)
End If
atGetjetver = VerNum
End Function
Function atWinver(intOSInfo%) As Variant
'***********************************************
'Purpose:  Retrieve operating system information
'Accepts: intOSInfo: which piece of information to retrieve
   '        0: Major Version
   '        1: Minor version
   '        2: Platform ID
' Returns: OS supplied Information
'***********************************************
Dim OSInfo As OSVERSIONINFO
Dim dwReturn&
Const PLAT_WINDOWS = 1
Const PLAT_WIN_NT = 2
'Set the size= to length of structure
OSInfo.dwOSVersionInfoSize = Len(OSInfo)

If GetVersionEx(OSInfo) Then
   Select Case intOSInfo
      Case 0
         atWinver = OSInfo.dwMajorVersion
      Case 1
         atWinver = OSInfo.dwMinorVersion
      Case 2
         dwReturn = OSInfo.dwPlatformId
         If dwReturn = PLAT_WINDOWS Then
             atWinver = "Windows"
         Else
             atWinver = "Windows NT"
         End If
     Case 3
         If OSInfo.dwPlatformId = PLAT_WINDOWS Then
             atWinver = OSInfo.dwBuildNumber And &HFFF
         Else
             atWinver = OSInfo.dwBuildNumber
         End If
   End Select
Else
   atWinver = 0
End If

End Function
Public Function atCNames(UOrC As Integer) As String
'**************************************************
'Purpose:  Returns the User LogOn Name or ComputerName
'Accepts:  UorC; 1=User, anything else = computer
'Returns:  The Windows Networking name of the user or computer
'**************************************************
On Error Resume Next
Dim NBuffer As String
Dim Buffsize As Long
Dim Wok As Long
    
Buffsize = 256
NBuffer = Space$(Buffsize)

If UOrC = 1 Then
    Wok = api_GetUserName(NBuffer, Buffsize)
    atCNames = Left$(NBuffer, InStr(NBuffer, Chr(0)) - 1)
Else
    Wok = api_GetComputerName(NBuffer, Buffsize)
    atCNames = Left$(NBuffer, InStr(NBuffer, Chr(0)) - 1)
End If

End Function


Sub connessi()

End Sub
 

Max 1

Super Moderatore
Membro dello Staff
SUPER MOD
MOD
29 Feb 2012
4.449
338
83
@dario21
Dal regolamento del forum
2.7 E' vietato aprire discussioni con titoli generici del tipo "Aiuto", "Help" o "Rispondete subito". Alle discussione deve essere assegnato un titolo che ne renda immediatamente comprensibile il contenuto utilizzando, ove possibile, la giusta terminologia tecnica. Così facendo si rende più facile agli altri utenti il compito di trovare immediatamente le discussioni a cui parteciapre.
Modifica il titolo della discussione altrimenti sono costretto a chiuderla!
Grazie
 

CarlettoFed

Utente Attivo
17 Lug 2017
101
1
18
70
Intanto dovresti dire a cosa ti serve tutto quel codice in modo da poter valutare altre soluzioni più semplici.
 
Discussioni simili
Autore Titolo Forum Risposte Data
F access ricerca record con apostrofo. MS Access 0
P Access: recuperare Indice dopo un insert into MS Access 0
N Access: Filtro su maschera MS Access 0
B Non riesco a trovare i cognomi con i caratteri speciali in Access (Microsoft 365) MS Access 0
N Errore interno Access MS Access 2
C ACCESS Aprire maschera se valore non presente in una combo MS Access 7
L Access Periodo maschera continua MS Access 4
B Aumento dimensioni grafico Access Database 0
R [C#] Quali dipendenze occorrono su progetto "Setup" con Access Database? .NET Framework 1
G Appicazione HTML per inserimento dai in Database Access Microsoft HTML e CSS 0
K mc Access/phpmyamin MS Access 0
L Collegare un form html ad un database access Javascript 2
R salve a tutti sono un insegnante di pianoforte e a tempo perso mi sto dedicando ad access Presentati al Forum 1
G Access point con rete guest, consigli? Reti LAN e Wireless 0
P Access Inserimento data. MS Access 4
ges Microsoft ACCESS oltre ogni limite (tre manuali) Altri Annunci 2
@ [MS Access] Funzione Iif..is null... Database 0
P [MS Access] Sostituire un carattere in tutta la tabella MS Access 11
B tasti rapidi Access MS Access 1
M [MS Access] Pulsante su maschera che esegue azioni su altra maschera MS Access 3
C [MS Access] Pagina di dialogo con allegati MS Access 1
F Modificare report di etichette di access con vba MS Access 0
strambotto [MS Access] Smembramento tabella MS Access 5
D [MS Access] Piu' maschere con una sola tabella dati... MS Access 0
G [MS Access] Funzione ARROTONDA non definita nell'espressione MS Access 1
Spenalzo Creare tabelle multiple con Access via VBA MS Access 2
M [MS Access] Relazione tra maschere MS Access 1
G Access Point POE da esterno Reti LAN e Wireless 0
M [MS Access] controllo valido se MS Access 8
N [MS Access] Come relazionare DB Libri trasposti in Film e viceversa MS Access 1
S [ASP] SALVARE VALORE SELECT OPTION SU CAMPO TABELLA ACCESS Classic ASP 9
S [MS Access] Apertura Maschera su nuov record in base a determinato ID MS Access 0
maria_ia Microsoft Access Windows e Software 0
S [MS Access] Apertura maschera MS Access 3
S [MS Access] trasformare un numero in lettere in un report MS Access 1
D [Visual Basic] [MS Access] query con parametro di testo Visual Basic 4
T mysql tutorial per importare tabelle access in mysql aiuto MySQL 2
P [MS ACCESS] Estrarre più somme da una query MS Access 4
D [MS Access] problemi con inserimento campo in una maschera MS Access 6
F [MS Access] Creare [stringa] da caselle combinate MS Access 0
D [MS Access] aiuto non riesco a capire MS Access 6
Arcadia [MS Access] Focus su campo specifico MS Access 1
akira [MS Access] Apertura recordset MS Access 1
V access 2007, maschera con caselle di selezione Programmazione 4
W [MS Access] Barre di scorrimento su maschere MS Access 0
A [MS Access] Pulsante per inserire allegati in campo maschera MS Access 0
J [MS Access] Filtro su combo in sottomaschera MS Access 11
Arcadia [MS Access] Implementazione progetto con nuove funzioni. MS Access 0
A [MS Access] Aprire maschera con sottomaschera su ultimo record MS Access 0
A [MS Access] Maschera per interagire con tabella excell MS Access 19

Discussioni simili