《《電子商務網(wǎng)站》PPT課件》由會員分享,可在線閱讀,更多相關《《電子商務網(wǎng)站》PPT課件(33頁珍藏版)》請在裝配圖網(wǎng)上搜索。
1、,,,電子商務網(wǎng)站與網(wǎng)頁,電子商務網(wǎng)站與網(wǎng)頁,電子商務網(wǎng)站與網(wǎng)頁,ASP動態(tài)網(wǎng)站開發(fā)基礎教程 陳建偉編著,,客戶(IE瀏覽器),Web服務器,數(shù)據(jù)庫服務器,應用程序服務器,,HTTP請求,,HTML文檔,,動態(tài)頁面,,處理結果,,訪問數(shù)據(jù),,訪問結果,,,趙,,第9章 ADO數(shù)據(jù)庫訪問技術,Access,訪問數(shù)據(jù)庫,HOME,第9章 訪問數(shù)據(jù)庫9.1 應用Access數(shù)據(jù)庫,HOME,數(shù)據(jù)庫(DB),按邏輯結構存儲數(shù)據(jù),數(shù)據(jù)庫管理系統(tǒng)(DBMS),管理數(shù)據(jù)的軟件,,,記錄,,,字段,術語,,表,數(shù)據(jù)庫術語,創(chuàng)建數(shù)據(jù)庫,SQL語句,第9章 訪問數(shù)據(jù)庫9.1 應用Access數(shù)據(jù)庫,HOME,創(chuàng)建
2、數(shù)據(jù)庫,1、打開Access,2、新建數(shù)據(jù)庫db1.mdb,3、新建數(shù)據(jù)表table1,數(shù)據(jù)庫術語,創(chuàng)建數(shù)據(jù)庫,SQL語句,第9章 訪問數(shù)據(jù)庫9.1 應用Access數(shù)據(jù)庫,HOME,創(chuàng)建數(shù)據(jù)庫,打開Access,Microsoft Office Microsoft Office Access 2003,數(shù)據(jù)庫術語,創(chuàng)建數(shù)據(jù)庫,SQL語句,,,菜單欄,,工具欄,,,狀態(tài)欄,,工作區(qū),,新建數(shù)據(jù)庫,,,點擊空數(shù)據(jù)庫,,,新建數(shù)據(jù)庫名db1.mdb,,,新建表,,,設計表的視圖,,,學號,,學號,,,右鍵點擊“學號”,點擊“主鍵”,使“學號”具有唯一性,也就是表中記錄不能有相同學號。,,,點擊“保
3、存”或關閉“設計視圖”窗口,,,,,新建表的名稱,,,新建數(shù)據(jù)庫db1中新建表table1,,,新建數(shù)據(jù)庫db1.mdb,,001 Alice,為表添加數(shù)據(jù),,,第9章 訪問數(shù)據(jù)庫9.1 應用Access數(shù)據(jù)庫,HOME,SQL(結構化查詢語言),插入,刪除,修改,查詢,INSERT,DELETE,UPDATE,SELECT,數(shù)據(jù)庫術語,創(chuàng)建數(shù)據(jù)庫,SQL語句,第9章 訪問數(shù)據(jù)庫9.1 應用Access數(shù)據(jù)庫,HOME,SQL,插入,,,INSERT INTO (, ,),VALUES (, ,),INSERT INTO table1 (學號,姓名),VALUES (33883, 周),數(shù)
4、據(jù)庫術語,創(chuàng)建數(shù)據(jù)庫,SQL語句,第9章 訪問數(shù)據(jù)庫9.1 應用Access數(shù)據(jù)庫,HOME,SQL,刪除,,,DELETE FROM WHERE ,DELETE FROM table1 WHERE 姓名= 周,數(shù)據(jù)庫術語,創(chuàng)建數(shù)據(jù)庫,SQL語句,第9章 訪問數(shù)據(jù)庫9.1 應用Access數(shù)據(jù)庫,HOME,SQL,修改,,,UPDATE ,SET =, =,UPDATE table1,SET 學號= 010,WHERE ,WHERE 姓名=周,數(shù)據(jù)庫術語,創(chuàng)建數(shù)據(jù)庫,SQL語句,第9章 訪問數(shù)據(jù)庫9.1 應用Access數(shù)據(jù)庫,HOME,SQL,查詢,,,SELECT *,FROM table
5、1,WHERE 姓名= 趙,SELECT ,FROM ,ORDER BY ASC|DESC,WHERE ,數(shù)據(jù)庫術語,創(chuàng)建數(shù)據(jù)庫,SQL語句,第9章 訪問數(shù)據(jù)庫9.1 應用Access數(shù)據(jù)庫,HOME,SQL,拓展問題,數(shù)據(jù)庫術語,創(chuàng)建數(shù)據(jù)庫,SQL語句,第9章 訪問數(shù)據(jù)庫9.2 訪問數(shù)據(jù)庫,HOME,Connection,連接數(shù)據(jù)庫,Connection對象,訪問數(shù)據(jù)庫,又稱連接對象,用來和數(shù)據(jù)庫建立連接。,Connection對象介紹,Connection對象的方法: Open建立Connection對象和數(shù)據(jù)庫之間的連接。 Close關閉Connection對象和數(shù)據(jù)庫之間的連接。
6、Execute執(zhí)行對數(shù)據(jù)庫的各種操作。,第9章 訪問數(shù)據(jù)庫9.2 訪問數(shù)據(jù)庫,HOME,連接數(shù)據(jù)庫,,,set conn=server.createobject(ADODB.Connection),conn.provider=Microsoft.jet.oledb.4.0,conn.Open=C:Inetpubwwwrootdb1.mdb,Connection,連接數(shù)據(jù)庫,訪問數(shù)據(jù)庫,第9章 訪問數(shù)據(jù)庫9.2 訪問數(shù)據(jù)庫,HOME,引入文件共用代碼,Connection,連接數(shù)據(jù)庫,訪問數(shù)據(jù)庫,,,,, ,one.asp,two.asp,第9章 訪問數(shù)據(jù)庫9.2 訪問數(shù)據(jù)庫,HOME,訪問數(shù)據(jù)
7、庫,,,set conn=server.createobject(ADODB.Connection),conn.provider=Microsoft.jet.oledb.4.0,conn.Open=C:Inetpubwwwrootdb1.mdb,StrSql=增/刪/改的SQL語句,conn.Execute strSql,Connection,連接數(shù)據(jù)庫,訪問數(shù)據(jù)庫,conn.Close,連接數(shù)據(jù)庫,訪問數(shù)據(jù)庫,第9章 訪問數(shù)據(jù)庫9.2 訪問數(shù)據(jù)庫,HOME,訪問數(shù)據(jù)庫應用,,StrSql= Delete From table1 Where 姓名= 周 ,程序中的SQL語句:雙引號變成單引號,程序中的SQL語句:拼接變量,VaName=周 StrSql=Delete From table1 Where 姓名= &VaName& ,