اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

جلب التاريخ من السيرفر وليس من جهاز المستخدم


إذهب إلى أفضل إجابة Solved by jjafferr,

الردود الموصى بها

شكرا جزيلا 🙂

 

اذن ، مافي داعي للتعديل اليدوي على كل برنامج ، فرجاء تعديل الوحدة النمطية الى :

Public Function Make_File()

    Dim BE_Path, PauseTime, Start
    
    'get the server path
    'BE_Path = DLookup("[Database]", "MSysObjects", "[Flags]=2097152")   'Path and BE name
    BE_Path = Get_DB_Path_2												 'Path and BE name
    BE_Path = Mid(BE_Path, 1, InStrRev(BE_Path, "\"))
    BE_Path = BE_Path & "dummy.txt"
    
    'make the dummy txt file
    Open BE_Path For Output As #1
        Print #1, "No text required"
    Close #1
    
    'pasue for a second, until file is recognized, for slow networks
    PauseTime = 1    ' Set duration.
    Start = Timer    ' Set start time.
    Do While Timer < Start + PauseTime
        DoEvents    ' Yield to other processes.
    Loop
    
    'get the date created
    Make_File = FileDateTime(BE_Path)
    
    'clean up, delete the file
    Kill BE_Path

End Function

Public Function Get_DB_Path_2()

    Dim rst As DAO.Recordset
    
    Set rst = CurrentDb.OpenRecordset("SELECT Database FROM MSysObjects WHERE (MSysObjects.Database) Is Not Null")
    Get_DB_Path_2 = rst(0)
    
    rst.Close: Set rst = Nothing
End Function

 

جعفر

my_FE.mdb.zip

  • Like 2
رابط هذا التعليق
شارك

ولله ابداع ماشالله تبارك الله
يعمل 100% 
سوى  تم اخفاء الجداول المرتبطه او اظهارها
وبصراحه جدا مهم انه غير مرتبط بوضع المسار وخاصه عند تغير اسم البرنامج او النسخه
فالف شكر لك
 

رابط هذا التعليق
شارك

  • أفضل إجابة

رحم الله والديك دنيا وآخرة ، و زاد الله فضله عليك 🙂

 

في هذه الحالة ، بالاضافة الى مشاركتي السابقة مع المرفق ، عندك طريقة اخرى ، وبدون الوحدة النمطية الثانية :

Public Function Make_File()

    Dim BE_Path, PauseTime, Start
    
    'get the server path
    BE_Path = DLookup("[Database]", "MSysObjects", "[Database] Is Not Null")   'Path and BE name
    BE_Path = Mid(BE_Path, 1, InStrRev(BE_Path, "\"))
    BE_Path = BE_Path & "dummy.txt"
    
    'make the dummy txt file
    Open BE_Path For Output As #1
        Print #1, "No text required"
    Close #1
    
    'pasue for a second, until file is recognized, for slow networks
    PauseTime = 1    ' Set duration.
    Start = Timer    ' Set start time.
    Do While Timer < Start + PauseTime
        DoEvents    ' Yield to other processes.
    Loop
    
    'get the date created
    Make_File = FileDateTime(BE_Path)
    
    'clean up, delete the file
    Kill BE_Path

End Function

 

جعفر

  • Like 2
رابط هذا التعليق
شارك

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


اسال الله لك الزرق الواسع وامدك بالصحه والعافيه 
ونا امنون لك
 

  • Like 2
رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information