ﺑﺴﻢ اﷲ اﻟﺮﺣﻤﻦ اﻟﺮﺣﯿﻢ وﺑﮫ ﻧﺴﺘﻌﯿﻦ واﻟﺼﻼه واﻟﺴﻼم ﻋﻠﻰ ﺳﯿﺪﻧﺎ ﻣﺤﻤﺪ ﺧﺎﺗﻢ اﻻﻧﺒﯿﺎء واﻟﻤﺮﺳﻠﯿﻦ
Active x data object ﺗﺄﻟﯿﻒ /ﺳﺎﻣﺢ ﺳﻨﻮﺳﻰ Tel, \ +20109918473
samauthority@yahoo.com ﻟﻤﺰﻳﺪ ﻣﻦ اﻟﻜﺘﺐ ﺗﻔﻀﻠﻮ ﺑﺰﻳﺎره
www.cb4a.com
1 PDF created with pdfFactory trial version www.pdffactory.com
اھﺪاء ﺑﺴﻢ اﷲ اﻟﺮﺣﻤﻦ اﻟﺮﺣﯿﻢ
"رب ﻗﺪ اﺗﯿﺘﻨﻰ ﻣﻦ اﻟﻤﻠﻚ وﻋﻠﻤﺘﻨﻰ ﻣﻦ ﺗﺄوﯾﻞ اﻻﺣﺎدﯾﺚ ﻓﺎﻃﺮ اﻟﺴﻤﻮات واﻻرض اﻧﺖ وﻟﻰّ ﻓﻰ اﻟﺪﻧﯿﺎ واﻻﺧﺮه ﺗﻮﻓﺘﻰ ﻣﺴﻠﻤﺎ واﻟﺤﻘﻨﻰ ﺑﺎﻟﺼﺎﻟﺤﯿﻦ" ﺻﺪق اﷲ اﻟﻌﻈﯿﻢ
ﻓﻰ اﻟﺒﺪاﯾﮫ … وﻗﺒﻞ ان اﺳﺘﺮﺳﻞ ﻓﻰ اﻟﺤﺪﯾﺚ اوﺟﮫ ﺷﻜﺮى وﺣﺒﻰ وﺗﻘﺪﯾﺮى اﻟﻰ اﻟﺤﺒﯿﺐ اﻟﻐﺎﻟﻰ وھﻮ اﻟﺬى ﯾﻤﺪﻧﻰ ﺑﺎﻟﺪﻋﻢ ﻋﻨﺪ ﺗﻮﻗﻒ اﻟﺤﻤﺎس … واﻟﺘﺬﻛﺮه ﻓﻰ ﻛﻞ ﺣﺎل … اﻟﻰ ﻧﺒﻊ اﻟﺤﺐ… اﻟﻰ ﻧﺒﻊ اﻟﻌﻄﺎء… اﻟﻰ ﺻﻮت ﺿﻤﯿﺮى… اﻟﻰ…
و ادﯾﻦ ﺑﻜﻞ اﻟﺸﻜﺮ واﻟﺘﻘﺪﯾﺮ اﻟﻰ ﻛﻞ اﺳﺎﺗﺬﺗﻰ وﻣﻌﻠﻤﯿﻨﻰ ﺟﻌﻞ اﷲ ﻋﻄﺎءھﻢ ﻓﻰ ﻣﯿﺰان ﺣﺴﻨﺎﺗﮭﻢ واﻟﻰ ﻛﻞ ﻣﻦ ﻋﻠﻤﻨﻰ ﺣﺮﻓﺎ … واﻟﺸﻜﺮ ﷲ ﻣﻠﺤﻮﻇﻪ :ھﺬا اﻟﻜﺘﺎب ﻣﺠﺎﻧﻰ وﻻ ﻳﺠﻮز ﺑﯿﻌﻪ اﻻ ﺑﻤﻮاﻓﻘﻪ ﻛﺘﺎﺑﯿﻪ ﻣﻦ اﻟﻤﺆﻟﻒ 2 PDF created with pdfFactory trial version www.pdffactory.com
ﻓﮭﺮس اﻟﻜﺘﺎب
ﺗﻌﺮﻳﻒ ﻣﻜﺘﺒﻪADO.OLEDB
4
ﻣﻤﯿﺰات ﻣﻜﺘﺒﻪADO.OLEDB
5 6
ﻛﯿﻔﯿﻪ رﺑﻂ ﻣﻜﺘﺐADOﺑﻘﺎﻋﺪه ﺑﯿﺎﻧﺎت ACCESSاﺻﺪار2000 ﻛﯿﻔﯿﻪ رﺑﻂ ﻣﻜﺘﺒﻪ ADOﺑﻘﺎﻋﺪه ﺑﯿﺎﻧﺎت ACCESSاﺻﺪار97
18
اﺳﺘﺨﺪاﻣﺎت ﻣﺘﻄﻮره ﻟﻤﻜﺘﺒﻪ ADO
19
ﻛﯿﻔﯿﻪ اﻟﺘﻌﺎﻣﻞ ﻣﻊ FLAT FILEﻣﻦ ﺧﻼل ﻣﻜﺘﺒﻪ )ADO. (OLEDB
28
اﺳﺘﺨﺪام ﺟﻤﻞ اﻻﺳﺘﻌﻼمSQLﻓﻰ اﻟﺮﺑﻂ ﺑﻘﻮاﻋﺪ اﻟﺒﯿﺎﻧﺎت
29
اﺳﺘﺨﺪاﻣﺎت ﻣﻜﺘﺒﻪ) ADO.(OLEDBﻓﻰ اﻟﺘﻌﺎﻣﻞ ﻣﻊ اﻟﺒﯿﺎﻧﺎت
33
samauthority@yahoo.com 3 PDF created with pdfFactory trial version www.pdffactory.com
اوﻻ :ﺗﻌﺮﯾﻒ ﻣﻜﺘﺒﮫ ADO >><<ACTIVE X DATA OBJECT ھﻰ ﻣﻜﺘﺒﮫ ﺗﻌﻤﻞ ﺗﺤﺖ ﺑﯿﺌﮫ ﻓﯿﺠﻮال ﺑﯿﺴﻚ واﯾﻀﺎ اﻟﻌﺪﯾﺪ ﻣﻦ ﻟﻐﺎت اﻟﺒﺮﻣﺠﮫ اﻻﺧﺮى وﺗﺤﺘﻮى ﻋﻠﻰ ﻋﺪه ﺧﻮاص ،ﺣﯿﺚ ﯾﻤﻜﻨﮭﺎ اﻟﺮﺑﻂ ﺑﯿﻦ ﻗﻮاﻋﺪ اﻟﺒﯿﺎﻧﺎت واﻟﻔﯿﺠﻮال ﺑﯿﺴﻚ ﺑﺴﮭﻮﻟﮫ ﻓﮭﻰ ﺑﺎﻟﻘﺪر اﻟﻜﺎﻓﻰ ﻻﺣﺘﻤﺎل ﻗﻮاﻋﺪ اﻟﺒﯿﺎﻧﺎت اﻟﻀﺨﻤﮫ ﻻ ﺗﻌﻤﻞ ﺗﺤﺖ ﺑﯿﺌﮫ اﻟﻔﯿﺠﻮال ﺑﯿﺴﻚ ﻓﻘﻂ ،واﻧﻤﺎ ﯾﻤﻜﻨﮭﺎ اﻟﻌﻤﻞ ﺗﺤﺖ اﻟﻌﺪﯾﺪ ﻣﻦ ﻟﻐﺎت اﻟﺒﺮﻣﺠﮫ وﺑﺮاﻣﺞ اﻟﺘﻄﺒﯿﻘﺎت اﻟﻤﺨﺘﻠﻔﮫ ﻋﻠﻰ ﺳﺒﯿﻞ اﻟﻤﺜﺎل وﻟﯿﺲ اﻟﺤﺼﺮ... * Visual basic * Visual basic.net * Microsoft power pointﻣﻦ ﺧﻼل ><VB.EDITOR واﯾﻀﺎ ﺗﻌﻤﻞ ﻣﻊ اﻟﻌﺪﯾﺪ ﻣﻦ اﻧﻮاع ﻗﻮاﻋﺪ اﻟﺒﯿﺎﻧﺎت اﻟﻀﺨﻤﮫ ﻣﺜﻞ: * ORACLE * SQL SERVER * ACCESS * وﻓﻰ ﺷﺮﺣﻨﺎ ﺑﺎذن اﷲ ﺳﻨﺘﻨﺎول ﻛﯿﻔﯿﮫ اﻟﺮﺑﻂ ﺑﻌﺪه ﻗﻮاﻋﺪ ﺑﯿﺎﻧﺎت
واﯾﻀﺎ ﺗﺤﺘﻮى ﻋﻠﻰ ﻋﺪه ادوات ﻣﻠﺤﻘﮫ ﻣﻦ اھﻤﮭﺎ: )Microsoft DB GRID 6.0(OLEDB )Microsoft DB LIST GRID 6.0(OLEDB )Microsoft hieratical flex grid Control 6.0(OLEDB 4 PDF created with pdfFactory trial version www.pdffactory.com
ﻣﻤﯿﺰات ﻣﻜﺘﺒﮫADO -1اوﻻ اﻟﻘﻮه ﻓﻰ ﺣﻔﻆ ﻛﻤﯿﮫ ھﺎﺋﻠﮫ ﻣﻦ اﻟﺒﯿﺎﻧﺎت.
-2اﻟﺘﻌﺎﻣﻞ ﻣﻊ اﻟﻌﺪﯾﺪ ﻣﻦ ﻗﻮاﻋﺪ اﻟﺒﯿﺎﻧﺎت وھﻰ ﻣﯿﺰه ﻓﺮﯾﺪه ﻣﻦ ﻧﻮﻋﮭﺎ ﺑﺎﻟﻨﺴﺒﮫ ﻟﮭﺬه اﻟﻤﻜﺘﺒﮫ.
-3ﺳﺆال اﻟﻤﺴﺘﺨﺪم ﻋﻦ ﻧﻮع ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت اﻟﻤﺮاد اﺳﺘﺨﺪاﻣﮭﺎ.
-4ﺳﺆال اﻟﻤﺴﺘﺨﺪم ﻋﻦ اذا ﻛﺎن ھﻨﺎك ﺷﻔﺮه ﻟﻘﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت ام ﻻ.
-5ﯾﻤﻜﻦ اﺳﺘﺨﺪاﻣﮭﺎ ﻣﻊ ﺑﯿﺎﻧﺎت ﻣﺴﺠﻠﮫ ﻋﻠﻰ SERVERواﻟﺘﻌﺎﻣﻞ ﻣﻌﮭﺎ ﺑﻜﻞ ﺳﮭﻮﻟﮫ .
-6ﺗﺘﻤﯿﺰ ﻋﻦ ﻣﻜﺘﺒﮫ DATA CONTROLاﻟﺘﻘﻠﯿﺪﯾﮫ ﻓﻰ اﻧﮭﺎ ﺗﺘﻌﺎﻣﻞ ﻣﻊ ﺟﻤﯿﻊ اﺻﺪارات .ACCESS
-7ﺗﺘﻤﯿﺰ ﻋﻦ ) DAO data control6.0 (OLEDBﻓﻰ اﻧﮭﺎ ﺗﺴﺄل اﻟﻤﺴﺘﺨﺪم ﻋﻦ ﻧﻮع ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت اﻟﻤﺴﺘﺨﺪﻣﮫ ﻛﻤﺎ اﺳﻠﻔﻨﺎ ،اى اﻧﮭﺎ ﻟﯿﺴﺖ ﻗﺎﺻﺮه ﻋﻠﻰ ﻗﻮاﻋﺪ ﺑﯿﺎﻧﺎتACCESS ﻛﻤﺎ اﻟﺤﺎل ﻓﻰ ﻣﻜﺘﺒﮫ). (DAO
5 PDF created with pdfFactory trial version www.pdffactory.com
ﻛﯿﻔﯿﮫ رﺑﻂ ﻣﻜﺘﺒﮫ ADOﺑﻘﺎﻋﺪه ﺑﯿﺎﻧﺎت ACCESSاﺻﺪار2000 اوﻻ اﻧﺸﺎء ﻗﺎﻋﺪه ﺑﯿﺎﻧﺎت اﻛﺴﯿﺲ ﻣﺜﻼ ﺑﺎﺳﻢ(Customers data)... ﺛﻢ ﻧﻨﺸﻰء ﺟﺪول ﯾﺴﻤﻰ ﻣﺜﻼ )(Customer ﺑﻌﺪ ادﺧﺎل اﻟﺒﯿﺎﻧﺎت)(Id - Name - Address - phone - e-mail ﻧﻘﻮم ﺑﻔﺘﺢ ﺑﯿﺌﮫ اﻟﻔﯿﺠﻮال ﺑﯿﺴﻚ ﺛﻢ اﻧﺸﺎء ﻣﺸﺮوع ﻗﯿﺎﺳﻰ ﺟﺪﯾﺪ
ﺛﻢ اﺣﻀﺎر ﻣﻜﺘﺒﮫ )ADO DATA CONTROL (OLEDB ﻣﻦ ﻗﺎﺋﻤﮫ Componentsﻛﻤﺎ ﺑﺎﻟﺸﻜﻞ 6 PDF created with pdfFactory trial version www.pdffactory.com
ﻛﻤﺎ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ )اﻟﻤﻜﺘﺒﺎت(
ﺛﻢ اﺿﺎﻓﺘﮭﺎ اﻟﻰ اﻟﻔﻮرم ﺛﻢ ﻧﻘﻮم ﺑﺘﻐﯿﯿﺮ ﺧﺼﺎﺋﺼﮭﺎ ﻣﻦ ﺧﻼل اﻟﻨﺎﻓﺬه اﻟﺘﺎﻟﯿﮫ Adodc properties
7 PDF created with pdfFactory trial version www.pdffactory.com
ﺛﻢ ﻣﻦ ﺧﻼل ﻧﺎﻓﺬه Connection stringاى ﻧﻮﻋﯿﮫ اﻟﺘﻮﺻﯿﻞ ﻧﺨﺘﺎر BUILD
ﺳﻮف ﺗﺴﺄل اﻟﻤﻜﺘﺒﮫ ﻋﻦ ﻧﻮﻋﯿﮫ ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت اﻟﻤﺮاد اﺳﺘﺨﺪاﻣﮭﺎ وذﻟﻚ ﻣﻦ ﺧﻼل ﺟﻤﻞ اﻟﺘﻌﺎرﯾﻒ اﻻﺗﯿﮫ واﻟﺨﺎﺻﮫ ﺑﻜﻞ ﻣﺰود ﺧﺪﻣﮫ او ﻗﺎﻋﺪه ﺑﯿﺎﻧﺎت ﻛﻤﺎ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ:
8 PDF created with pdfFactory trial version www.pdffactory.com
ﻧﺨﺘﺎر ﺟﻤﻠﮫ اﻟﺘﻌﺮﯾﻒ اﻟﺨﺎﺻﮫ ﺑﻘﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت اﻟﻤﺴﺘﺨﺪﻣﮫ accessاﺻﺪار 2000 وھﻰ ﻛﺎﻟﺘﺎﻟﻰ: Microsoft JET4.0 OLEDB Provider ﺛﻢ ﻧﻀﻐﻂ nextﻟﺘﺤﺪﯾﺪ اﺳﻢ ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت وﻣﻜﺎﻧﮭﺎ ﻣﻦ ﺧﻼل اﻻﻣﺮ Connection ﻛﻤﺎ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ:
9 PDF created with pdfFactory trial version www.pdffactory.com
واﯾﻀﺎ ﻣﻦ اﻟﻤﻤﻜﻦ اﻟﺘﻌﺪﯾﻞ ﻓﻰ ﺷﻔﺮه ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت ﻣﻦ ﺧﻼل اﻻﻣﺮ ALLOW saving password او ﺟﻌﻠﮭﺎ اﻓﺘﺮاﺿﯿﮫ ﻣﻦ ﺧﻼل اﻻﻣﺮ Blank Password ﻓﮭﺬا اﻻﻣﺮ ﯾﺤﺘﻮى ﻋﻠﻰ اﺳﻢ اﻟﻤﺴﺘﺨﺪم اﯾﻀﺎ وﺗﺴﺘﺨﺪم ھﺬه اﻟﺨﯿﺎرات ﻏﺎﻟﺒﺎ ﻣﻊ ﻗﻮاﻋﺪ اﻟﺒﯿﺎﻧﺎت اﻟﺘﻰ ﺗﻜﻮن ﻓﻰ اﻣﺎﻛﻦ ﻏﯿﺮ ﻣﻮﺿﻊ اﻟﺒﺮﻧﺎﻣﺞ اﻟﻤﺤﺘﻮى ﻋﻠﻰ ﺑﯿﺎﻧﺎت ھﺬه اﻟﻘﺎﻋﺪه... اى ﺗﻜﻮن ﻣﺮﻓﻮﻋﮫ ﻋﻠﻰ SERVER ﻣﻠﺤﻮﻇﮫ: ﻻﺗﻤﺎم ﻋﻤﻠﯿﮫ رﺑﻂ ﻗﺎﻋﺪه ﺑﯿﺎﻧﺎت ﺑﺒﺮﻧﺎﻣﺞ اﻟﻔﯿﺠﻮال ﺑﯿﺴﻚ واﻟﺘﻰ ﺗﻜﻮن ﻣﺮﻓﻮﻋﮫ ﻋﻠﻰSERVER ﯾﻔﻀﻞ اﺳﺘﺨﺪام ﻗﺎﻋﺪه ﺑﯿﺎﻧﺎت SQL SERVERاو ﻗﺎﻋﺪه ﺑﯿﺎﻧﺎت ﺑﺘﻜﻨﻮﻟﻮﺟﯿﺎORACLE *ﺑﻌﺪ ﻓﺘﺢ ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت اﻟﻤﻄﻠﻮﺑﮫ ﻧﻀﻐﻂ ﻋﻠﻰ اﻟﺰر اﻟﻤﻜﺘﻮب ﻋﻠﯿﮫTest connection وذﻟﻚ ﻻﺧﺘﺒﺎر ﻋﻤﻠﯿﮫ اﻟﺘﻮﺻﯿﻞ ﺑﻘﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت.
ﯾﺠﺐ ان ﺗﻈﮭﺮ اﻟﺮﺳﺎﻟﮫ اﻟﺘﺎﻟﯿﮫ Test Connection Succeeded 10 PDF created with pdfFactory trial version www.pdffactory.com
اﻻن ﻗﺪ ﺗﻤﺖ ﻋﻤﻠﯿﮫ اﻟﺘﻮﺻﯿﻞ ﺑﻘﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت اﻟﻤﻄﻠﻮﺑﮫ وﺗﻢ ﺗﺤﺪﯾﺪ ﻧﻮﻋﮭﺎ ﯾﻨﻘﺺ ﻓﻘﻂ ﺗﺤﺪﯾﺪ اﻟﺠﺪول اﻟﻤﺮاد اﻟﺘﻌﺎﻣﻞ ﻣﻌﮫ ﻣﻦ ﺧﻼل اﻟﻘﺎﻋﺪه ﻣﻦ ﺧﻼل ﺧﺎﺻﯿﮫ RECORD SOURCE ﻛﻤﺎ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ:
واﯾﻀﺎ ﯾﻤﻜﻦ اﺧﺘﯿﺎر ﻧﻮع ﻃﺮﯾﻘﮫ اﺳﺘﺪﻋﺎء اﻟﺠﺪول وذﻟﻚ ﻟﺘﺴﮭﯿﻞ ﻋﻤﻠﯿﮫ اﻟﺮﺑﻂ اﺳﮭﻞ اﻟﻄﺮق ھﻰ اﺧﺘﯿﺎر اﻻﻣﺮ AdCmdTable ﻣﻦ ﻗﺎﺋﻤﮫ Command type وھﻰ ﻻﺧﺘﯿﺎر اﻟﺠﺪول ﻋﻦ ﻃﺮﯾﻖ اﺳﻤﮫ او اﻧﺸﺎء ﻃﺮﯾﻘﮫ اﻻﺳﺘﺪﻋﺎء ﺑﺎﻟﺠﺪاول ،ﻛﻤﺎ ھﻮ ﻣﻮﺿﺢ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ:
11 PDF created with pdfFactory trial version www.pdffactory.com
ھﻨﺎك ﻃﺮﯾﻘﮫ اﺧﺮى ﻷﺟﺮاء ﻋﻤﻠﯿﮫ اﻻﺳﺘﺪﻋﺎء ﻟﻠﺠﺪول اﻟﻤﻄﻠﻮب وھﻰ ﻋﻦ ﻃﺮﯾﻖ ﻛﺘﺎﺑﮫ ﺟﻤﻠﮫ SQL وذﻟﻚ ﺑﻌﺪ اﺧﺘﯿﺎر AdCmdTxetوذﻟﻚ ﻣﻦ اﻟﺘﺒﻮﯾﺐ .Command Type ﺛﻢ ﻛﺘﺎﺑﮫ ﺟﻤﻠﮫ اﻻﺳﺘﻌﻼم ﻓﻰ اﻟﻤﻜﺎن اﻟﻤﻮﺿﺢ ﺑﺎﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ :
وﻓﻰ اﻟﻤﻜﺎن اﻟﻤﺨﺼﺺ ﻟﻜﺘﺎﺑﮫ ﺟﻤﻠﮫ اﻻﺳﺘﻌﻼم ﯾﻤﻜﻦ ﻛﺘﺎﺑﮫ اﻟﺠﻤﻠﮫ اﻟﺘﺎﻟﯿﮫ SELECT*FROM CUSTOMER ﻛﻤﺎ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ:
12 PDF created with pdfFactory trial version www.pdffactory.com
ﺷﺮح اﻟﺠﻤﻠﮫ اﺧﺎﻃﺐ اﻻن اﻟﻤﻜﺘﺒﮫ واﻗﻮل ﻟﮭﺎ اﺧﺘﺎرى ﻛﻞ اﻟﺤﻘﻮل ﻣﻦ اﻟﺠﺪول INVOICE ﺣﯿﺚ اﺧﺘﺎر =SELECT ﻛﻞ اﻟﺤﻘﻮل =* ﻣﻦ اﻟﺠﺪول = "اﺳﻢ اﻟﺠﺪول"FROM * وﯾﻤﻜﻦ ﻋﻤﻞ ﺟﻤﻞ اﺳﺘﻌﻼم اﻛﺜﺮ دﻗﮫ ﻣﻦ ھﺬه... ﻓﻤﺜﻼ ان اردت اﻻﺳﺘﻌﻼم ﻋﻦ ﺣﻘﻞ ﻣﻌﯿﻦ او اﺳﻤﺎء ﻣﺸﺘﺮﻛﮫ ﻓﻰ ﺣﻘﻞ ﻣﻌﯿﻦ او اﺳﻢ ﻓﻘﻂﺳﻮف ﻧﻮاﻟﻰ ﺷﺮﺣﮭﺎ ﺑﺎذن اﷲ ﻣﺴﺘﻘﺒﻼ... اﻟﻤﻘﺼﻮد ﻣﻦ ھﺬا ان ھﺬه اﻟﻤﻜﺘﺒﮫ ﺑﺎﻟﻘﺪر اﻟﻜﺎﻓﻰ ﻻﺳﺘﯿﻌﺎب ﺟﻤﻞ اﻻﺳﺘﻌﻼم ﺑﻜﺎﻓﮫ اﻧﻮاﻋﮭﺎ وھﺬا ﯾﺠﻌﻠﮭﺎ ﺑﺎﻟﻘﻮه اﻟﻜﺎﻓﯿﮫ ﻟﻠﻤﻨﺎﻓﺴﮫ ﻓﻰ ﻋﺼﺮ اﻟﺒﺮﻣﺠﯿﺎت. وﺑﻌﺪ ﻛﻞ ھﺬه اﻟﻌﻤﻠﯿﺎت ﯾﻤﻜﻨﻨﺎ اﻻن اﻟﻌﻤﻞ ﻋﻠﻰ ﺑﯿﺌﮫ اﻟﻔﯿﺠﻮال ﺑﯿﺴﻚ وﺗﺤﺪﯾﺪ اﻟﺨﺼﺎﺋﺺ ﻟﺮﺑﻂ ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت ﺑﺎﻟﻮاﺟﮭﮫ اﻟﻤﻨﺎﺳﺒﮫ ﻟﮭﺎ. ﻧﻘﻮم ﺑﻌﻤﻞ ﺑﯿﺌﮫ ﻣﻨﺎﺳﺒﮫ ﻟﻘﺎﻋﺪه ﺑﯿﺎﻧﺎت ﺗﻨﺺ ﻋﻠﻰ" ﺑﯿﺎﻧﺎت اﻟﺰﺑﺎﺋﻦ او اﻟﻌﻤﻼء" ﻓﮭﻰ ﺗﺤﺘﻮى ﻋﻠﻰ اﻟﺤﻘﻮل اﻟﺘﺎﻟﯿﮫ: ID NAME ADRESS PHONE E-MAIL
اﻟﻨﻮع اﻟﻨﻮع اﻟﻨﻮع اﻟﻨﻮع اﻟﻨﻮع
ﻧﺺ ﻧﺺ ﻧﺺ ﻧﺺ ﻧﺺ
ﺛﻢ ﺣﻔﻆ ﻗﺎﻋﺪه ﺑﯿﺎﻧﺎت ﺑﺎﺳﻢ CUSTOMER.mdb
13 PDF created with pdfFactory trial version www.pdffactory.com
ﻛﻤﺎ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ:
ﺛﻢ ﻧﻘﻮم ﺑﺎدﺧﺎل اﻟﺒﯿﺎﻧﺎت ﻛﻤﺎ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ:
اﻻن ﺑﻌﺪ ذﻟﻚ ﻧﻘﻮم ﺑﺮﺑﻂ ھﺬه اﻟﻘﺎﻋﺪه ﺑﻔﯿﺠﻮال ﺑﯿﺴﻚ ﻋﻦ ﻃﺮﯾﻖ اﻟﺨﻄﻮات اﻟﺴﺎﺑﻘﮫ ﻣﻠﺤﻮﻇﮫ: اﻻن ﻻ ﺗﺤﺘﺎج اﻟﻰ ﺗﺤﻮﯾﻞ ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت اﻟﻰ اﺻﺪار ﺳﺎﺑﻖ ﺑﻞ ﯾﺘﻢ اﻟﻌﻤﻞ ﻋﻠﯿﮭﺎ ﻣﺒﺎﺷﺮه ﻣﻦ ﺧﻼل ﻣﻜﺘﺒﮫ)ADO. (OLEDB ﻛﻤﺎ ﻛﺎن اﻟﺤﺎل ﻓﻰ ﻣﻜﺘﺒﮫ .DATACONTROL ﻣﻜﻮﻧﺎت واﺟﮭﮫ ﻓﯿﺠﻮال ﺑﯿﺴﻚ اﻟﻤﺴﺘﺨﺪﻣﮫ ھﻰ: LABLE
5
TEXT boxes
5
وﻣﻜﺘﺒﮫ ADO 14 PDF created with pdfFactory trial version www.pdffactory.com
ﺑﻌﺪ وﺿﻊ اﻟﻤﻜﻮﻧﺎت ﻋﻠﻰ اﻟﻔﻮرم ﯾﺮﺟﻰ اﻟﺘﻨﺴﯿﻖ اﻟﻰ ان ﺗﺼﻞ اﻟﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ:
اﻻن وﺑﻌﺪ ان ﻗﻤﻨﺎ ﺑﺘﻮﺻﯿﻞ اﻟﻤﻜﺘﺒﮫ ﺑﻘﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت ﻧﻘﻮم ﺑﺘﻮﺻﯿﻞ ادوات اﻟﻨﻮاﺗﺞ ﺑﺎﻟﻤﻜﺘﺒﮫ ﻛﻤﺎ ﻓﻰ اﻻﺷﻜﺎل اﻟﺘﺎﻟﯿﮫ: ﺑﺎﻟﻨﺴﺒﮫ ﻟﺤﻘﻞ : ID
15 PDF created with pdfFactory trial version www.pdffactory.com
:Name ﺑﺎﻟﻨﺴﺒﮫ ﻟﺤﻘﻞ
:Addressﺑﺎﻟﻨﺴﺒﮫ ﻟﺤﻘﻞ
:Phone ﺑﺎﻟﻨﺴﺒﮫ ﻟﺤﻘﻞ
16 PDF created with pdfFactory trial version www.pdffactory.com
ﺑﺎﻟﻨﺴﺒﮫ ﻟﺤﻘﻞ :E-mail
وﺑﻌﺪ ان ﺗﻤﺖ ﻋﻤﻠﯿﮫ اﻟﺘﻮﺻﯿﻞ ﻗﻢ ﺑﺘﺸﻐﯿﻞ اﻟﺒﺮﻧﺎﻣﺞ ﺳﻮف ﺗﺤﺼﻞ ﻋﻠﻰ اﻟﻨﺘﯿﺠﮫ اﻟﻤﻄﻠﻮﺑﮫ ﺑﺎذن اﷲ. ﻛﻤﺎ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ:
17 PDF created with pdfFactory trial version www.pdffactory.com
ﻛﯿﻔﯿﮫ رﺑﻂ ﻣﻜﺘﺒﮫ ADOﺑﻘﺎﻋﺪه ﺑﯿﺎﻧﺎت ACCESSاﺻﺪار97 ﻟﻘﺪ ﺗﻌﺮﻓﻨﺎ ﻓﻰ اﻟﻤﻮﺿﻮع اﻟﺴﺎﺑﻖ ﻋﻠﻰ ﻛﯿﻔﯿﮫ اﻟﺮﺑﻂ ﺑﻘﺎﻋﺪهACCESSاﺻﺪار97 اﻻن ﺳﻮف ﻧﺘﻌﺮف ﻋﻠﻰ ﻛﯿﻔﯿﮫ اﻟﺘﻌﺎﻣﻞ ﻣﻊ اﻻﺻﺪار 97ﻣﻨﮭﺎ ھﻨﺎك ﺑﻌﺾ اﻟﺘﻐﯿﺮات اﻟﻄﻔﯿﻔﮫ ﻓﻘﻂ وھﻰ ﻛﺎﻟﺘﺎﻟﻰ: ﻣﻦ ﺧﻼل ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت ﻧﻘﻮم ﺑﺘﺤﻮﯾﻞ ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت اﻟﻰ اﺻﺪار ﺳﺎﺑﻖ ﻣﻦ ﺧﻼل ﻗﺎﺋﻤﮫ To access97file format>Convert database >database utilities>Tools ﻛﻤﺎ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ:
وﻣﻦ ﺧﻼل اﻟﻔﯿﺠﻮال ﺑﯿﺴﻚ وﻣﻜﺘﺒﮫ …ADO ﻧﻘﻮم ﺑﺘﻐﯿﯿﺮ ﺟﻤﻠﮫ ﺗﻌﺮﯾﻒ ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت او ﻣﺰود اﻟﺨﺪﻣﮫ ﻣﻦ ﺧﻼل PROVIDER ﻧﻜﺘﺐ اﻟﺠﻤﻠﮫ اﻻﺗﯿﮫ: Microsoft Jet 3.51 OLE DB Provider وﻧﻜﻤﻞ ﺑﺎﻗﻰ اﻟﺨﻄﻮات ﻛﻤﺎ اﻟﺤﺎل ﻣﻊ اﺻﺪار2000 ﻣﻠﺤﻮﻇﮫ: ﻟﻘﺪ ﻗﻤﺖ ﺑﺬﻛﺮ ﻛﯿﻔﯿﮫ رﺑﻂ اﻟﻤﻜﺘﺒﮫ ﺑﻘﺎﻋﺪه ﺑﯿﺎﻧﺎت 97ﻓﻘﻂ ﻻﺛﺒﺎت ان ھﺬه اﻟﻤﻜﺘﺒﮫ ﻗﺎدر ﻋﻠﻰ اﻟﺘﻌﺎﻣﻞ ﻣﻊ ﻛﻞ ﻗﻮاﻋﺪ اﻟﺒﯿﺎﻧﺎت وﺑﻜﺎﻓﮫ اﻻﺻﺪارات.
18 PDF created with pdfFactory trial version www.pdffactory.com
اﺳﺘﺨﺪاﻣﺎت ﻣﺘﻄﻮره ﻟﻤﻜﺘﺒﮫ ADO ﺗﻤﻜﻨﻚ ﻣﻜﺘﺒﮫ ADOﻣﻦ ﻋﻤﻞ اﻟﻌﺪﯾﺪ ﻣﻦ اﻟﺘﻄﺒﯿﻘﺎت اﻟﻤﻤﯿﺰه وذﻟﻚ ﻻﺣﺘﻮاﺋﮭﺎ ﻋﻠﻰ ﻣﻠﺤﻘﺎت ﻣﻦ اھﻢ ھﺬه اﻟﻤﻠﺤﻘﺎت ھﻰ : >>)<<Microsoft Data Grid Control 6.0(OLEDB
وھﺬه اﻟﻤﻜﺘﺒﮫ اﻟﻤﻠﺤﻘﮫ ﺗﻤﻜﻨﻚ ﻣﻦ ﻋﺮض اﻟﺒﯿﺎﻧﺎت ﻛﻠﮭﺎ او ﺟﺰء ﻣﻨﮭﺎ وذﻟﻚ ﻋﻦ ﻃﺮﯾﻖ رﺑﻄﮭﺎ ﺑﺎﻟﻤﻜﺘﺒﮫ ﻛﻤﺎﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ:
19 PDF created with pdfFactory trial version www.pdffactory.com
:وﻋﻨﺪ اﻟﺘﺸﻐﯿﻞ ﺗﺠﺪ ﻃﺮﯾﻘﮫ ﻋﺮض اﻟﺒﯿﺎﻧﺎت ھﻜﺬا
20 PDF created with pdfFactory trial version www.pdffactory.com
* واﯾﻀﺎ ﯾﻤﻜﻨﻚ اﻟﺘﻌﺪﯾﻞ ﻓﻰ ﺧﺼﺎﺋﺼﮭﺎ ﻣﻦ ﺧﻼل ﻗﺎﺋﻤﮫ اﻟﺨﺼﺎﺋﺺ ﻣﻦ ﺧﻼل اﻻﻣﺮ CUSTOME ﻛﻤﺎ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ:
وذﻟﻚ ﺑﺘﻐﯿﯿﺮ اﻟﺨﺼﺎﺋﺺ ﻣﺜﻞ ﻋﺪد اﻟﺼﻔﻮف وﻋﺪد اﻻﻋﻤﺪه وﯾﻤﻜﻨﻚ اﯾﻀﺎ ﺗﻐﯿﯿﺮ ﺧﺼﺎﺋﺺ اﻻﺗﺼﺎل ﺑﻘﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت ﻓﯿﻤﻜﻨﻚ ﺗﻐﯿﯿﺮ ﻧﻮع اﻟﺠﺪول اﻟﻤﺮﺗﺒﻄﮫ ﺑﮫ ﻣﻜﺘﺒﮫ ADOواﻟﻌﺮض ﻟﺠﺪول اﺧﺮ وﻣﻦ اﻟﻤﻤﯿﺰات اﻟﮭﺎﻣﮫ ﻟﻤﻜﺘﺒﮫMicrosoft Data Grid Control 6.0(OLEDB اﻧﮭﺎ ﯾﻤﻜﻨﮭﺎ اﻟﺘﻌﺎﻣﻞ ﻣﻊ اﻟﺒﯿﺎﻧﺎت ﺣﯿﺚ ﯾﻤﻜﻨﻚ اﺿﺎﻓﮫ ﺑﯿﺎﻧﺎت ﻣﻦ ﺧﻼﻟﮭﺎ او ﺣﺬف ﺑﯿﺎن ﻣﻌﯿﻦ او اﺟﺮاء ﺗﻌﺪﯾﻞ
21 PDF created with pdfFactory trial version www.pdffactory.com
ﺑﺎﻻﺿﺎﻓﮫ اﻟﻰ ﺗﺤﻮﯾﻞ ﻧﻮﻋﯿﮫ ﺑﻌﺾ اﻟﺒﯿﺎﻧﺎت اﻟﻰ ﻧﻮﻋﯿﮫ اﺧﺮى ﻣﻦ ﺧﻼل FORMAT واﯾﻀﺎ ﺗﻤﻜﻨﻚ ﻣﻦ اﺧﺘﯿﺎر اﻟﺨﻄﻮط وﻃﺮﯾﻘﮫ اﻟﻌﺮض. واﯾﻀﺎ اﻟﺘﻐﯿﯿﺮ ﻓﻰ اﻟﺸﻜﻞ اﻟﺨﺎرﺟﻰ ﻟﮭﺎ وﺗﻐﯿﯿﺮ اﻻﻟﻮان واﺧﺘﯿﺎرات ﻛﺜﯿﺮه اﺧﺮى... وﻣﻦ اﻟﺠﺪﯾﺮ ﺑﺎﻟﺬﻛﺮ ان ﻣﻜﺘﺒﮫ) Microsoft Data Grid Control 6.0(OLEDBﺗﻤﻜﻨﻚ ﻣﻦ اﻟﺘﻌﺎﻣﻞ ﻣﻊ اى ﻗﺎﻋﺪه ﺑﯿﺎﻧﺎت و اﻟﺘﺤﻜﻢ ﻓﻰ ﺧﺼﺎﺋﺼﮭﺎ ﻣﻦ اﺿﺎﻓﮫ ﻟﺒﯿﺎن وﺣﺬف و ﺗﻌﺪﯾﻞ وﺣﻔﻆ. اى اﻧﮭﺎ ﻟﯿﺴﺖ ﻗﺎﺻﺮه ﻋﻠﻰ اﻟﺘﻌﺪﯾﻞ ﻓﻰ ﻗﻮاﻋﺪ ﺑﯿﺎﻧﺎت ﻧﻮع ACCESSﻓﻘﻂ ... ...واﯾﻀﺎ ﻣﻦ اﻟﻤﻠﺤﻘﺎت اﻟﮭﺎﻣﮫ ﺟﺪا ﻣﻊ ﻣﻜﺘﺒﮫ ADO >>)<<Microsoft hieratical flex grid Control 6.0(OLEDB وھﻰ ﻣﻜﺘﺒﮫ اﻟﺘﺮﺗﯿﺐ اﻟﺘﺴﻠﺴﻠﻰ ﻟﻠﺒﯿﺎﻧﺎت وھﻰ ﻣﻜﺘﺒﮫ ﻣﻔﯿﺪه ﺟﺪا ﻓﻰ ﺣﺎﻟﮫ اﻟﺘﻌﺎﻣﻞ ﻣﻊ ﻗﻮاﻋﺪ اﻟﺒﯿﺎﻧﺎت اﻟﻀﺨﻤﮫ ﻓﮭﻰ ﺗﻤﻜﻨﻚ ﻣﻦ ﻓﺮز وﺗﺮﺗﯿﺐ اﻟﺒﯿﺎﻧﺎت ﺑﻄﺮﯾﻘﮫ ﯾﺪوﯾﮫ اى ﻛﻤﺎ ﺗﺮﯾﺪ ﺷﻜﻞ ﻇﮭﻮر اﻟﺒﯿﺎﻧﺎت . ﺗﻤﻜﻨﻚ ﻓﻰ اﻟﺘﺤﻜﻢ ﻓﻰ ﺗﺮﺗﯿﺐ اﻻﻋﻤﺪه ﺣﺴﺐ اﻟﺤﺎﺟﮫ او اﻻھﻤﯿﮫ. واﯾﻀﺎ ﺗﻤﻜﻨﻚ ﻓﻰ اﻟﺘﺤﻜﻢ ﻓﻰ ﺷﻜﻞ اﻟﺼﻔﻮف واﻻﻋﻤﺪه ﺳﻮﯾﺎ. وﺧﺼﺎﺋﺺ اﺧﺮى ﻛﺜﯿﺮه ﺣﯿﺚ اﻟﺘﺤﻜﻢ ﻓﻰ اﻟﺸﻜﻞ اﻟﺨﺎرﺟﻰ وﻋﺪد اﻟﺼﻔﻮف و اﻟﺤﻘﻮل واﻻﻟﻮان و اﻟﺨﻠﻔﯿﺎت و اﻟﺨﻄﻮط ... وﯾﻤﻜﻦ اﯾﺠﺎدھﺎ ﻣﻦ ﻗﺎﺋﻤﮫComponent
22 PDF created with pdfFactory trial version www.pdffactory.com
:ﻛﻤﺎ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ
Microsoft hieratical flex grid Control 6.0(OLEDB)واﺳﺘﺪﻋﺎﺋﮭﺎ ﻣﻦ ﺧﻼل :ﻛﻤﺎ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ
23 PDF created with pdfFactory trial version www.pdffactory.com
وﺑﻌﺪ اﺿﺎﻓﺘﮭﺎ ﻟﻠﻔﻮرم ﯾﻤﻜﻦ رﺑﻄﮭﺎ ﺑﻤﻜﺘﺒﮫ ADOﻛﻤﺎ اﻟﺤﺎل ﻓﻰ ﻣﻜﺘﺒﮫ DATA GRID ﻣﻦ ﺧﻼل ﺧﺎﺻﯿﮫDATA SOURCE
ﺑﻌﺪ ان ﻗﻤﻨﺎ ﺑﺮﺑﻂ اﻟﻤﻜﺘﺒﮫ ﯾﻤﻜﻨﻨﺎ اﻻن ﻋﺮض اﻟﺒﯿﺎﻧﺎت ھﻜﺬا:
24 PDF created with pdfFactory trial version www.pdffactory.com
ﻣﻦ اﻟﻤﻤﯿﺰات اﻟﮭﺎﻣﮫ ﻟﻤﻜﺘﺒﮫ)Microsoft hieratical flex grid Control 6.0(OLEDB اﻧﻚ ﻣﻦ ﺧﻼﻟﮭﺎ ﯾﻤﻜﻨﻚ اﻟﺘﺤﻜﻢ ﻓﻰ ﻋﺪد اﻟﺼﻔﻮف واﻻﻋﻤﺪه اﻟﻤﺴﺘﺨﺪﻣﮫ ﻓﻰ ﻋﺮض اﻟﺒﯿﺎﻧﺎت ﻛﻤﺎ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ ﻣﻦ ﺧﻼل اﻻﻣﺮ:Custom
وﺗﻤﻜﻨﻚ اﯾﻀﺎ ﻣﻦ اﺧﺘﯿﺎر ﻋﺪه ﺣﻘﻮل وﺻﻔﻮف ﻓﻰ ان واﺣﺪ وﯾﻤﻜﻨﻚ اﻟﺘﺤﻘﻖ ﻣﻦ اﻻواﻣﺮ ﻛﻤﺎ ﻓﻰ ﺷﺎﺷﮫ اﻟﺨﺼﺎﺋﺺ ﻣﻦ ﺧﻼل اﻟﺠﺪول اﻟﺘﺎﻟﻰ: اﻟﺨﺎﺻﯿﻪ اﻻﻣﺮ اﻟﺘﺒﻮﻳﺐ اﻟﺘﺤﺮك ﻓﻰ اﺗﺠﺎھﯿﻦ – اﻟﺘﺤﺮك ﻓﻰ GENERALاﻟﺘﺤﺮك داﺧﻞ ﺣﯿﺰ اﻟﻤﻜﺘﺒﮫ اﺗﺠﺎه واﺣﺪ – ﻋﺪم اﻟﺘﺤﺮك ﺑﺎﺳﺘﺨﺪام اﻟﻔﺄره. داﺋﻤﺎ – ﻋﻨﺪ اﻟﻄﻠﺐ – ﻋﺪم اﻻﻇﮭﺎر اﺑﺮاز اﻟﺒﯿﺎﻧﺎت اﻟﻤﺤﺪده ﻻﺗﻮﺟﺪ – ﺧﻔﯿﻔﮫ -ﻣﺮﻛﺰه درﺟﮫ دﻗﮫ اﻟﺘﻌﺎﻣﻞ ﻣﻊ اﻟﺒﯿﺎﻧﺎت اﻓﻘﻰ – رأﺳﻰ ﻃﺮﯾﻘﮫ اﻟﻌﺮض اﻓﺘﺮاﺿﻰ – او ﺳﮭﻢ – او اﯾﻘﻮﻧﮫ...... ﻃﺮﯾﻘﮫ ﻋﺮض ﻣﺆﺷﺮ اﻟﻔﺄره ﻓﺮدﯾﮫ – او ﻣﺘﻜﺮره)ﻣﺰدوﺟﮫ( ﻃﺮﯾﻘﮫ ﻣﻞء اﻟﺤﻘﻮل اﻓﺘﺮاﺿﯿﮫ – ﺑﺎﻟﺼﻒ -ﺑﺎﻟﻌﻤﻮد ﻃﺮﯾﻘﮫ اﻻﺧﺘﯿﺎر اﺑﺪا – اﻻﻋﻤﺪه – اﻟﺼﻔﻮف -ﻛﻼھﻤﺎ اﻟﺴﻤﺎح ﺑﺎﻋﺎده ﺿﺒﻂ اﻟﺤﺠﻢ اﺧﺘﯿﺎرى ﻋﺪد اﻟﺼﻔﻮف اﺧﺘﯿﺎرى ﻋﺪد اﻻﻋﻤﺪه اﺧﺘﯿﺎرى اﻟﺴﻤﺎح ﺑﻮﺟﻮد ﺻﻔﻮف ﺛﺎﺑﺘﮫ اﺧﺘﯿﺎرى اﻟﺴﻤﺎح ﺑﻮﺟﻮد اﻋﻤﺪه ﺛﺎﺑﺘﮫ
COMMAND Scrollbars Highlight FocusRect Band Display Mouse Pointer Fill style Selection Mode Allow User Resizing Rows Columns Fixed Rows Fixed Cols
25 PDF created with pdfFactory trial version www.pdffactory.com
واﯾﻀﺎ ﻣﻦ ﺧﻼل اﻻﻣﺮ BANDSﯾﻤﻜﻨﻚ اﻟﺘﺤﻜﻢ ﺑﺪﻗﮫ ﺷﺪﯾﺪه ﻓﻰ اﻟﺼﻔﻮف واﻻﻋﻤﺪه واﺟﺮاء ﺑﻌﺾ اﻻواﻣﺮ اﻟﮭﺎﻣﮫ ﻛﻤﺎ ﻓﻰ اﻟﺠﺪول اﻟﺘﺎﻟﻰ: ﺍﻟﺘﺒﻭﻴﺏ
اﻻﻣﺮ
اﻟﺨﺎﺻﯿﮫ
BANDS
ﻤﺠﻤﻭﻋﻪ ﺼﻔﻭﻑ ﻤﻊ ﺍﻋﻤﺩﻩ ﻤﺨﺘﺎﺭﻩ ﻷﻤﺭ. ﺨﻁﻭﻁ ﺍﻟﺘﺸﺎﺒﻙ)ﺍﻟﺸﺒﻜﻪ(
ﺍﺨﺘﻴﺎﺭﻯ
COMMAND Bands
ﺒﺩﻭﻥ -ﻤﺴﻁﺢ – ﺍﺩﺨﺎل-ﺭﻓﻊ- ﺍﺩﺨﺎل ﺒﻌﺩ ﺍﻟﺭﻓﻊ ﺒﺩﻭﻥ -ﻤﺴﻁﺢ – ﺍﺩﺨﺎل-ﺭﻓﻊ- ﺍﺩﺨﺎل ﺒﻌﺩ ﺍﻟﺭﻓﻊ ﺒﺩﻭﻥ -ﻤﺴﻁﺢ – ﺍﺩﺨﺎل-ﺭﻓﻊ- ﺍﺩﺨﺎل ﺒﻌﺩ ﺍﻟﺭﻓﻊ ﺍﺨﺘﻴﺎﺭﻯ
Gridlines
ﺸﻜل ﺍﻟﺨﻁ ﺸﻜل ﺍﻟﺨﻁ ﺍﻻﻤﺎﻤﻰ ﺍﻟﻤﺠﻤﻭﻋﺎﺕ ﺍﻟﻤﺤﺩﺩﻩ
Text Style Text Style Header Band Indent
26 PDF created with pdfFactory trial version www.pdffactory.com
واﯾﻀﺎ ﻣﻦ ﺧﻼل اﻟﺘﺒﻮﯾﺐ STYLEﯾﻤﻜﻨﻨﺎ اﻟﺘﺤﻜﻢ ﻓﻰ ﺧﺼﺎﺋﺺ اﻟﻤﻜﺘﺒﮫ او اﺧﺘﯿﺎر اﺳﻠﻮب اﻟﺘﻌﺎﻣﻞ ﻛﻤﺎ ﻓﻰ اﻟﺠﺪول اﻟﺘﺎﻟﻰ: اﻟﺘﺒﻮﻳﺐ
اﻻﻣﺮ
اﻟﺨﺎﺻﯿﻪ
COMMAND
STYLE
ﺧﻄﻮط اﻟﺘﺸﺎﺑﻚ اﻟﺜﺎﺑﺘﮫ
ﺒﺩﻭﻥ -ﻤﺴﻁﺢ – ﺍﺩﺨﺎل-ﺭﻓﻊ -ﺍﺩﺨﺎل ﺒﻌﺩ ﺍﻟﺭﻓﻊ ﺒﺩﻭﻥ -ﻤﺴﻁﺢ – ﺍﺩﺨﺎل-ﺭﻓﻊ -ﺍﺩﺨﺎل ﺒﻌﺩ ﺍﻟﺭﻓﻊ اﺑﺪا -ﺣﺮ -ﺗﻘﯿﯿﺪ اﻟﺼﻔﻮف -ﺗﻘﯿﯿﺪ اﻻﻋﻤﺪه -ﺗﻘﯿﯿﺪ ﻛﻼھﻤﺎ ﺒﺩﻭﻥ -ﻤﺴﻁﺢ – ﺍﺩﺨﺎل-ﺭﻓﻊ -ﺍﺩﺨﺎل ﺒﻌﺩ ﺍﻟﺭﻓﻊ ﻣﻠﻮﻧﮫ – اﺣﺎدﯾﮫ اﻟﻠﻮن اﺧﺘﯿﺎرى
Grid lines Fixed
ﺷﻜﻞ اﻟﺨﻄﻮط اﻟﺜﺎﺑﺘﮫ ﻣﺰج اﻟﺨﻼﯾﺎ ﺧﻄﻮط اﻟﺘﺸﺎﺑﻚ اﻟﻐﯿﺮ ﻣﻘﺒﻮﻟﮫ )ااﻟﻐﯿﺮ ﻣﺴﺘﺨﺪﻣﮫ( ﻧﻮع اﻟﺼﻮره ﺗﻀﻤﯿﻦ اﻟﻜﻠﻤﺎت
Text Style Fixed Merge Cells GridLinsUnpopulated Picture Type Word Warp
27 PDF created with pdfFactory trial version www.pdffactory.com
اﻻن ﻗﺪ ﻗﻤﻨﺎ ﺑﻌﺮض ﻣﻔﺼﻞ ﻟﻼدوات اﻟﮭﺎﻣﮫ واﻟﻤﺆﺛﺮه ﻓﻰ ﺧﺼﺎﺋﺺ ﻣﻜﺘﺒﮫ >>)<<Microsoft hieratical flex grid Control 6.0(OLEDB ﻻ ﯾﻨﻘﺺ ﺳﻮى ﺑﻌﺾ اﻟﺨﺼﺎﺋﺺ اﻟﺨﺎﺻﮫ ﺑﺎﻧﻮاع اﻟﺨﻄﻮط و اﻟﺨﻠﻔﯿﺎت واﻟﺼﻮر واﻻﻟﻮان.
ﺗﻔﯿﺪ ﻣﻜﺘﺒﺎت)ADO (OLEDBاﻟﺮﻓﺮﻋﯿﮫ: )Microsoft DB GRID 6.0(OLEDB )Microsoft DB LIST GRID 6.0(OLEDB )Microsoft hieratical flex grid Control 6.0(OLEDB ﻓﻰ اﻟﺘﻌﺎﻣﻞ ﻣﻊ : )(FLAT FILE و ھﻰ اﻟﺒﯿﺎﻧﺎت اﻟﻨﺼﯿﮫ اﻟﺒﺴﯿﻄﮫ واﻟﺘﻰ ﻻ ﺗﺤﺘﻮى ﻋﻠﻰ اى ھﯿﻜﻞ ﺗﻨﻈﯿﻤﻰ. وھﻰ اﯾﻀﺎ اﻟﺒﯿﺎﻧﺎت اﻟﻤﺮاد ﺗﻨﻘﯿﺘﮭﺎ واﻋﺎده ﺻﯿﺎﻏﺘﮭﺎ ﺑﺎى ﻧﻈﺎم ﻣﺴﺘﺨﺪم ﻟﻘﻮاﻋﺪ اﻟﺒﯿﺎﻧﺎت ﻣﺜﻞ: ACCESS.
SQL,
ORACLE,
ﺗﻔﯿﺪ ﻛﻼ ﻣﻦ ﻣﻜﺘﺒﺎت ADOاﻟﻔﺮﻋﯿﮫ )اﻟﻤﻠﺤﻘﺎت( ﻓﻰ ﻋﻤﻠﯿﺎت ھﺎﻣﮫ ﺟﺪا ﺑﺎﻟﻨﺴﺒﮫ اﻟﻰ اﻟﻤﺒﺮﻣﺠﯿﻦ او ﻣﻦ ﯾﻘﻮﻣﻮن ﺑﻌﻤﻠﯿﮫ اﻟﺘﻨﻘﯿﮫ ﻟﻘﻮاﻋﺪ اﻟﺒﯿﺎﻧﺎت اﻟﻤﻨﺸﺄه ﻣﺴﺒﻘﺎ وذﻟﻚ ﻓﻰ اﻟﺘﺤﻜﻢ ﻓﻰ ﺣﺠﻢ اﻟﺒﯿﺎﻧﺎت وذﻟﻚ ﻣﻦ ﺧﻼل ﻋﻤﻠﯿﮫ :
>><<NORMALIZATION
وھﻰ ﻋﻤﻠﯿﮫ اﻋﺎده ﺻﯿﺎﻏﮫ اﻟﺒﯿﺎﻧﺎت ﺑﺎﻟﺸﻜﻞ اﻟﺼﺤﯿﺢ ﻟﺘﺘﻄﺎﺑﻖ اﻟﻈﺮوف اﻟﻤﻼﺋﻤﮫ وﻗﺖ اﺳﺘﺨﺪام ھﺬه اﻟﺒﯿﺎﻧﺎت. واﯾﻀﺎ ﺗﺠﻨﺐ اﻟﻤﻠﻔﺎت ﻏﯿﺮ اﻟﻤﻄﺎﺑﻘﮫ واﻟﺨﺎﻃﺌﮫ. 28 PDF created with pdfFactory trial version www.pdffactory.com
ﺗﻘﻠﯿﻞ ﻣﺴﺎﺣﮫ ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت وذﻟﻚ ﺑﻌﻤﻞ ﺗﻨﻘﯿﮫ ﻟﻠﺒﯿﺎﻧﺎت ﻣﻦ اﻟﺤﻘﻮل واﻟﺼﻔﻮف اﻟﻔﺎرﻏﮫ واﻟﻤﮭﻤﻠﮫ واﯾﻀﺎ ﺗﻮﻓﯿﺮ اﻟﻮﻗﺖ واﻟﺠﮭﺪ ﻓﻰ ﻋﻤﻠﯿﮫ اﻟﺒﺤﺚ ﻋﻦ اﻟﺒﯿﺎﻧﺎت .
ﻛﻤﺎ ذﻛﺮﻧﺎ ﻣﺴﺒﻘﺎ ان ﻣﻜﺘﺒﮫ ADOﺗﺤﺘﻮى ﻋﻠﻰ اﻟﻌﺪﯾﺪي ﻣﻦ اﻟﺨﺼﺎﺋﺺ واﻻﺳﺘﺨﺪاﻣﺎت اﻟﻤﺘﻄﻮره وذﻟﻚ ﻟﺘﺴﮭﯿﻞ ﻋﻤﻠﯿﮫ اﻟﺘﻌﺎﻣﻞ ﻣﻊ اﻟﺒﯿﺎﻧﺎت ﻓﻌﻨﺪﻣﺎ ذﻛﺮت ﻋﻨﻮان ھﺬا اﻟﻔﺼﻞ وھﻮ " اﺳﺘﺨﺪاﻣﺎت ﻣﺘﻄﻮره ﻟﻤﻜﺘﺒﮫ"ADO ﻟﻢ اﻗﺼﺪ اﻟﺘﻌﺎﻣﻞ ﻣﻊ اﻣﺜﻠﮫ ﻣﺘﻄﻮره ،واﻧﻤﺎ اردت ﻓﻘﻂ ذﻛﺮ ﺧﺼﺎﺋﺺ واﻣﻜﺎﻧﺎت ھﺬه اﻟﻤﻜﺘﺒﮫ واﻟﻤﻜﺘﺒﺎت اﻟﻤﻠﺤﻘﮫ ﺑﮭﺎ ﺑﻘﺪر اﻟﻤﺴﺘﻄﺎع ﺣﺘﻰ ﯾﺘﺜﻨﻰ ﻟﻠﻤﺘﻌﺎﻣﻞ ﺑﮭﺎ ﺑﻌﺪ ذﻟﻚ اﻣﻜﺎﻧﯿﮫ اﺣﺘﻮاء اى ﺗﻄﺒﯿﻖ ﺑﺴﮭﻮﻟﮫ اﻧﺸﺎء اﷲ.
اﺳﺘﺨﺪام ﺟﻤﻞ اﻻﺳﺘﻌﻼمSQLﻓﻰ اﻟﺮﺑﻂ ﺑﻘﻮاﻋﺪ اﻟﺒﯿﺎﻧﺎت ﻟﻘﺪ ذﻛﺮﻧﺎ ﻣﺴﺒﻘﺎ اﻣﻜﺎﻧﯿﮫ ﻣﻜﺘﺒﮫ ADOﻓﻰ اﺳﺘﺪﻋﺎء ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت ﺑﻌﺪه ﻃﺮق... ﻣﻦ اھﻤﮭﺎ: ﻃﺮﯾﻘﮫ اﻻﺳﺘﺪﻋﺎء ﺑﺎﺧﺘﯿﺎر اﻟﺠﺪول * ﻃﺮﯾﻘﮫ اﻻﺳﺘﺪﻋﺎء ﺑﺎﺳﺘﺨﺪام ﺟﻤﻞSQL وھﺬه اﻟﻄﺮﯾﻘﮫ ﻣﻔﯿﺪه ﻓﻰ ﺣﺎﻟﮫ اﻟﺒﯿﺎﻧﺎت اﻟﻀﺨﻤﮫ ،واﻟﻤﺮاد اﻟﺘﻌﺎﻣﻞ ﻣﻊ ﺟﺰء ﻓﻘﻂ ﻣﻦ ﺑﯿﺎﻧﺎﺗﮭﺎ 29 PDF created with pdfFactory trial version www.pdffactory.com
ﻓﮭﻰ ﺗﻮﻓﺮ اﻟﻮﻗﺖ واﻟﺠﮭﺪ ﻓﻰ ﻃﺮﯾﻘﮫ اﻻﺳﺘﺪﻋﺎء ﻟﻠﺠﺰء اﻟﻤﻄﻠﻮب ﻓﻘﻂ داﺧﻞ اﻟﺠﺪول. ﻣﺜﺎل: ﻗﺎﻋﺪه ﺑﯿﺎﻧﺎت ﺑﺎﺳﻢ” “NWINDﻧﺮﯾﺪ اﯾﺠﺎد ﻣﻨﮭﺎ ﺟﺪول ﺑﺎﺳﻢ" "CUSTOMERS واﯾﻀﺎ اﯾﺠﺎد اﺳﻢ اﻟﻌﻤﯿﻞ ” “maria andersﻣﻦ ﺧﻼل اﻟﺤﻘﻞContact name
اﻻن ﺑﻌﺪ ان ذﻛﺮﻧﺎ ﻣﺴﺒﻘﺎ ﺧﻄﻮات اﻟﺘﻮﺻﯿﻞ ﺑﻘﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت وﻣﻦ ﺧﻼل اﻟﺤﺪث AdCmdTxetوذﻟﻚ ﻣﻦ اﻟﺘﺒﻮﯾﺐ .Command Type ﻧﻜﺘﺐ ﺟﻤﻠﮫ اﻻﺳﺘﻌﻼم اﻻﺗﯿﮫ ﻛﻤﺎ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ:
30 PDF created with pdfFactory trial version www.pdffactory.com
;’SELECT * FROM customers WHERE contact name = ‘maria anders ﺷﺮح اﻟﺠﻤﻠﮫ: اﺧﺎﻃﺐ اﻻن ﻣﻜﺘﺒﮫ ADOواﻗﻮل ﻟﮭﺎ اﺧﺘﺎرى ﻛﻞ اﻟﺤﻘﻮل ﻣﻦ اﻟﺠﺪولcustomersوﻟﻜﻦ ﺑﺸﺮط ان ﯾﻜﻮنmaria anders = contact name ﺣﯿﺚ: = SELECT
اﺧﺘﺎر
* =
ﻛﻞ اﻟﺤﻘﻮل
= FROM
ﻣﻦ اﻟﺠﺪول
=Customers =WHERE =Contact name ==maria anders
اﺳﻢ اﻟﺠﺪول ﻋﻨﺪﻣﺎ ﺣﻘﻞ داﺧﻞ اﻟﺠﺪول"ﺑﻤﻌﻨﻰ اﺳﻢ اﻟﻌﻤﯿﻞ" اىﯾﺴﺎوى او ﯾﻄﺎﺑﻖ ھﺬا اﻟﻨﺺ "او ھﺬا اﻻﺳﻢ"
وھﺬه اﻟﺠﻤﻠﮫ ﯾﻤﻜﻨﻚ ﻣﻦ ﺧﻼﻟﮭﺎ اﺧﺘﯿﺎر اى ﺟﺪول ﻣﻦ ﺧﻼل ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت اﻟﺘﻰ ﺗﺘﻌﺎﻣﻞ ﻣﻌﮭﺎ او اى 31 PDF created with pdfFactory trial version www.pdffactory.com
ﺑﯿﺎن داﺧﻞ اى ﺟﺪول . ﺣﯿﺚ ﺗﻮﻓﯿﺮ اﻟﻮﻗﺖ واﻟﺠﮭﺪ ﻓﻰ اﻻﺳﺘﺪﻋﺎء. ﻣﻠﺤﻮﻇﮫ: ﯾﺮﺟﻰ اﻟﺘﺄﻛﺪ ﻋﻨﺪ ﻛﺘﺎﺑﮫ ﺟﻤﻞ SQLﺑﻮﺿﻊ اﻟﻤﺘﻐﯿﺮات داﺧﻞ ﻋﻼﻣﮫ اﻟﺘﻨﺼﯿﺺ ‘ واﯾﻀﺎ ﻧﮭﺎﯾﮫ اى ﺟﻤﻠﮫ اﺳﺘﻌﻼم ﺑﻌﻼﻣﮫ
;
ﺑﻌﺪ ان ﻗﻤﻨﺎ ﺑﻜﺘﺎﺑﮫ اﻟﺠﻤﻠﮫ ﻧﻘﻮم اﻻن ﺑﺎﺳﺘﺪﻋﺎء ﻣﻜﺘﺒﮫ ﻋﺮض اﻟﺒﯿﺎﻧﺎت اﻟﻤﻠﺤﻘﮫ ﺑﻤﻜﺘﺒﮫ ADO >>)<<Microsoft DB GRID 6.0(OLEDB ﻣﻦ ﻗﺎﺋﻤﮫ componentﺛﻢ رﺑﻄﮭﺎ ﺑﻤﻜﺘﺒﮫ ADOﻛﻤﺎ اﺳﻠﻔﻨﺎ ﺑﺎﻟﺬﻛﺮ وﺳﻮف ﻧﺼﻞ اﻟﻰ اﻟﻨﺘﯿﺠﮫ اﻟﺘﺎﻟﯿﮫ ﺑﺎذن اﷲ:
32 PDF created with pdfFactory trial version www.pdffactory.com
ﻧﺮى اﻻن ﻟﻘﺪ ﺗﻢ ﻋﺮض اﻻﺳﻢ اﻟﺬى ﻗﻤﻨﺎ ﺑﺎﻻﺳﺘﻌﻼم ﻋﻨﮫ ﻓﻘﻂ واﻟﺒﯿﺎﻧﺎت اﻟﻤﻠﺤﻘﮫ ﺑﮫ.
وھﻨﺎك اﻟﻌﺪﯾﺪ ﻣﻦ ﻃﺮق اﻻﺳﺘﻌﻼم ﺑﺎﺳﺘﺨﺪام SQLﺳﻮف ﻧﻮاﻟﻰ ﺷﺮﺣﮭﺎ ﻣﺴﺘﻘﺒﻼ اﻧﺸﺎء اﷲ اﻻن ﻗﺪ ﻗﻤﻨﺎ ﺑﻔﻀﻞ اﷲ ﻋﺮض ﻣﻌﻈﻢ اﻟﺨﺼﺎﺋﺺ اﻟﮭﺎﻣﮫ ﻟﻤﻜﺘﺒﮫ ).ADO(OLEDB
اﺳﺘﺨﺪاﻣﺎت ﻣﻜﺘﺒﮫ) ADO.(OLEDBﻓﻰ اﻟﺘﻌﺎﻣﻞ ﻣﻊ اﻟﺒﯿﺎﻧﺎت 33 PDF created with pdfFactory trial version www.pdffactory.com
ﺳﻮف ﻧﺸﺮح اﻻن ﺑﺎذن اﷲ ﻛﯿﻔﯿﮫ ﺗﻌﺎﻣﻞ ﻣﻜﺘﺒﮫADOﻣﻊ ﻗﺎﻋﺪه ﺑﯿﺎﻧﺎت ﻧﻮع ACCESS وذﻟﻚ ﺑﺎﺟﺮاء اﻟﻌﻤﻠﯿﺎت اﻻﺗﯿﮫ:
NO. 1 2 3
Description ﻋﻤﻠﯿﮫ ﻋﺮض ﻟﻠﺒﯿﺎﻧﺎت وھﻰ ﻋﻤﻠﯿﮫ اﺿﺎﻓﮫ ﺳﺠﻞ ﺟﺪﯾﺪ ﺣﻔﻆ ﻟﻠﺴﺠﻞ اﻟﺠﺪﯾﺪ او اﻟﻤﻌﺪل
Operation ”Showing data”Form1.load Add new Save
4
ﺣﺬف ﻟﺴﺠﻞ ﻣﻮﺟﻮد
Delete
5 6
اﻟﺘﺤﺮك ﻟﻼﻣﺎم "ﻻﯾﺠﺎد اﻟﺴﺠﻞ اﻟﺘﺎﻟﻰ" اﻟﺘﺤﺮك ﻟﻠﺨﻠﻒ "ﻻﯾﺠﺎد اﻟﺴﺠﻞ اﻟﺴﺎﺑﻖ"
Move next Move previous
ﻧﻘﻮم ﺑﻌﻤﻞ ﻗﺎﻋﺪه ﺑﯿﺎﻧﺎت ﻣﺜﻼ ﺑﺎﺳﻢ data.mdb ﺛﻢ ﻧﻘﻮم ﺑﺎﻧﺸﺎء ﺟﺪول ﺑﺎﺳﻢ persons data وﯾﺤﺘﻮى ﻋﻠﻰ اﻟﺒﯿﺎﻧﺎت اﻟﺘﺎﻟﯿﮫ: DATA TYPE text text text
FIELD NAME name phone address
ﺑﻌﺪ ذﻟﻚ ﻧﻘﻮم ﺑﺎدﺧﺎل ﺑﻌﺾ اﻟﺒﯿﺎﻧﺎت ﻓﻰ ھﺬه اﻟﺴﺠﻼت
34 PDF created with pdfFactory trial version www.pdffactory.com
ﺛﻢ ﻧﺒﺪأ ﺑﺎﻟﺘﻌﺎﻣﻞ ﺗﺤﺖ ﺑﯿﺌﮫ visual basic ﺛﻢ ﻧﻘﻮم ﺑﺎﻧﺸﺎء ﻣﺸﺮوع ﻗﯿﺎﺳﻰ ﺟﺪﯾﺪ ورﺑﻂ ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت ﻛﻤﺎ اﺳﻠﻔﻨﺎ ﺑﺎﻟﺬﻛﺮ ﻣﺴﺒﻘﺎ ﺛﻢ ﻧﻘﻮم ﺑﻌﻤﻞ FORMﺣﺘﻰ ﻧﺼﻞ اﻟﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ:
واﻟﻤﻜﻮﻧﺎت ھﻰ: Tool label Text Box Command Button )ADO.(OLEDB
Count. 3 3 5 1
35 PDF created with pdfFactory trial version www.pdffactory.com
ﺛﻢ ﻧﻘﻮم ﺑﺮﺑﻂ ﻛﻞ textboxﺑﻤﺎ ﯾﻤﺎﺛﻠﮭﺎ ﻓﻰ اﻟﺠﺪول persons data اﻟﻰ ان ﻧﺼﻞ ﺑﻌﺪ ذﻟﻚ اﻟﻰ اﻟﻨﺘﯿﺠﮫ اﻟﺘﺎﻟﯿﮫ:
ﻧﺤﻦ اﻻن ﻗﺪ ﻗﻤﻨﺎ ﺑﺘﻨﻔﯿﺬ اول ﻋﻤﻠﯿﮫ وھﻰ ﻋﻤﻠﯿﮫ ﻋﺮض اﻟﺒﯿﺎﻧﺎت.
– 2ﻋﻤﻠﯿﮫ اﺿﺎﻓﮫ ﺳﺠﻞ ﺟﺪﯾﺪ ﺑﻌﺪ ان ﻗﻤﻨﺎ ﺑﺎﺿﺎﻓﮫ command buttonﺑﻌﻨﻮان Add
36 PDF created with pdfFactory trial version www.pdffactory.com
:ﺳﻨﻘﻮم ﺑﻜﺘﺎﺑﮫ اﻟﻜﻮد اﻟﺘﺎﻟﻰ ﺑﺪاﺧﻠﮫ Private sub click() Adodc1.recordset.AddNew End sub
ﻣﻦ ﺧﻼل اﻟﺤﺪث
ﻋﻤﻠﯿﮫ ﺣﻔﻆ ﺳﺠﻞ- 3 SAVE وﻓﻰ داﺧﻞ اﻟﺰر :ﻧﻜﺘﺐ اﻟﻜﻮد اﻟﺘﺎﻟﻰ Private sub click () Adodc1.recordset.Update End sub – ﻋﻤﻠﯿﮫ ﺣﺬف ﻟﻠﺒﯿﺎﻧﺎت4 DELETE ﻧﻜﺘﺐ داﺧﻞ اﻟﺰر :اﻟﻜﻮد اﻟﺘﺎﻟﻰ Private sub click () Adodc1.recordset.delete End sub
" – ﻋﻤﻠﯿﮫ اﻟﺘﺤﺮك ﻟﻼﻣﺎم "اﯾﺠﺎد ﺑﯿﺎن ﻣﻠﺤﻖ5 move Next ﻻﺗﻤﺎم ھﺬه اﻟﻌﻤﻠﯿﮫ ﻧﻜﺘﺐ ﻓﻰ اﻟﺰر
37 PDF created with pdfFactory trial version www.pdffactory.com
:اﻟﻜﻮد اﻻﺗﻰ Private Sub Command6_Click () On Error Resume Next Adodc1.Recordset.MoveNext End Sub " – ﻋﻤﻠﯿﮫ اﻟﺘﺤﺮك ﻟﻠﺨﻠﻒ "اﯾﺠﺎد ﺑﯿﺎن ﺳﺎﺑﻖ5 move previous ﻻﺗﻤﺎم ھﺬه اﻟﻌﻤﻠﯿﮫ ﻧﻜﺘﺐ ﻓﻰ اﻟﺰر :اﻟﻜﻮد اﻻﺗﻰ Private Sub Command5_Click () On Error Resume Next Adodc1.Recordset.Move previous End Sub
– ﻋﻤﻠﯿﮫ اﺳﺘﺪﻋﺎء اﻟﺒﯿﺎﻧﺎت7
38 PDF created with pdfFactory trial version www.pdffactory.com
....ﻻ ﯾﻨﻘﺺ اﻻن اﻻ ﻋﻤﻠﯿﮫ ھﺎﻣﮫ ﺟﺪا وھﻰ ﻋﻤﻠﯿﮫ اﯾﺠﺎد اﻟﺒﯿﺎﻧﺎت او اﻟﺒﺤﺚ ﻋﻦ ﺑﯿﺎن ﻣﻌﯿﻦ ﻓﻘﻂ دون ﻏﯿﺮه :وﻻﺗﻤﺎم ھﺬه اﻟﻌﻤﻠﯿﮫ ﻧﺘﺒﻊ اﻟﺨﻄﻮات اﻟﺘﺎﻟﯿﮫ import data اوﻻ ﻧﻘﻮم ﺑﻮﺿﻊ زر ﻋﻠﻰ ﻓﻮرم اﻟﻤﺸﺮوع وﻧﺴﻤﯿﮫ ﻣﺜﻼ ﺛﻢ ﻧﻘﻮم ﺑﻜﺘﺎﺑﮫ اﻟﻜﻮد اﻟﺘﺎﻟﻰ ﻓﻰ اﻟﺤﺪث Private sub Command4_click () Dim s As String s = InputBox ("enter the name”) Adodc1.Recordset.Find "name=' " + s+” ‘ “ If Adodc1.Recordset.EOF Then MsgBox ("the name is not exist”) 39 PDF created with pdfFactory trial version www.pdffactory.com
Exit Sub End If End Sub ﺷﺮح اﻟﻜﻮد ﻣﻦ اﻟﻤﻔﺘﺮض اﻧﻰ اﺧﺎﻃﺐ اﻻن اﻟﻤﻜﺘﺒﮫ واﻗﻮل ﻟﮭﺎ ان اﻟﻤﺘﻐﯿﺮ S
ﯾﺸﻐﻞ ﺣﯿﺰ ﻣﻦ ﻣﺴﺎﺣﮫ اﻟﺬاﻛﺮه
وﻋﻨﺪ اﺳﺘﺪﻋﺎء اﻟﻤﺘﻐﯿﺮ Sﺳﻮف ﯾﻘﻮم ﺑﻔﺘﺢ ﺻﻨﺪوق ﺣﻮارى وھﻮ ﻧﺎﻓﺬه ﻋﻠﻰ ﻗﺎﻋﺪه اﻟﺒﯿﺎﻧﺎت ﻻﯾﺠﺎد اﻟﺒﯿﺎن اﻟﻤﻄﻠﻮب. وﯾﺘﻢ ذﻟﻚ ﺑﺮﻣﺠﯿﺎ ﻋﻦ ﻃﺮﯾﻖ اﻻﻣﺮ find ﻣﻦ ﺧﻼل اﻟﺠﻤﻠﮫ:
“ ‘ ”Adodc1.Recordset.Find "name=' " + s+
ﻓﻨﺤﻦ ﻧﻘﻮم ﺑﺎﺟﺮاء ﺑﺤﺚ او اﺳﺘﺪﻋﺎء اﻻن ﺑﻤﺪﻟﻮل اﻻﺳﻢ. ﺛﻢ ﻧﻨﺘﻘﻞ اﻟﻰ ﺗﻄﺒﯿﻖ ﻗﺎﻋﺪه IFوھﻰ ﻗﺎﻋﺪه ﺷﺮﻃﯿﮫ ﻛﻤﺎ ﻧﻌﻠﻢ،اى ﻣﻠﺰوﻣﮫ ﺑﻔﻌﻞ اﻣﺮ ﻣﻦ اﻣﺮﯾﻦ ﻋﻠﻰ اﻻﻗﻞ ،وﯾﺘﻢ ذﻟﻚ ﻣﻦ ﺧﻼل ﻧﺺ اﻟﺠﻤﻠﮫ وھﻮ اﻟﺬھﺎب ﻻﯾﺠﺎد اﻟﻤﺘﻐﯿﺮ Sﻓﺎن ﻟﻢ ﯾﻜﻦ ﻣﻮﺟﻮدا ﻋﻨﺪ ﻧﮭﺎﯾﮫ اﻟﻤﻠﻔﺎت EOFﻓﺴﻮف ﯾﻌﻄﯿﻨﻰ رﺳﺎﻟﮫ اﻋﺘﺮاﺿﯿﮫ ﺑﻌﺪ ذﻟﻚ اﻗﻮم ﺑﺎﻧﮭﺎء اﻻﻣﺮ واﻧﮭﺎء اﻟﻘﺎﻋﺪه واﻟﺨﺮوج ﻣﻦ ﺣﯿﺰ اﻣﺮ ھﺰا اﻟﺰر.
ﺑﻌﺪ ﻗﯿﺎﻣﻚ ﺑﺘﺸﻐﯿﻞ اﻟﺘﻄﺒﯿﻖ ﺳﺘﺠﺪ اﻧﻚ ﺳﺘﻨﻔﺬ ھﺬه اﻟﻌﻤﻠﯿﺎت ﺑﻜﻞ ﺳﮭﻮﻟﮫ.... 40 PDF created with pdfFactory trial version www.pdffactory.com
ﻛﻤﺎ ﻓﻰ اﻟﺸﻜﻞ اﻟﺘﺎﻟﻰ ﻣﺜﻼ :
ﻓﻔﻰ ھﺬا اﻟﺸﻜﻞ اﻗﻮم ﺑﺘﻨﻔﯿﺬ اﻣﺮ اﻻﺳﺘﺪﻋﺎء ﻟﻠﺒﯿﺎﻧﺎت ﺑﺪﻻﻟﮫ اﺳﻤﺎﺋﮭﻢ ﻓﺎن ﻛﺎن اﻻﺳﻢ ﻏﯿﺮ ﻣﻮﺟﻮد ﺳﻮف ﯾﻌﻄﯿﻨﻰ اﻟﺮﺳﺎﻟﮫ اﻻﻋﺘﺮاﺿﯿﮫ اﻻﺗﯿﮫ:
41 PDF created with pdfFactory trial version www.pdffactory.com
وان ﻛﺎن اﻻﺳﻢ ﻣﻮﺟﻮدا ﺳﻮف ﯾﺘﻢ اﻟﺤﺼﻮل ﻋﻠﯿﮫ... واﯾﻀﺎ ﻣﻦ ﺧﻼل اﻻواﻣﺮ اﻻﺿﺎﻓﮫ واﻟﺤﻔﻆ واﻟﺤﺬف ﯾﺘﻢ اﺟﺮاء ھﺬه اﻟﻌﻤﻠﯿﺎت ﻋﻨﺪ اﻟﺤﺪث click
وﻛﺎﻧﺖ ھﺬه ھﻰ ﻃﺮق اداره ﻗﻮاﻋﺪ اﻟﺒﯿﺎﻧﺎت ﻣﻊ ﻣﻜﺘﺒﮫ) ADO.(OLEDBﻋﻤﻮﻣﺎ ﻻ ﯾﺸﺘﺮط ﻓﯿﮭﺎ اﻟﺘﻌﺎﻣﻞ ﻣﻊ .ACCESS
* ﯾﻤﻜﻨﻚ اﯾﻀﺎ اﻟﺘﻌﺎﻣﻞ ﻣﻊ ﻗﻮاﻋﺪ ﺑﯿﺎﻧﺎت اﺧﺮى ﻣﻦ ﺧﻼل ADOوذﻟﻚ ﻋﻦ ﻃﺮﯾﻖ ﻣﺰود اﻟﺨﺪﻣﮫ وھﻮ
42 PDF created with pdfFactory trial version www.pdffactory.com
اﻟﻤﺴﺆل ﻋﻦ رﺑﻂ اى ﻗﺎﻋﺪه ﺑﯿﺎﻧﺎت ﺑﺎﺳﺘﺨﺪام ﺟﻤﻞ رﺑﻂ ﺑﮭﺬه اﻟﻤﻜﺘﺒﮫ.وھﻮ ﻣﻮﺟﻮد ﺿﻤﻦ ﺧﺼﺎﺋﺺ ھﺬه اﻟﻤﻜﺘﺒﮫ ﻛﻤﺎ ذﻛﺮﻧﺎ ﻣﺴﺒﻘﺎ او ﻣﻦ ﺧﻼل ﻗﺎﺋﻤﮫ اﻟﺨﺼﺎﺋﺺ ﻓﻰ visual basicوﻣﻦ ﺧﻼل اﻻﻣﺮ Connection string ﺣﯿﺚ ﯾﻤﻜﻨﻚ اﻟﺮﺑﻂ ﺑﯿﻨﮭﺎ وﺑﯿﻦ ﻗﺎﻋﺪه ﺑﯿﺎﻧﺎت ﻣﻦ ﻧﻮﻋﯿﮫ ORACLEﻋﻦ ﻃﺮﯾﻖ اﻻﻣﺮ: Microsoft Provider OLE DB FOR ORACLE واﯾﻀﺎ ﻗﺎﻋﺪه ﺑﯿﺎﻧﺎت ﻣﻦ ﻧﻮﻋﯿﮫ SQL serverﻣﻦ ﺧﻼل اﻻﻣﺮ: Microsoft Provider OLE DB FOR SQL
ﺗﻢ ﺑﺤﻤﺪ اﷲ ﺟﻤﮫﻮرﻳﻪ ﻣﺼﺮ اﻟﻌﺮﺑﯿﻪ اﻟﻘﺎھﺮه اﻟﻤﺆﻟﻒ/
43 PDF created with pdfFactory trial version www.pdffactory.com
ﺳﺎﻣﺢ ﺣﺴﻦ ﻣﺤﻤﺪ ﺳﻨﻮﺳﻰ ﻃﺎﻟﺐ ﺑﺄﻛﺎدﻳﻤﯿﻪ اﻟﺠﺰﻳﺮه ﻟﻌﻠﻮم اﻟﺤﺎﺳﺐ واداره اﻻﻋﻤﺎل ﻗﺴﻢ ﺣﺎﺳﺐ أﻟﻰ – اﻟﻔﺮﻗﻪ اﻟﺜﺎﻟﺜﻪ
ارﺟﻮ ان اﻛﻮن ﻗﺪ وﻓﻘﺖ ﻓﻰ ذﻛﺮ ﻛﻞ ﻣﺎ ﺟﺎل ﺑﺨﺎﻃﺮى ﺣﯿﺎل ھﺬا اﻟﻤﻮﺿﻮع وﻣﻦ اﷲ اﻻﺳﺘﯿﻌﺎب وﻋﻠﻰ اﷲ اﻟﺘﻮاﺻﻞ واﻟﺘﻮﺻﻞ... ﻛﻤﺎ ارﺟﻮ ﻏﺾ اﻟﺒﺼﺮ ﻋﻦ ﺑﻌﺾ اﺧﻄﺎﺋﻰ... وﻻ ﺗﻨﺴﻮﻧﺎ ﻣﻦ ﺻﺎﻟﺢ دﻋﺎﺋﻜﻢ...
ﺑﺴﻢ اﷲ اﻟﺮﺣﻤﻦ اﻟﺮﺣﯿﻢ "رب اﺟﻌﻠﻨﻰ ﻣﻘﯿﻢ اﻟﺼﻼه وﻣﻦ ذرﻳﺘﻰ رﺑﻨﺎ وﺗﻘﺒﻞ دﻋﺎء * رب اﻏﻔﺮ ﻟﻰ وﻟﻮاﻟﺪى وﻟﻠﻤﺆﻣﻨﯿﻦ ﻳﻮم ﻳﻘﻮم اﻟﺤﺴﺎب"
ﺻﺪق اﷲ اﻟﻌﻈﯿﻢ
44 PDF created with pdfFactory trial version www.pdffactory.com