【正文】
的時候就可以為每條記錄添加一個新的編號。 exec=select * from book order by id desc ‘以留言的 ID 升序排序數(shù)據(jù)記錄,達到總是顯示最新留言的目的。 留言內(nèi)容的分頁顯示 當網(wǎng)頁上顯示數(shù)據(jù)庫記錄時,如果表中包含的記錄比較多時,就必須分頁顯示這些記錄?;?ASP 的動態(tài)旅游網(wǎng)站 26 即在一個頁面中顯示一組指定數(shù)目的記錄,并在該頁面中添加一些超鏈接,通過超鏈接可以查看不同的記錄 組。使用 PageSize 指定一頁中的記錄數(shù);使用 Page Count 屬性返回總頁數(shù);用 AbsolutePage 來指定當前記錄所在的頁。 %if pagecount =1 and pagecount then%a href=?page=%= cstr(pagecount+1) %下一頁 a % if 1 and =pagecount then %a href=?page=%= cstr(pagecount1)%上一頁 a%end if% %if pagecount1 and pagecount then%a href=?page= %=cstr(pagecount1)%上一頁 a a href=?page=%=cstr(pagecount+1)% 下一頁 a%end if% 再次是對數(shù)據(jù)庫的操作 留言回復操作 通過超鏈接傳遞要被回復 的編號,回復頁面得到編號并找出對應的記錄,修改表 book中的 lyff 字段,再返回留言面頁顯示出回復! % exec=select * from book where ID=amp。(ID) set rs=() exec,conn,1,3 rs(lyff)=(lyff) % 4. 留言刪除操作 也是通過超鏈接傳遞被刪除的留言編號,刪除面 頁得到編號后查找得到對應的記錄,即刪除該記錄并返回留言頁面。 % exec=delete * from book where ID=amp。(ID) % 4. 5 新聞發(fā)布系統(tǒng)的實現(xiàn) 4. 5. 1 新聞首頁: 新聞的首頁主要是通過新聞的標題來引導讀者進入新聞的主題,所以該頁面主要是從基于 ASP 的動態(tài)旅游網(wǎng)站 27 數(shù)據(jù)庫中得到新聞的標題并于新聞發(fā)布的時間的先后進排序來顯示在該頁面上,并為每個標題加入鏈接進入新聞的主體部份。具體實現(xiàn)如 下: % exec=select * from new order by id desc ‘按新聞的編號的倒序排列 set rs=() exec,conn,1,1 % a style=fontstyle: italic href=?ID=%=rs(ID)%%=rs(biaoti)% /a —— 通過 HTML 中的標題鏈接并傳遞對應標題的編號到新聞 的內(nèi)容頁面 —— 4. 5. 2 新聞內(nèi)容顯示 本頁面是根椐首頁標題傳遞過來的編號,查找對應的記錄并顯示對應的記錄。 4. 5. 3 新聞的發(fā)布、刪除 即為表 new 中為每個字段增加、刪除對應的數(shù)據(jù)。實現(xiàn)思想同留言本中的為添加刪除記錄一樣。 4. 5. 4 新聞的修改 新聞的發(fā)布難免會出現(xiàn)一些錯誤,本系統(tǒng)的修改內(nèi)容初始為原有的內(nèi)容,把修改后的內(nèi)容重新寫入數(shù)據(jù)庫中。 五 結(jié)束語 經(jīng)過二個多月的設(shè)計和開發(fā),旅游網(wǎng)站系統(tǒng)基本開發(fā)完畢。其功能基本符合企業(yè)和用戶需求,能夠完成用戶瀏覽信息,用戶與用戶,用戶與游客的 信息交流。并提供部分系統(tǒng)維護功能 ,使用戶方便進行數(shù)據(jù)添加、刪除、修改。對于數(shù)據(jù)的一致性的問題也通過程序進行了有效的解決。 但是由于畢業(yè)設(shè)計時間較短,所以該系統(tǒng)還有許多不盡如人意的地方,比如旅游景點介紹比較不詳細,用戶界面不夠美觀,出錯處理不夠等多方面問題。這些都有待進一步改善。 6 主要參考文獻 [1]、趙增敏、朱粹丹、趙朱曦 主編的《 ASP 動態(tài)網(wǎng)頁設(shè)計》 — 北京:電子工業(yè)出版社 [2]、阮家棟、施美雅 主編的《 Web 數(shù)據(jù)庫技術(shù)》 — 北京:科學出版社, 2020 [3]、數(shù)據(jù)庫基礎(chǔ)與應用 /王利 主編。 — 北京:中央廣播電視大學出版社, 基于 ASP 的動態(tài)旅游網(wǎng)站 28 “ Easy, now,” said Ted Tonks, placing a hand on Harry?s shoulder and pushing him back against the cushions. “That was a nasty crash you just had. What happened, anyway? Something go wrong with the bike? Arthur Weasley overstretch himself again, him and his Muggle contraptions?” “ No,” said Harry, as his scar pulsed like an open wound. “Death Eaters, loads of them – we were chased – ” “ Death Eaters?” said Ted sharply. “What d?you mean, Death Eaters? I thought they didn?t know you were being moved tonight, I thought – ” “ They knew,” said Harry. Ted Tonks looked up at the ceiling as though he could see through it to the sky above. “ Well, we know our protective charms hold, then, don?t we? They shouldn?t be able to get within a hundred yards of the place in any direction.” Now Harry understood why Voldemort had vanished。 it had been at the point when the motorbike crossed the barrier of the Order?s charms. He only hoped they would continue to work: He imagined Voldemort, a hundred yards above them as they spoke, looking for a way to perate what Harry visualized as a great transparent bubble. He swung his legs off the sofa。 he needed to see Hagrid with his own eyes before he would believe that he was alive. He had barely stood up, however, when a door opened and Hagrid squeezed through it, his face covered in mud and blood, limping a little but miraculously alive. “ Harry!” Knocking over tw o delicate tables and an aspidistra, he covered the floor between them in two strides and pulled Harry into a hug that nearly cracked his newly repaired ribs. “Blimey, Harry, how did yeh get out o? that? I thought we were both goners.” “ Yeah, me too. I can?t believe – ” Harry broke off. He had just noticed the woman who had entered the room behind Hagrid. “ You!” he shouted, and he thrust his hand into his pocket, but it was empty. “ Your wand?s here, son,” said Ted, tapping it on Harry?s arm. “It fell right beside you, I picked it up…And that?s my wife you ?re shouting at.” “ Oh, I?m – I?m sorry.” As she moved forward into the room, Mrs. Tonks?s resemblance to her sister Bellatrix became much less pronounced: Her hair was a light soft brown and her eyes were wider and kinder. Nevertheless, she looked a little haughty after Harry?s exclamation. “ What happened to our daughter?” she asked. “Hagrid said you were ambushed。 where is Nymphadora?” “ I don?t know,” said Harry. “We don?t know what happened to anyone else.” She and Ted exchanged looks. A mixture of fear and guilt gripped Harry at the sight of their expressions, if any of the others had died, it was his fault, all his fault. He had consented to the plan, give n them his hair… 基于 ASP 的動態(tài)旅游網(wǎng)站 29 “ The Portkey,” he said, remembering all of a sudden. “We?ve got to get back to the Burrow and find out – then we?ll be able to send you word, or – or Tonks will, once she?s – ” “ Dora?ll be ok, ?Dromeda,” said Ted. “She knows her stuff, she?s been in plenty of tight spots with the Aurors. The Portkey?s through here,” he added to Harry. “It?s supposed to leave in three minutes, if you want to take it.” “ Yeah, we do,” said Harry. He seized his rucksack, swung it onto his shoulders. “I – ” He looked at Mrs. Tonks, wanting to apologize for the state of fear in which he left her and for which he felt so terribly re sponsible, but no words occurred to him that he did not seem hollow and insincere. “ I?ll tell Tonks – Dora – to send word, when she… Thanks for patching us up, thanks for everything, I – ” He was glad to leave the room and follow Ted Tonks along a short hallway and into a bedroom. Hagrid came after them, bending low to avoid hitting his head on the door lintel. “ There you go, son. That?s the Portkey.” Mr. Tonks was pointing to a small, silverbacked hairbrush lying on the dressing table.