09-07-22, 05:19 AM
كل عام و انت بخير
ماهي رسالة الخطأ؟
حملت المثال وحدثت اخطاء لا علاقة لها بالسؤال بل بمسالة الادوات.
الكلاس التالي يعمل معي بشكل جيد
وطريقة استخدامه الكود التالي:
ماهي رسالة الخطأ؟
حملت المثال وحدثت اخطاء لا علاقة لها بالسؤال بل بمسالة الادوات.
الكلاس التالي يعمل معي بشكل جيد
PHP كود :
Public Sub comp(ByVal sdb As String, ByVal sDBtmp As String, Optional ByVal pass As String = "")
On Error GoTo r:
If con.State = 1 Then con.Close
If rs.State = 1 Then rs.Close
Dim oApp As Access.Application
Set oApp = New Access.Application
If Trim$(pass) = "" Then
Call oApp.DBEngine.CompactDatabase(sdb, sDBtmp)
'wait for the app to finish
DoEvents
'remove the uncompressed original
Kill sdb
'rename the compressed file to the original to restore for other functions
Name sDBtmp As sdb
Else
Call oApp.DBEngine.CompactDatabase(sdb, sDBtmp, dbLangGeneral, , ";pwd=" & sPASSWORD)
'wait for the app to finish
DoEvents
'remove the uncompressed original
Kill sdb
'rename the compressed file to the original to restore for other functions
Name sDBtmp As sdb
End If
MsgBox "تم الضغط بنجاح", vbInformation, "ضغط ملف"
Exit Sub
r:
MsgBox Err.Description, vbCritical, "ضغط ملف"
Err.Clear
End Sub
PHP كود :
Dim co As New Class1
co.comp App.Path & "\phone.accdb", App.Path & "\NDB.accdb"
اللهم إني أعوذ بك من غلبة الدين وغلبة العدو، اللهم إني أعوذ بك من جهد البلاء ومن درك الشقاء ومن سوء القضاء ومن شماتة الأعداء
اللهم اغفر لي خطيئتي وجهلي، وإسرافي في أمري وما أنت أعلم به مني، اللهم اغفر لي ما قدمت وما أخرت، وما أسررت وما أعلنت وما أنت أعلم به مني، أنت المقدم وأنت المؤخر وأنت على كل شيء قدير

