Folder 表:
Folderid:目录ID,自动编号
FolderParentID:上级目录ID,Int
FolderName:目录名称,Varchar
FolderDescription:目录说明,Varchar
File 表:
FileID:文档ID,自动编号
FileFolderID:所属目录ID,Int
FileName:文档名称,Varchar
FileDescription:文档内容,Varchar或备注(ntext)
function FolderPath(id)
'得到一个目录的完整路径
dim Pathstr,NewPathstr
Set rsdir = Conn.Execute("Select FolderID,FolderName,FolderParentID from [Folder] where FolderID = " & id)
if rsdir.bof and rsdir.eof then
Pathstr = ""
else
Pathstr = "<a href=""Folder.asp?FolderID=" & rsdir("FolderID") &""">" & rsdir("FolderName") & "</a> > " & Pathstr
if rsdir("FolderParentID") <> 0 then
Pathstr = FolderPath(rsdir("FolderParentID")) & Pathstr
end if
end if
NewPathstr = Pathstr
set rsdir = nothing
FolderPath = NewPathstr
end function
dim folderpathstr
folderpathstr = FolderPath(67)
response.write folderpathstr '输出 (技术文档 > Web开发 > ASP > Code Sample > 表单 > )
本文地址:http://com.8s8s.com/it/it7578.htm