edit_rs_cmd.CommandText = "SELECT * FROM dbo.usertable WHERE id = ?" 這時候要把不能顯示的欄位,在放到sql中,顯示出來 edit_rs_cmd.CommandText = "SELECT *,[不能顯示的欄位],[不能顯示的欄位], FROM dbo.usertable WHERE id = ?" 後來又找到的方法 edit_rs.Fields.Item("opentime").Value 把
[b]方法一、盡量使用複雜的SQL來代替簡單的一堆SQL[/b] 同樣的事務,一個複雜的SQL完成的效率高於一堆簡單SQL完成的效率,有多個查詢時,要善於使用JOIN。 oRs=oConn.Execute("Select * FROM Books") while not ors.Eof strSQL = "Select * FROM Authors Where AuthorID="&oRs("AuthorID") ors2=oConn.Execute(strSQL)
一、新手常犯的錯誤 在論壇看到很多文章代碼中都有一個共同的基本錯誤,欄位類型錯誤。 程式和資料庫是緊緊相連的,資料庫欄位文本型或時間型的都使用單引號 比如下面這段修改語句: conn.execute "update Counts set counts='"&counts&"' where num="&num&" and Atime='"&now()&"'" 等號左邊都是欄位名,等號右邊是傳值過來的變數名,counts
for i=1 to 256 yongfa365=yongfa365&"<!--這裡主要是讓前邊先產生256個字元,這樣才可以即時輸出-->" if len(yongfa365)>=256 then exit for next MadeBasic() MadeModel() MadeIndexBlogItem() response.Write "1/6所有模版產生完成<br&
<%sub fsojs()%> <% Set fso= Server.CreateObject("Scripting.FileSystemObject") set fd=fso.createtextfile(server.MapPath("../category.js"),true) '開始操作 set rs=server.CreateObject("adodb.recordset") rs.Open "select * from dept_category",conn,1,
'////////////////////////////////////////////////FSO操作///////////////////////////////////// '判斷檔案夾是否存在 Function FolderExits(Folder) Folder=Server.Mappath(Folder) Set FSO= Server.CreateObject("Scripting.FileSystemObject") IF FSO.FolderExists(Folder)
<% Function AutoKey(strKey) Const lngSubKey=2 lngLenKey=Len(strKey) Select Case lngLenKey Case 0 '若為空白串,轉到出錯頁 Response.Redirect "Error.htm" Case 1 '若長度為1,則不設任何值 strNew1="" strNew2="" Case Else '若長度大於1,則從字串首字元開始,迴圈取長度為2的子字串作為查詢條件 For i=1
<% '欄位內網址加上聯結。 Function ToLink(Str) Dim RE 'Regex對象 Dim strContent If IsNull(Str) Then Str = "" Set RE = New RegExp '建立正 則運算式對象 With RE .Global = True '搜尋應用於整個字串 .IgnoreCase = True '搜尋不區分大小寫 strContent =