ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old September 23rd, 2003, 11:42 PM
acwendy60 acwendy60 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 acwendy60 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Could someone help??

this code does not work..
I have everything in my database...
I think just the code that has problems.
Could someone please take a look and fix it??
Please......
Thanks alot


<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_func_common.asp" -->
<%
set my_Conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString

strDBNTUserName = Request.Cookies(strUniqueID & "User")("Name")
strDBNTFUserName = trim(chkString(Request.Form("Name"),"SQLString"))


if strDBNTFUserName = "" then strDBNTFUserName = trim(chkString(Request.Form("User"),"SQLString"))


if strAuthType = "nt" then
strDBNTUserName = Session(strCookieURL & "userID")
strDBNTFUserName = Session(strCookieURL & "userID")
end if
'###
dim nPersonal
dim nId
dim nLev

strSql = "SELECT M_PERSONAL, MEMBER_ID"
strSql = strSql & " FROM FORUM_MEMBERS "
strSql = strSql & "WHERE M_NAME= '"& strDBNTUserName & "'"

set rs2 = my_Conn.Execute (strSql)
if not rs2.EOF and not rs2.BOF then
nPersonal=rs2("M_PERSONAL")
nId = rs2("MEMBER_ID")
nLev = rs2("MEMBER_LEVEL")
else
nPersonal ="<h3>NOT A MEMBER</h3>"
end if
rs2.close

'## Response.Write(nPersonal)
Response.Write(nId )
Response.Write(strDBNTUserName )
dim tAuthor
dim mDescription
strSql = "SELECT E_AUTHOR, E_DESCRIPTION"
strSql = strSql & " FROM FORUM_EBOOKS "
Response.Write("<br>" & strSql )

set rs2 = my_Conn.Execute (strSql)
if not rs2.EOF and not rs2.BOF then
tAuthor=rs2("E_AUTHOR")
mDescription=rs2("E_DESCRIPTION")
else
tAuthor ="<h3>NO Author</h3>"
end if
my_Conn.close




%>
<html>
<body>

<%
if Request.QueryString("xong")= 1 then
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
strSql = "UPDATE FORUM_MEMBERS SET M_PERSONAL = '"& chkString(Request.QueryString("Message"), "SQLString")
strSql = strSql & "' WHERE M_NAME ='"& strDBNTUserName & "'"

set myrs = my_Conn.Execute (strSql)
my_Conn.close
Response.Write("<SCRIPT language='javascript'>window.opener.location='MVPersonal.asp';self.close();</SCRIPT>")
else
%>
<%
dim nLev

strSql = "SELECT M_PERSONAL, MEMBER_ID"
strSql = strSql & " FROM FORUM_MEMBERS "
strSql = strSql & "WHERE M_NAME= '"& strDBNTUserName & "'"

set rs2 = my_Conn.Execute (strSql)
if not rs2.EOF and not rs2.BOF then
'nPersonal=rs2("M_PERSONAL")
'nId = rs2("MEMBER_ID")
nLev = rs2("MEMBER_LEVEL")
if (nLev= 1) then
'set my_Conn = Server.CreateObject("ADODB.Connection")
'my_Conn.Open strConnString
%>
<p>Author:
<input type="text" cols="50" name="Author" value=<%=tAuthor%> >
<p>
<p>Description :
<input type="text" name="Description" value=<%=mDescription%> >

<%
elseif (nLev=2) then
<p>
<p>Description :
<input type="text" name="Description" value=<%=mDescription%> >
else
endif
rs2.close
'set myrs = my_Conn.Execute (strSql)

'Response.Write("<SCRIPT language='javascript'>window.opener.location='MVPersonal.asp';self.close();</SCRIPT>")
'else
%>


<form name="PostTopic" >
<center>
<font size='6' color='005500' face='script, times new roman, serif'><B>Rich Text Editor</B></font><br>
<table>
<tr><td><textarea cols="50" name="Message" rows="10" wrap="VIRTUAL" ><%=nPersonal%></textarea>
</td></tr>
</table>

<script language="Javascript1.2"><!-- // load htmlarea
_editor_url = ""; // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
document.write(' language="Javascript1.2"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>

<script language="JavaScript1.2" defer>
editor_generate('Message');
</script>

<input type="submit" value="Save" onClick="document.PostTopic.xong.value=1;">
<input Type='hidden' Name='xong' Value =0>
</center>
</form>
<%
end if
%>

</body>
</html>
Attached Files
File Type: asp mveditebook2.asp (4.1 KB, 208 views)

Reply With Quote
  #2  
Old September 24th, 2003, 12:47 AM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 6 m 22 sec
Reputation Power: 76
First: Read the "How to post a question" thread. You will see that your thread subject is not acceptable. It needs to be descriptive. You will also see that "it doesn't work" is a worthless statement. Tell us what you're trying to do, and what is actually happening. Give any error messages, and what lines they refer to.

That said, you keep using "rs2.execute" and then checking rs2.bof and eof. You have to open a recordset object to contain the results of your query. Do that, then post back with a detailed, useful question.
__________________
--Dave--

U2kgSG9jIExlZ2VyZSBTY2lzLCBOaW1pdW0gRXJ1ZGl0aW9uaXMgSGFiZXM=

Reply With Quote
  #3  
Old September 24th, 2003, 01:04 AM
acwendy60 acwendy60 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 acwendy60 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I am sorry....
but I am desperate.......
I do not really understand what you said.
I am really new to asp.

I am trying to do a ebook manager.
when the admin sign-in, he will see the screen where he can add a new author(the author has to be a member to the forum) so the data should be saved into database.
when the author sign-in, he will see the screen where he could change the despriction and the title of his book, and edit the book.
when non-admin, non-author members sign-in, he will only see the title of the book, the author, and the description.
I am trying to use member level to separate the sign-ins.
There is a member_level colume in the database.
I am still trying to see what's wrong of the code.
Again, I am very sorry that I just went through "How to post a question" but did not read it careful.

By the way, my forum is hosted by snitz.com

Reply With Quote
  #4  
Old September 24th, 2003, 01:09 AM
acwendy60 acwendy60 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 acwendy60 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I am sorry......
again, I did not state the problem.
"when I run it through Brinkster, it says: "this page can't be display"

Reply With Quote
  #5  
Old September 24th, 2003, 09:25 AM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 6 m 22 sec
Reputation Power: 76
For the error, go to tools->internet options->advanced->uncheck "show friendly http errors"
This should show you the actual error. However, as I said in my first post, you need to learn about the recordset object. Also, you do know that asp is a server side language, and needs to be installed on your server in order for you to use asp code. Be sure this is done.
If you are completely new to asp, it sounds like your project is pretty difficult.
www.w3schools.com and www.asp101.com and www.4guysfromrolla.com are a few good places to get some tutorials and basics of asp programming.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Could someone help??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway