Bosna i Hercegovina



#1 17.02.2013-18:47
pmiroslav Offline
Moderator
Registrovan/a od: 02.02.2009-10:32
Komentari: 1,339


Subject: Access radi u pozadini iako sam ga zatvorio
Radim trenutno na jednoj access aplikaciji i dešava mi se da nakon što zatvorim bazu, ne mogu je ponovno pokrenuti. Uočio sam da mi je u TaskBaru Access i dalje aktivan i tek kada tamo pokrenem End Task tek tada mogu ponovno pokrenuti svoju aplikaciju.
Dali netko ima sličnih iskustava?
Pozdrav
↑  ↓

#2 17.02.2013-18:55
zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,565


Subject: Re: Access radi u pozadini iako sam ga zatvorio
Hehe imama ima.
Desava se to.
Aplikaciju si negdje kodom podigao i nisi zatvorio najvjerovatnije.
Moras dobro prekontrolisati cijeli kod.
Nista konkretnije ti nemogu reci.
Pozdrav
↑  ↓

#3 17.02.2013-19:21
pmiroslav Offline
Moderator
Registrovan/a od: 02.02.2009-10:32
Komentari: 1,339


Subject: Re: Access radi u pozadini iako sam ga zatvorio
U alikaciji ima jako puno koda. Na početku imama formu za logiranje koju sam jednom od tebe pokupio.
Dali možda tu ima kakav problem ili da tražim dalje.
DownloadIzvorni kod (vb.net):
  1. Private Sub Form_Unload(Cancel As Integer)
  2. Dim db As Database
  3. Dim rs As Recordset
  4. Dim rs2 As Recordset
  5. Dim R
  6. Dim SQLDatum As String
  7. Dim SQL As String
  8. Dim SQLloc As String
  9. On Error GoTo Kraj
  10. Set db = CurrentDb
  11. SQLDatum = Format(Me.Tag)
  12. SQL = "SELECT * FROM A_Logiranje " _
  13.      & "WHERE VrijemeLog=" & SQLDatum
  14. SQLloc = "SELECT * FROM A_LogiranjeLoc " _
  15.      & "WHERE VrijemeLog=" & SQLDatum
  16. Set rs = db.OpenRecordset(SQL)
  17. If rs.RecordCount = 0 Then GoTo Kraj
  18. rs.Edit
  19. rs!VrijemeOdlg = Now()
  20. rs.Update
  21. Set rs2 = db.OpenRecordset(SQLloc)
  22. If rs2.RecordCount = 0 Then GoTo Kraj
  23. rs2.Edit
  24. rs2!VrijemeOdlg = Now()
  25. rs2.Update
  26. Kraj:
  27. Exit Sub
  28. End Sub

Pozdrav
↑  ↓

#4 17.02.2013-21:24
Gjoreski Offline
Super Moderator
Registrovan/a od: 02.02.2009-22:24
Komentari: 1,389


Ocjena: Ocjena:100 Subject: Re: Access radi u pozadini iako sam ga zatvorio
jas za takvi situacii imam edno exe praveno vo vb6 eve ti go prakam mozda ke ti zavrsi rabota
eve ti i eden kod za zatvorajne aktivni aplikacii
DownloadIzvorni kod (Visual Basic):
  1. '-------------------------------------------------------
  2. Type PROCESSENTRY32
  3.     dwSize As Long
  4.     cntUsage As Long
  5.     th32ProcessID As Long
  6.     th32DefaultHeapID As Long
  7.     th32ModuleID As Long
  8.     cntThreads As Long
  9.     th32ParentProcessID As Long
  10.     pcPriClassBase As Long
  11.     dwFlags As Long
  12.     szexeFile As String * 260
  13. End Type
  14. '-------------------------------------------------------
  15. Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccess As Long, _
  16. ByVal blnheritHandle As Long, ByVal dwAppProcessId As Long) As Long
  17.  
  18. Declare Function ProcessFirst Lib "kernel32.dll" Alias "Process32First" (ByVal hSnapshot As Long, _
  19. uProcess As PROCESSENTRY32) As Long
  20.  
  21. Declare Function ProcessNext Lib "kernel32.dll" Alias "Process32Next" (ByVal hSnapshot As Long, _
  22. uProcess As PROCESSENTRY32) As Long
  23.  
  24. Declare Function CreateToolhelpSnapshot Lib "kernel32.dll" Alias "CreateToolhelp32Snapshot" ( _
  25. ByVal lFlags As Long, lProcessID As Long) As Long
  26.  
  27. Declare Function TerminateProcess Lib "kernel32.dll" (ByVal ApphProcess As Long, _
  28. ByVal uExitCode As Long) As Long
  29.  
  30. Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As Long) As Long
  31.  
  32.  
  33. '-------------------------------------------------------
  34. Public Sub KillProcess(NameProcess As String)
  35. Const PROCESS_ALL_ACCESS = &H1F0FFF
  36. Const TH32CS_SNAPPROCESS As Long = 2&
  37. Dim uProcess  As PROCESSENTRY32
  38. Dim RProcessFound As Long
  39. Dim hSnapshot As Long
  40. Dim SzExename As String
  41. Dim ExitCode As Long
  42. Dim MyProcess As Long
  43. Dim AppKill As Boolean
  44. Dim AppCount As Integer
  45. Dim i As Integer
  46. Dim WinDirEnv As String
  47.        
  48.        If NameProcess <> "" Then
  49.           AppCount = 0
  50.  
  51.           uProcess.dwSize = Len(uProcess)
  52.           hSnapshot = CreateToolhelpSnapshot(TH32CS_SNAPPROCESS, 0&)
  53.           RProcessFound = ProcessFirst(hSnapshot, uProcess)
  54.  
  55.           Do
  56.             i = InStr(1, uProcess.szexeFile, Chr(0))
  57.             SzExename = LCase$(Left$(uProcess.szexeFile, i - 1))
  58.             WinDirEnv = Environ("Windir") + "\"
  59.             WinDirEnv = LCase$(WinDirEnv)
  60.        
  61.             If Right$(SzExename, Len(NameProcess)) = LCase$(NameProcess) Then
  62.                AppCount = AppCount + 1
  63.                MyProcess = OpenProcess(PROCESS_ALL_ACCESS, False, uProcess.th32ProcessID)
  64.                AppKill = TerminateProcess(MyProcess, ExitCode)
  65.                Call CloseHandle(MyProcess)
  66.             End If
  67.             RProcessFound = ProcessNext(hSnapshot, uProcess)
  68.           Loop While RProcessFound
  69.           Call CloseHandle(hSnapshot)
  70.        End If
  71.  
  72. End Sub
  73. '-------------------------------------------------------

se povikuva
KillProcess ("Bravo.exe")

Prilozi:
Informacije o fajlu: rar  ACCESS Close.rar
Preuzimanja: 63
Veličina: 3.58 KB

↑  ↓

Stranice (1): 1


All times are GMT +01:00. Current time: 19.02.2018-14:45.