اذهب الي المحتوي
أوفيسنا

Elsayed Bn Gemy

الخبراء
  • Posts

    1162
  • تاريخ الانضمام

  • تاريخ اخر زياره

  • Days Won

    11

كل منشورات العضو Elsayed Bn Gemy

  1. او ممكن تضيف مربع النص اللى عاوز يظهر فيه اليوم وتخلى تنسيقه dddd وتخلى مصدر بياناته هو حقل التاريخ
  2. fldDay: Format([fldDate];"dddd") fldDate هو حقل التاريخ fldDay هو الحقل الذي تريد عرض اسم اليوم فيه
  3. اخى راعى الغنم ؟؟ السنة Dim f, k As Date Dim j As String Dim s As Long If DCount("id", "mytable") > 0 Then f = DMax("mydate", "mytable") If Year(MyDate) > Year(f) Then ID = 1 Else j = "Year(MyDate) = " & Year(Me.MyDate) ID = DMax("id", "mytable", j) + 1 End If Else ID = 1 End If
  4. اخى ومعلمى جعفر هذا صحيح ولكن انا اتعامل مع فئة واحدة فى حقل التاريخ وهو رقم الشهر او رقم اليوم لذلك كان الكود بهذا الشكل
  5. نشكر لكم مروركم اخى الكريم واحب ان اضيف انه ما زادنى مروركم الا شرفا شكراااااااااااااااا لك
  6. شكرا على الورد يا صاحبى بيتاكل دا ؟؟ هههههههههههههههههه
  7. بارك الله لك اخى الفاضل ولك من جزيل الشكر وشكرا جدا لمرورك الكريم
  8. تعديل اخى الكريم فى الوحدة النمطية الاولى الخاصة بانشاء اتصال DSN وانا براجع الموضوع لقيت الوحدتين مثل بعض تماما وهذه هى تصحيح الوحدة النمطية الاولى '//Name : CreateDSNConnection '//Purpose : Create a DSN to link tables to SQL Server '//Parameters '// stServer: Name of SQL Server that you are linking to '// stDatabase: Name of the SQL Server database that you are linking to '// stUsername: Name of the SQL Server user who can connect to SQL Server, leave blank to use a Trusted Connection '// stPassword: SQL Server user password Function CreateDSNConnection(stServer As String, stDatabase As String, Optional stUsername As String, Optional stPassword As String) As Boolean On Error GoTo CreateDSNConnection_Err Dim stConnect As String If Len(stUsername) = 0 Then '//Use trusted authentication if stUsername is not supplied. stConnect = "Description=myDSN" & vbCr & "SERVER=" & stServer & vbCr & "DATABASE=" & stDatabase & vbCr & "Trusted_Connection=Yes" Else stConnect = "Description=myDSN" & vbCr & "SERVER=" & stServer & vbCr & "DATABASE=" & stDatabase & vbCr End If DBEngine.RegisterDatabase "myDSN", "SQL Server", True, stConnect '// Add error checking. CreateDSNConnection = True Exit Function CreateDSNConnection_Err: CreateDSNConnection = False MsgBox "CreateDSNConnection encountered an unexpected error: " & Err.Description End Function ويمكنك مراجعة ذلك من خلال موقع الدعم فى ميكروسوفت https://support.microsoft.com/en-us/kb/892490
  9. هههههههههههههه ونحن ايضا اخى جعفر لا نغض الطرف ابدا عن مشاركاتك ولكن شتان بين نظرتنا ونظرتك فنحن نتعلم اما انتم فعليكم المراقبة شكرا لمرورك
  10. وبارك الله لك اخى الكريم ولك مثل ما دعوت لنا اخى الفاضل
  11. شكر الله لك اخى الكريم هنأك الله بالقبول وأسكنك الجنة مع الرسول وجعل أيامك فاتحة بهجة لاتزول وتحية خاصة منى الى اخى الفاضل عبدالله قدور
  12. العفو يا اخى الكريم ولكن هل يمكن اختيار ان الموضوع مجاب
  13. الحل الثانى وهو ربط القاعدة مباشرة بالجدوال الموجودة على قاعدة SQL عن طريق الوحدة النمطية دى '//Name : AttachDSNLessTable '//Purpose : Create a linked table to SQL Server without using a DSN '//Parameters '// stLocalTableName: Name of the table that you are creating in the current database '// stRemoteTableName: Name of the table that you are linking to on the SQL Server database '// stServer: Name of the SQL Server that you are linking to '// stDatabase: Name of the SQL Server database that you are linking to '// stUsername: Name of the SQL Server user who can connect to SQL Server, leave blank to use a Trusted Connection '// stPassword: SQL Server user password Function AttachDSNLessTable(stLocalTableName As String, stRemoteTableName As String, stServer As String, stDatabase As String, Optional stUsername As String, Optional stPassword As String) On Error GoTo AttachDSNLessTable_Err Dim td As TableDef Dim stConnect As String For Each td In CurrentDb.TableDefs If td.Name = stLocalTableName Then CurrentDb.TableDefs.Delete stLocalTableName End If Next If Len(stUsername) = 0 Then '//Use trusted authentication if stUsername is not supplied. stConnect = "ODBC;DRIVER=SQL Server;SERVER=" & stServer & ";DATABASE=" & stDatabase & ";Trusted_Connection=Yes" Else '//WARNING: This will save the username and the password with the linked table information. stConnect = "ODBC;DRIVER=SQL Server;SERVER=" & stServer & ";DATABASE=" & stDatabase & ";UID=" & stUsername & ";PWD=" & stPassword End If Set td = CurrentDb.CreateTableDef(stLocalTableName, dbAttachSavePWD, stRemoteTableName, stConnect) CurrentDb.TableDefs.Append td AttachDSNLessTable = True Exit Function AttachDSNLessTable_Err: AttachDSNLessTable = False MsgBox "AttachDSNLessTable encountered an unexpected error: " & Err.Description End Function وفى حدث عند الفتح للنموذج Private Sub Form_Open(Cancel As Integer) If AttachDSNLessTable("authors", "authors", "(local)", "pubs", "", "") Then '// All is okay. Else '// Not okay. End If End Sub وشكر الله لك
  14. اخى الكريم بالنسبة لانشاء الاتصال له طريقتين الاولى بالنسبة لموضوع الربط كانت الفكرة انك لو نقلت قاعدة البيانات بتاعتك لاكثر من جهاز هتضر تضيف اتصال DSN لكل جهاز عله قاعدة البيانات علشان تقدر تتصل بالداتابيز اللى على الاستضافة الحل هو انك تنشء اتصال عن طريق وحدة نمطية بدون استخدام معالج البيانات فى الويندوز اولا هتضيف الوحدة النمطية دى بدون التعدل عليها '//Name : AttachDSNLessTable '//Purpose : Create a linked table to SQL Server without using a DSN '//Parameters '// stLocalTableName: Name of the table that you are creating in the current database '// stRemoteTableName: Name of the table that you are linking to on the SQL Server database '// stServer: Name of the SQL Server that you are linking to '// stDatabase: Name of the SQL Server database that you are linking to '// stUsername: Name of the SQL Server user who can connect to SQL Server, leave blank to use a Trusted Connection '// stPassword: SQL Server user password Function AttachDSNLessTable(stLocalTableName As String, stRemoteTableName As String, stServer As String, stDatabase As String, Optional stUsername As String, Optional stPassword As String) On Error GoTo AttachDSNLessTable_Err Dim td As TableDef Dim stConnect As String For Each td In CurrentDb.TableDefs If td.Name = stLocalTableName Then CurrentDb.TableDefs.Delete stLocalTableName End If Next If Len(stUsername) = 0 Then '//Use trusted authentication if stUsername is not supplied. stConnect = "ODBC;DRIVER=SQL Server;SERVER=" & stServer & ";DATABASE=" & stDatabase & ";Trusted_Connection=Yes" Else '//WARNING: This will save the username and the password with the linked table information. stConnect = "ODBC;DRIVER=SQL Server;SERVER=" & stServer & ";DATABASE=" & stDatabase & ";UID=" & stUsername & ";PWD=" & stPassword End If Set td = CurrentDb.CreateTableDef(stLocalTableName, dbAttachSavePWD, stRemoteTableName, stConnect) CurrentDb.TableDefs.Append td AttachDSNLessTable = True Exit Function AttachDSNLessTable_Err: AttachDSNLessTable = False MsgBox "AttachDSNLessTable encountered an unexpected error: " & Err.Description End Function وفى حدث عند فتح النموذج ستضيف الكود التالى Private Sub Form_Open(Cancel As Integer) If CreateDSNConnection("(اسم السرفر )", "اسم قاعدة البيانات ", "اسم المستخدم ", "كلمة السر ") Then '// All is okay. Else '// Not okay. End If End Sub ودى اول طريقة
  15. مرحبا استاذ مارد ولو اردنا ان يكون الترقيم لليوم الحالي فكيف يكون عمل ذلك؟؟؟؟؟؟؟؟؟؟؟؟ يكون هكذا اخى الكريم واعزرنى لتاخرى فلم ارى المشاركة ال الان Dim f, k As Date Dim j As String Dim s As Long If DCount("id", "mytable") > 0 Then f = DMax("mydate", "mytable") If Day(MyDate) > Day(f) Then ID = 1 Else j = "Day(MyDate) = " & Day(Me.MyDate) ID = DMax("id", "mytable", j) + 1 End If Else ID = 1 End If
  16. اخى الكريم هل انت تمتلك قاعدة بيانات sql على استضافة فى سيرفير ما ؟؟ واذا كنت ذلك هل تريد ربط الجداول من خلال النماذج ؟؟ فقط ام تريد ربط الجداول من خلال الاكسس نفسه ؟؟
  17. حمد الله على السلامة اخى جعفر ووممكن بقاعدة التجميع Me.TotalByNumbers = DCount("PSelect", "[TblEmployees]", "[PSelect] = true") فى حدث بعد التحديث لمربع الاختيار
  18. انا لا اتكلم عن ربط الجداول اخى الكريم . انا اتكلم عن ربط النماذج . الرئيسية بالفرعية حتى تتمكن من اضافة الاصناف
  19. شكرا لك اخى الكريم والله انى مبتدئ مثلك ومن منا يدعى الكمال ؟؟ فالكمال لله وحده والله ما اطلب الا صالح دعائك هذا شكرا لك
  20. ما انت لازم تربط النموزج الفرعى بالرئيسى عن طريق كود السيارة علشان تقدر تضف لكل سيارة الاصناف بتاعتها
  21. طيب مش البرنامج بتاع العهدة شغال مظبوط ؟؟ افتحه فى عرض التصميم وشوف ايه االشغل اللى فيه وطبقه هنا
×
×
  • اضف...

Important Information