First off, I'm making a portal for some students of a particular line of my education. What I need is for the admin to be able to write news, pick the users who should see the news when they login. This means I'm operating with the use of two tables in my Access database. One names news with the newsid and newselements and one for newsid and userids (seperated by commas) called usernews.
Now, my problem is that when I get to the point that users have to view any news they might have, I cannot seem to be able to use both databases. I've tried with a simple select sentence that I have been told should work when I have created a relationship (one to one, between newsids) in the database. That didn't work, so I tried doing an inner join the
asp code together with my select sentence. It still says that it cannot find the fields I'm referring to in the relavant table. I have tried many different ways of doing all the basic stuff, but with no success. What method do I need to use to make this work? I found something called 'union' to do two selects that I haven't tried out yet. Wonder if that might be the answer.
The code I currently use is, by the way:
- Code: Select all
<%
SQL = "SELECT * FROM usernews WHERE userid = '%," & getuserid & ",%' ORDER BY newsid ASC"
set db = conn.execute(SQL)
%>
- Code: Select all
The items I'm not able to call:
<td width="260"><%= replace(db("news.subject"),"###","'",1,-1,1)%></td>
<td width="124"><%= replace(db("news.thedate"),"###","'",1,-1,1)%></td>
</tr>
<tr>
<td colspan="3"><%= db("news.content")%></td>
Another thing I need use do is to automatically delete the directory belonging to a user when the user is deleted by an admin. However, for some reason, I have to write the full path, I cannot request any element. You can see the code I've used below:
- Code: Select all
<% 'Deletes folder assigned to user %>
<%
specificpath = "/users/" & request.form(useform)
folderpathing = server.MapPath(specificpath)
dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
if fs.FolderExists(folderpathing) then
fs.DeleteFolder folderpathing,true
end if
set fs=nothing
%>
I've tried questing the username from database, I've tried writing it to a text-file and requesting it. Every time it only reads the first part of the path (c:/inetpub/wwwroot/users/) and doesn't include the requested part. It works perfectly fine if I manually write the full path with the name of the directory I want to delete.
The last thing I have problems with before my project seems complete is permissions. I really don't want to hand in my project on a CD and find out it didn't work. In trying to answer some of my technical problems, I had sent my project to my teacher. She said she had no permission to view them, even if she'd tried to change permissions to allow her to. As I'm testing the site via localhost I had to change the permissions of the Access database. So, I disabled simple sharing. The only permissions I changed were the one for the database, but my project partner has also had problems being allowed to view the files since I disabled simple sharing (it worked when she tried it on a different computer and changed permissions, but my teacher tried it on three computers and two servers with no luck). I've re-sent the files to my teacher after re-enabling simple sharing, but she hasn't responded yet.
I'm kind of pressed for time with this project, so I was simply hoping you guys could come up with some kind of answer for these things. I user five hour to try to get the deletepath right, and I found several similar cases on google, although the one of them that actually were about using a request as a part of a path were never answered. I came to the conclution that it might simple not be possible (the way I try to do it), but am I wrong?