الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

من فضلكم اريد الافاده فى هذه الاكواد

بدأه AHMED 7ASSAN في 21 نوفمبر 2013 · 4 رد · 517 مشاهدة · في قواعد بيانات Microsoft Access
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع
Public Function StartSys()

On Error GoTo Change_Err

Dim FS, d, MasterSerial, ISCounter, IsDated, ToDate, WinDir, f

Dim prp As Variant

    

    Set FS = CreateObject("Scripting.FileSystemObject")

    Set WinDir = FS.GetSpecialFolder(0)

 

If Dir(WinDir & "\winsys.pwl") = "" Then

   MsgBox "ÎØÃ Ýì ÊÚÑíÝ ÇáÈÑäÇãÌ ÈÇáÌåÇÒ", vbCritical, "Invalid Date"

   DoCmd.Quit acQuitSaveAll

End If

'-------------------------------------------------------------------

'Security Configration

IsDated = False

ToDate = #2/15/2006#

'-------------------------

ISCounter = False

'--------------------------------------------------------------

'Date Security

    If IsDated = True Then

        If Date > ToDate Then

           MsgBox "ÎØÃ Ýì ÊÚÑíÝ ÇáÈÑäÇãÌ ÈÇáÌåÇÒ", vbCritical, "Invalid Date"

           DoCmd.Quit acQuitSaveAll

           Exit Function

        End If

    End If

 

 

'If Admin Log On

'If Dir("C:\GoldenSys.mdw") <> "" Then

'   CurrentDb.Properties("AllowBypassKey") = True

'End If

'If User Log On

'If Dir("C:\GoldenSys.mdw") = "" Then

'    CurrentDb.Properties("AllowBypassKey") = False

'    ChangeProperty = True

'End If

'DoCmd.OpenForm "User_Log"

'Ok

Set f = FS.OpenTextFile(Application.CurrentProject.Path & "\Config.txt", 1)

X = f.readline

CurrConfig = Mid(X, (3 * Mid(X, 2, 1)) + 2, 1) & ":\Golden\Data\Data" & Mid(X, 2, 1) & ".mdb"

CurrPath = Right(CurrentDb.TableDefs("Sales").Connect, Len(CurrentDb.TableDefs("Users").Connect) - 10)

Forms![user_log]![AboutCopy] = X

f.Close

Forms![user_log]![branch] = Mid([Forms]![user_log]![AboutCopy], 2, 1)

 

If CurrConfig <> CurrPath Then

    DefBranchPath = Mid(Forms![user_log]![AboutCopy], 5, 1) & ":\Golden\Data\Data1.mdb"

    'Defination

    LinkTab "CahierTrans", DefBranchPath, "CahierTrans"

    LinkTab "Const", DefBranchPath, "Const"

    LinkTab "Damage", DefBranchPath, "Damage"

    LinkTab "DefVal", DefBranchPath, "DefVal"

    LinkTab "Emp", DefBranchPath, "Emp"

    LinkTab "EmpBranch", DefBranchPath, "EmpBranch"

    LinkTab "L_Cahier", DefBranchPath, "L_Cahier"

    LinkTab "L_CahierBranch", DefBranchPath, "L_CahierBranch"

    LinkTab "L_Color", DefBranchPath, "L_Color"

    LinkTab "L_Cust", DefBranchPath, "L_Cust"

    LinkTab "L_CustBranch", DefBranchPath, "L_CustBranch"

    LinkTab "L_CustGroup", DefBranchPath, "L_CustGroup"

    LinkTab "L_Group", DefBranchPath, "L_Group"

    LinkTab "L_GroupGroup", DefBranchPath, "L_GroupGroup"

    LinkTab "L_MGroupGroup", DefBranchPath, "L_MGroupGroup"

    LinkTab "L_Other", DefBranchPath, "L_Other"

    LinkTab "L_Prod", DefBranchPath, "L_Prod"

    LinkTab "L_ProdDetail", DefBranchPath, "L_ProdDetail"

    LinkTab "L_ProdDetailStartStock", DefBranchPath, "L_ProdDetailStartStock"

    LinkTab "L_Sesson", DefBranchPath, "L_Sesson"

    LinkTab "L_Size", DefBranchPath, "L_Size"

    LinkTab "L_Spent", DefBranchPath, "L_Spent"

    LinkTab "L_Income", DefBranchPath, "L_Income"

    LinkTab "L_Store", DefBranchPath, "L_Store"

    LinkTab "L_Supp", DefBranchPath, "L_Supp"

    LinkTab "L_SuppGroup", DefBranchPath, "L_SuppGroup"

    LinkTab "OccDays", DefBranchPath, "OccDays"

    LinkTab "Option", DefBranchPath, "Option"

    LinkTab "PaperMoney", DefBranchPath, "PaperMoney"

    LinkTab "PaperMoneyDetail", DefBranchPath, "PaperMoneyDetail"

    LinkTab "Purch", DefBranchPath, "Purch"

    LinkTab "PurchDetail", DefBranchPath, "PurchDetail"

    LinkTab "StartBal", DefBranchPath, "StartBal"

    LinkTab "Taswia", DefBranchPath, "Taswia"

    LinkTab "Tmp_MasterAcc", DefBranchPath, "Tmp_MasterAcc"

    LinkTab "Transfer", DefBranchPath, "Transfer"

    LinkTab "TransferDetail", DefBranchPath, "TransferDetail"

    LinkTab "UserMessage", DefBranchPath, "UserMessage"

    LinkTab "Users", DefBranchPath, "Users"

    LinkTab "Users_Branch", DefBranchPath, "Users_Branch"

    LinkTab "User_Perm", DefBranchPath, "User_Perm"

    LinkTab "User_Rep", DefBranchPath, "User_Rep"

    LinkTab "Rep_Para", DefBranchPath, "Rep_Para"

    

    LinkTab "FileClosed", Left(DefBranchPath, 15) & "DataClosed.mdb", "FileClosed"

    LinkTab "FileClosedDamage", Left(DefBranchPath, 15) & "DataClosed.mdb", "FileClosedDamage"

    LinkTab "FileClosedPurch", Left(DefBranchPath, 15) & "DataClosed.mdb", "FileClosedPurch"

    LinkTab "FileClosedSales", Left(DefBranchPath, 15) & "DataClosed.mdb", "FileClosedSales"

    LinkTab "FileClosedStart", Left(DefBranchPath, 15) & "DataClosed.mdb", "FileClosedStart"

    LinkTab "FileClosedTransfer", Left(DefBranchPath, 15) & "DataClosed.mdb", "FileClosedTransfer"

    

    BranchSwitchData Mid(X, 2, 1), "BranchGo"

End If

'-------------------------------------------------------------------

'Counter Security

    If ISCounter = True Then

        DoCmd.OpenForm "Const_H", , , "[ConstCode]=20", , acHidden

        If Left([Forms]![Const_H]![ConstValue], 3) >= Right([Forms]![Const_H]![ConstValue], 3) Then

           MsgBox "ÎØÃ Ýì ÊÚÑíÝ ÇáÈÑäÇãÌ ÈÇáÌåÇÒ", vbCritical, "Invalid Number"

           DoCmd.Quit acQuitSaveAll

           Exit Function

        End If

        If Len(Int(Left([Forms]![Const_H]![ConstValue], 3) + 1)) = 3 Then

            [Forms]![Const_H]![ConstValue] = Int(Left([Forms]![Const_H]![ConstValue], 3)) + 1 & Right([Forms]![Const_H]![ConstValue], 4)

        End If

        If Len(Int(Left([Forms]![Const_H]![ConstValue], 3) + 1)) = 2 Then

            [Forms]![Const_H]![ConstValue] = "0" & Int(Left([Forms]![Const_H]![ConstValue], 3)) + 1 & Right([Forms]![Const_H]![ConstValue], 4)

        End If

        If Len(Int(Left([Forms]![Const_H]![ConstValue], 3) + 1)) = 1 Then

            [Forms]![Const_H]![ConstValue] = "00" & Int(Left([Forms]![Const_H]![ConstValue], 3)) + 1 & Right([Forms]![Const_H]![ConstValue], 4)

        End If

        DoCmd.Close acForm, "Const_H"

    End If

 

Change_Bye:

    Exit Function

 

Change_Err:

    If Err = 3270 Then    ' Property not found.

        Set prp = CurrentDb.CreateProperty("AllowBypassKey", 1, False)

        CurrentDb.Properties.Append prp

        Resume Next

   

    Else ' Unknown error.

        MsgBox Err.Description

        ChangeProperty = False

        Resume Change_Bye

    End If

End Function

#2

بإختصار ، هذا الكود يتأكد من ان البرنامج مصرح لإستخدامه :)

ثم يربط البرنامج مع الجداول.

 

جعفر

تم تعديل هذه المشاركة بواسطة jjafferr في 21 نوفمبر 2013 في 22:44

#3
jjafferr كتب:

بإختصار ، هذا الكود يتأكد من ان البرنامج مصرح لإستخدامه :)

ثم يربط البرنامج مع الجداول.

 

جعفر

 

ممكن اعرف ازاى اعدل فى هذا الكود او ممكن الشرح

 

 

احمد حسن

#4

انا اعتذر منك ، لا استطيع تلبية طلبك :(

لأني احترم برمجة المبرمج لحفظ برنامجه من الاستعمال غير اللي هو يريده ،

فيرجى الاتصال بالمبرمج واخذ التفاصيل منه :)

 

جعفر

#5
jjafferr كتب:

انا اعتذر منك ، لا استطيع تلبية طلبك :(

لأني احترم برمجة المبرمج لحفظ برنامجه من الاستعمال غير اللي هو يريده ،

فيرجى الاتصال بالمبرمج واخذ التفاصيل منه :)

 

جعفر

المشكله انا معايا تشغيل البرنامج ده صاحبه سيبهولى وسافر بس انا فى واحد خد من الفلاشه بتاعتى وخد تشغيل البرنامج وانا مش عارف اعمل ايه وصاحب البرنامج مش عارف اوصله انه هو فى ايطاليا وعايز امن البرنامج ومش عارف 

تم تعديل هذه المشاركة بواسطة AHMED 7ASSAN في 24 نوفمبر 2013 في 18:30

مواضيع مشابهة