Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to make virtual folders for an online bookmark keeper (i.e. Blink.com)

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-10-25 : 18:25:42
Timothy writes "Ok, I will try to explain this as best I can...

I am wondering if you know a simple way to create virtual folders using a combination of VBscript, ADO and SQL (SQL 7).

I can figure out several ways to do it, but each of my ideas leaves it impossible to do one or another features I see at sites such as blink.com.

I had thought about combining my ideas, but it seams to leave the code cumbersome or else it creates redundant fields in the Bookmarks table.

As of right now, the best implementation is as follows:

Two tables in SQL 7: tblBookmarks and tblFolders.

tbleFolders has the following fields:
FolderKeyID (Autonumber/Int)
UserID (For filtering based on login cookie, Int)
FolderName
ParentFolderID (Int)
IDLocation (varChar)
EnglishLocation (varChar)

tblBookmarks contains at least these columns:
BookmarksID (Autonumber/Int)
UserID (Int)
BookmarkName (varChar)
URL (varChar)
Description (varChar)
ParentFolderID (Int)
IDLocation (varChar)
EnglishLocation (varChar)

So first, I filter everything by UserID based on the Login cookie.

Any bokmark or folder where ParentFolderID = 1.1 is considered to be in the "Root Folder." This way I can be sure it won't conflict with an actual FolderID.

So, when looking at the top-level (i.e. any bookmark or folder with the ParentFolderID set to 1.1 and where UserID matches the Login cookie) you are presented with what appears to be a virtual drive.

Click on a folder and you are taken to a page where everything is filtered by that folder's unique ID based on the ParentFolderID (of course we can start assuming everything is filtered by UserID and I can stop saying it.) This way it is easy to drill down.

Now, here is whare it turns spaggetti code.

What if a user wants to change the name of a folder, or wants to move a bookmark to another folder, or wants to delete a folder and all of it's contents? Also, what if i want to have a virtual location bar showing where the user is?

Well, if you know of a better, easier way PLEASE let me know!

thanks,
Tim"
   

- Advertisement -