Updating info to existing pages

Last post 10-23-2004, 3:57 PM by bnmiros. 9 replies.
Sort Posts: Previous Next
  •  10-22-2004, 8:39 AM 2185

    Updating info to existing pages

    Adam,

     
    what program do you use to program this in?
    Maybe that will halp me visualize what you are doing and what I am doing wrong. I really have to figure this out ASAP! Let me know if I can email you the code? Let me know what I need to do to get this done!
     
    Right now it is not working, and I am pretty sure that this is not that complex, just that I don't know what is wrong. If you can help me understand that would be a royal +.
     
    Please help!
  •  10-22-2004, 12:57 PM 2190 in reply to 2185

    Re: Updating info to existing pages

    bnmiros,

     
    We are using the visual studio.  The CuteEditor for asp is 100% JavaScript and ASP code.
     
    I think the problem you are having is pretty simple.
     
    If you want to get help quickly, please post your code here and explain the following things:
     
    1. What you are trying to do?
     
    2. what's database structure?
     
    3. Which page is used to display the content?
     
    4. Which page is used to edit/input the content?
     
    5. If you want to edit the existing record, how the record is pass to the edit page?

    After you finish the above general ASP questions,  I will explain how the CuteEditor is plugged in.
     
     
     
     
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  10-22-2004, 1:59 PM 2192 in reply to 2185

    Re: Updating info to existing pages

    I haven't changed anything in your database. I've added code you posted to my page.

    This is what I want to do. I want to be able to call a page by using an ID (a simple link that will contain an UPR just like the one below):
     
     
    This will call a page 5 to be edited (an example).
     
    Once the page displays, I will make chage to it, and save it (so the code should make change to that particular page, and does not create a new record).
     
    I also need to be able to have a page that will display what is in the database (in this case page with an ID=5)
     
    And that is it.
     
    This is the original code:
     
             
             <%
      
              dim conn
              dim connstr
              Set conn = Server.CreateObject("ADODB.Connection")
              connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("test.mdb")
              conn.Open connstr
              
              dim content
              
              if request("action")="save" then
               TitleField  = Request.Form("TitleField")
               MessageField = Request.Form("Editor1_HTMLContent")      
               
               sql="select TitleField,MessageField from test"
               set rs=server.createobject("adodb.recordset")
               rs.open sql,conn,3,3
               
               rs.addnew
               rs("TitleField") = TitleField
               rs("MessageField") = MessageField
               rs.update
               
               response.write "<font size=5 color=darkred>Message added</font>"
               response.write "<br>"
               rs.close
               set rs = nothing
              else
               MySQL="select top 1 * from test order by id DESC"
               set rs2=conn.execute(MySQL)
               if not rs2.eof then
                TitleField  = rs2("TitleField")
                MessageField  = rs2("MessageField")
                rs2.close
                set rs2=nothing
               end if
              end if 
             %>
             .
             .
             .
             .
             .
             .
             .
               <%
                 Dim editor
                 Set editor = New CuteEditor
         
                 editor.ID = "Editor1"
                 editor.Text = MessageField
                 editor.FilesPath = "editor_files"
                 editor.ImageGalleryPath = "/uploads"
                 editor.MaxImageSize = 50
                 'editor.AutoConfigure = "EnableAll"
                 'editor.Template= "Bold,Italic,Underline"
                 'editor.StyleSheetPath = "/grey2.css"
                 'editor.Width = 740
                 'editor.Height = 300
                 editor.Draw()
       
                 ' Request.Form("Editor1_HTMLContent") access from other page
      
                %>

     
     
    This is what you had in your previous posts: (this is the code for - http://www.hostlanedomains.com/text_edit/todatabase_final.asp?ID=5)
     
                      <%
      
              dim conn
              dim connstr
              Set conn = Server.CreateObject("ADODB.Connection")
              connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("test.mdb")
              conn.Open connstr
              
              dim content
              
    ID = Request("ID")
    If ID <> "" then
        sql="select TitleField,MessageField from test where id=" & Request.Querystring("id")
        'sql="select TitleField,MessageField from test where id="Request.Querystring("id")
        set rs=server.createobject("adodb.recordset")
        rs.open sql,conn,3,3         
        rs("TitleField") = TitleField
        rs("MessageField") = MessageField
        rs.update
        rs.Close
     response.write(request.querystring("id"))
        Set rs = nothing
    End If
     
             %>
             .
             .
             .
             .
             .
             .
             .
             .
                <%         
                 
                 Dim editor
                 Set editor = New CuteEditor
         
                 editor.ID = "Editor1"
                 editor.Text = MessageField
                 editor.FilesPath = "editor_files"
                 editor.ImageGalleryPath = "/uploads"
                 editor.MaxImageSize = 50
                 editor.AutoConfigure = "fscc"
                 'editor.Template= "Bold,Italic,Underline"
                 'editor.StyleSheetPath = "/grey2.css"
                 editor.Width = 490
                 editor.Height = 300
                 editor.Draw()
       
                 ' Request.Form("Editor1_HTMLContent") access from other page
      
                %>
     
     
    Let me know if you need anything else. Thank you.
     
     
     
  •  10-22-2004, 2:40 PM 2193 in reply to 2185

    Re: Updating info to existing pages

    Replace the following line:

     
    sql="select TitleField,MessageField from test where id=" & Request.Querystring("id")
     
    With
     
    sql="select TitleField,MessageField from test where id=" & Cint(Request.Querystring("id"))

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  10-22-2004, 2:49 PM 2194 in reply to 2185

    Re: Updating info to existing pages

    I did and nothing has changed.

     
     
    The text is not displaying at all (nothing is pulled from the database)
     
     
  •  10-22-2004, 2:54 PM 2195 in reply to 2185

    Re: Updating info to existing pages

    bnmiros,

     
    You need to query the database using the ID and populate the editor with the result.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  10-22-2004, 2:59 PM 2196 in reply to 2185

    Re: Updating info to existing pages

    So is there a code that I can implement to do that?

     
    I thought that was what this code was doing.
     
     Is this done purely with ASP, or is there some VBScripting involved?
     
    THIS IS REALLY URGENT. THANK YOU
     
    Could you help me understand the code above, and what it does so that I can try to addapt it to what I need, please.
     
    I am hoping that you can help me:
     
    You wanted answers to these questions and I've provided them.
     
    **********************
    1. What you are trying to do?
     
    2. what's database structure?
     
    3. Which page is used to display the content?
     
    4. Which page is used to edit/input the content?
     
    5. If you want to edit the existing record, how the record is pass to the edit page?

    After you finish the above general ASP questions,  I will explain how the CuteEditor is plugged in.
  •  10-22-2004, 4:45 PM 2197 in reply to 2185

    Re: Updating info to existing pages

    To query the database:

     

    sql="select TitleField,MessageField from test where id=" & Cint(Request.Querystring("id"))

    set rs2=conn.execute(sql)
    if not rs2.eof then
        itleField = rs2("TitleField")
        MessageField = rs2("MessageField")
        rs2.close
        set rs2=nothing
    end if
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  10-22-2004, 4:58 PM 2198 in reply to 2185

    Re: Updating info to existing pages

    So it this it??

     
     
     

    <%
     
              dim conn
              dim connstr
              Set conn = Server.CreateObject("ADODB.Connection")
              connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("test.mdb")
              conn.Open connstr
             
              dim content
             
    ID = Request("ID")
    If ID <> "" then
        sql="select TitleField,MessageField from test where id=" & Request.Querystring("id")
        'sql="select TitleField,MessageField from test where id="Request.Querystring("id")
        set rs=server.createobject("adodb.recordset")
        rs.open sql,conn,3,3         
        rs("TitleField") = TitleField
        rs("MessageField") = MessageField
        rs.update
        rs.Close
     response.write(request.querystring("id"))
        Set rs = nothing
    End If
     
          


    sql="select TitleField,MessageField from test where id=" & Cint(Request.Querystring("id"))

    set rs2=conn.execute(sql)
    if not rs2.eof then
        itleField = rs2("TitleField")
        MessageField = rs2("MessageField")
        rs2.close
        set rs2=nothing
    end if

      %>

     

     

     

                <%        
                
                 Dim editor
                 Set editor = New CuteEditor
        
                 editor.ID = "Editor1"
                 editor.Text = MessageField
                 editor.FilesPath = "editor_files"
                 editor.ImageGalleryPath = "/uploads"
                 editor.MaxImageSize = 50
                 editor.AutoConfigure = "fscc"
                 'editor.Template= "Bold,Italic,Underline"
                 'editor.StyleSheetPath = "/grey2.css"
                 editor.Width = 490
                 editor.Height = 300
                 editor.Draw()
      
                 ' Request.Form("Editor1_HTMLContent") access from other page
     
     %>
     
     
    COULD YOU PLEASE POST THE COMPLETE CODE ON HOW TO UPDATE/EDIT and HOW TO DISPLAY INFORMATION USING YOUR EDITOR.
     
    THAT WILL CONCLUDE OUR CORESPONDENCE ON THIS TOPIC OVER YOUR WEB SITE.

    Do you have an explanation on what your code does? Do you use purely ASP and SQL statements or do you also use VBScript? Is there anything else involved that I would need to learn in order to addapt your script to my needs?
     
  •  10-23-2004, 3:57 PM 2201 in reply to 2198

    Re: Updating info to existing pages

    Adam, could you help me please?
View as RSS news feed in XML