ابو فتحى قام بنشر مايو 18, 2015 مشاركة قام بنشر مايو 18, 2015 (معدل) السلام عليكم ورحمة الله و بركاته كيفية ربط و ادخال و تعديل و حذف البيانات فى sql (قاعادة بيانات ) و الاكسيس ( نماذج و تقارير و شاشات بحث فقط ) بالاكواد تم تعديل مايو 18, 2015 بواسطه ابو فتحى رابط هذا التعليق شارك More sharing options...
Elsayed Bn Gemy قام بنشر مايو 18, 2015 مشاركة قام بنشر مايو 18, 2015 اخى الكريم هل انت تمتلك قاعدة بيانات sql على استضافة فى سيرفير ما ؟؟ واذا كنت ذلك هل تريد ربط الجداول من خلال النماذج ؟؟ فقط ام تريد ربط الجداول من خلال الاكسس نفسه ؟؟ رابط هذا التعليق شارك More sharing options...
ابو فتحى قام بنشر مايو 19, 2015 الكاتب مشاركة قام بنشر مايو 19, 2015 اخى الكريم اولا " ممكن جدوال sql فى الكمبيوترالرئيسى على الشبكة او على موقع على النت ثانيا " تخزين البيانات عند زر الحفظ يتم عمل اتصال بقاعدة البيانات يتم اضافة البيانات او تعديله او حذفه ثم فصل الاتصال كل ذلك بالكود رابط هذا التعليق شارك More sharing options...
Elsayed Bn Gemy قام بنشر مايو 19, 2015 مشاركة قام بنشر مايو 19, 2015 اخى الكريم بالنسبة لانشاء الاتصال له طريقتين الاولى بالنسبة لموضوع الربط كانت الفكرة انك لو نقلت قاعدة البيانات بتاعتك لاكثر من جهاز هتضر تضيف اتصال 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 ودى اول طريقة 1 رابط هذا التعليق شارك More sharing options...
Elsayed Bn Gemy قام بنشر مايو 19, 2015 مشاركة قام بنشر مايو 19, 2015 الحل الثانى وهو ربط القاعدة مباشرة بالجدوال الموجودة على قاعدة 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 وشكر الله لك رابط هذا التعليق شارك More sharing options...
ابو فتحى قام بنشر مايو 19, 2015 الكاتب مشاركة قام بنشر مايو 19, 2015 اخى الكريم الف شكر على الرد ممكن شرح اضافة البيانات او تعديل او حذف يالكود من نماذج الاكسيس رابط هذا التعليق شارك More sharing options...
yms12 قام بنشر مايو 19, 2015 مشاركة قام بنشر مايو 19, 2015 مبدع اخونا مارد رابط هذا التعليق شارك More sharing options...
Elsayed Bn Gemy قام بنشر مايو 19, 2015 مشاركة قام بنشر مايو 19, 2015 تعديل اخى الكريم فى الوحدة النمطية الاولى الخاصة بانشاء اتصال 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 رابط هذا التعليق شارك More sharing options...
سوبربرو قام بنشر يونيو 3, 2015 مشاركة قام بنشر يونيو 3, 2015 مشكور أخي الكريم رابط هذا التعليق شارك More sharing options...
ابوخليل قام بنشر يونيو 3, 2015 مشاركة قام بنشر يونيو 3, 2015 من باب ربط المتشابه ومشاهدة التطبيق وتحميل المرفقات من هنا http://www.officena.net/ib/index.php?showtopic=61514 رابط هذا التعليق شارك More sharing options...
محمد ايمن قام بنشر أكتوبر 10, 2016 مشاركة قام بنشر أكتوبر 10, 2016 تحية طيبة اخي السيد جمال رابط هذا التعليق شارك More sharing options...
محمد سلامة قام بنشر أكتوبر 10, 2016 مشاركة قام بنشر أكتوبر 10, 2016 السلام عليكم كيف فاتني هذا الموضوع المهم جدا متابع رابط هذا التعليق شارك More sharing options...
الردود الموصى بها
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.