|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
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> |
|
#2
|
||||
|
||||
|
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= |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
I am sorry......
again, I did not state the problem. "when I run it through Brinkster, it says: "this page can't be display" |
|
#5
|
||||
|
||||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Could someone help?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|