CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 5 of 8 FirstFirst ... 2345678 LastLast
Results 61 to 75 of 114
  1. #61
    Join Date
    Jun 2013
    Posts
    102

    Re: VB Script will not remove modified data from Database

    Quote Originally Posted by DataMiser View Post
    It looks like you are not setting any value for either of the session vars you are trying to display

    In the first part of the script there is one line that would set one of the session vars if the If test succeeds but that line is commented out so nothing will be assigned and your result will be blank
    Hi again n thanks :-) I did leave that part of the script in but commented out for you to see if you thought it might do the job. Still not sure I have the Session' variable syntax sorted though.. any advice as to where it would be best placed or perhaps a more simplified method could be used and how ?? looking forward to your next reply as I may be able to get something done.

    Regards
    DA

  2. #62
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: VB Script will not remove modified data from Database

    see post #35 and #37
    Always use [code][/code] tags when posting code.

  3. #63
    Join Date
    Jun 2013
    Posts
    102

    Re: VB Script will not remove modified data from Database

    Quote Originally Posted by DataMiser View Post
    see post #35 and #37
    Hi DM… I’ve tested the little bit of code you suggested I use to create a session variable for the ColorName variable in the category_edit script. The code usedis shown below. It didn’t work and wouldn’t display the page at all. The error message shown by my browser is…
    ERROR SHOWN IN BROWSER……………..This website cannot display the page …………….
    /calendar/admin/category_edit.asp?iType=1223.
    When I create a new category it is assigned a unique numeric id in the ‘Type’ form which is called ‘TypeId’. The category name is stored there under the ‘TypeName’ field in text form and its associated colour is stored in the TypeColor field as I’ve shown below. In this instance I am trying to recover the category called TESTED and want to change either the ‘TypeName’ or ‘TypeColor’ information. This is why I am confused and am hoping you can understand why I… ‘Can’t see the woods for the trees’ as we say over here. I haven’t even looked at the category change problem yet. Any advice for me please 
    Type
    TypeId TypeName TypeColor
    1220 TESTING #F00

    Script code snippet
    Code:
    <%
    Dim LinkColorRS
    Dim ColChange
    Set LinkColorRS = Server.CreateObject("ADODB.Recordset")
    	LinkColorRS.Open "SELECT *  FROM LinkColor", Connect, 3, 3
    While (Not LinkColorRS.EOF)
        If (CategoryRS("TypeColor") = LinkColorRS("ColorCode")) Then ColChange=LinkColorRS("ColorName")
        Response.Write "<option STYLE='color: " & LinkColorRS("ColorCode") & " !important' value='" & LinkColorRS("ColorCode") & "'"
    If (CategoryRS("TypeColor") = LinkColorRS("ColorCode")) Then Response.Write "selected"
    	Response.Write">" & LinkColorRS("ColorName") & "</option>"
        LinkColorRS.MoveNext
    Wend
    	LinkColorRS.Close()
    	CategoryRS.Close()
    								%>
    Thanks again for your help… I look forward to the next reply ... hmm think I've just found a bug in the latest Internet explorer.... I can't see any of the menu or reply buttons..... guess i should look at why. I'm using Firefox as an alternative

  4. #64
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: VB Script will not remove modified data from Database

    That looks pretty much like what you have been posting before, still no use of Session() vars .
    There is no way I can tell you what you are doing wrong if I do not see the code that is giving a problem, since there is no Session vars int he code you posted I assume that is not it.

    Also there is no categoryRS there but your code seems to think there is, wasn't that test being done on a request() object before?
    Last edited by DataMiser; August 7th, 2013 at 06:32 PM.
    Always use [code][/code] tags when posting code.

  5. #65
    Join Date
    Jun 2013
    Posts
    102

    Re: VB Script will not remove modified data from Database

    Hmm… yes and thanks  I think I got a little mixed up with my cut and paste data trying to keep note s on what I am doing with you. Here is the code I used. Am Itrying to extract a value that is not available in that area perhaps?
    Code:
    <%
    ' If the Category Name field is empty, and the form has been submitted 			
    Dim Flag, Query
    Dim Change1
    If trim(Request("TypeName"))="" Then
    	If Flag Then
    		Response.Write "<p class='subtitle'>You must enter a category name.</p>"
    	' If Flag isn't true, show the edit form 
    	Else
    	Dim CategoryRS
    	Set CategoryRS = Server.CreateObject("ADODB.Recordset")
    		CategoryRS.Open "SELECT * FROM Type WHERE TypeId =" & Request("iType"), Connect, 2, 3
    	If (CategoryRS("TypeColor") = LinkColorRS("ColorCode")) Then Session("Change1")=LinkColorRS("ColorName")
    	End If
    %>
    Error message from web browser is………….

    Microsoft VBScript runtime error '800a000d'
    Type mismatch
    /calendar/admin/category_edit.asp, line 65…… 

  6. #66
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: VB Script will not remove modified data from Database

    I really have no idea what you are trying to do at this point. That is apparently a different section of code than what you showed last time as there is no loop in it and this section opens the categoryRS but not the LinkColorRS yet it uses both.

    Assuming LinkColorRS is valid then the assignment to the session var should be ok. But of course from that piece of code there is nothing to indicate LinkColorRS is valid and in the piece before you were opening LinkColorRS but not CategoryRS.

    As far as what area goes all I can see is what you showed and in this piece of code LinkColorRS is not declared nor set to an open recordset object.
    Always use [code][/code] tags when posting code.

  7. #67
    Join Date
    Jun 2013
    Posts
    102

    Re: VB Script will not remove modified data from Database

    Quote Originally Posted by DataMiser View Post
    I really have no idea what you are trying to do at this point. That is apparently a different section of code than what you showed last time as there is no loop in it and this section opens the categoryRS but not the LinkColorRS yet it uses both.

    Assuming LinkColorRS is valid then the assignment to the session var should be ok. But of course from that piece of code there is nothing to indicate LinkColorRS is valid and in the piece before you were opening LinkColorRS but not CategoryRS.

    As far as what area goes all I can see is what you showed and in this piece of code LinkColorRS is not declared nor set to an open recordset object.
    Hi Dm.. I know the code where this data is collected and corrected or changed is contained in the category_edit.asp script. All the variables used are in the one place as far as I can see. Perhaps I am not understanding where to put the session var ? It might help if I put it all here so you can see what I am trying to do. Basically I just want to extract the 2 values but they are a little elusive... does this help at all....

    Code:
    <%
    ' If the Category Name field is empty, and the form has been submitted 			
    Dim Flag, Query
    If trim(Request("TypeName"))="" Then
    	If Flag Then
    		Response.Write "<p class='subtitle'>You must enter a category name.</p>"
    	' If Flag isn't true, show the edit form 
    	Else
    	Dim CategoryRS
    	Set CategoryRS = Server.CreateObject("ADODB.Recordset")
    		CategoryRS.Open "SELECT * FROM Type WHERE TypeId =" & Request("iType"), Connect, 2, 3
    	End If
    %>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
                    <tr>      
                      <td align="left" valign="top"> 
                        <table width="100%" border="0" cellspacing="2" cellpadding="2">
                          <tr> 
                            <td height="205" align="left" valign="middle"><p>&nbsp;</p><form method="POST" action="<%= Request.ServerVariables("URL") %>" name="ADD">
                              <table align="center" class="textBold">
                                <tr valign="baseline"> 
                                  <td width="170" height="21" align="right" valign="middle" nowrap><span class="textEvent">Edit Category Name :</span>&nbsp;&nbsp;</td>
                                  <td width="313"> <input name="TypeName" type="text" class="form" value="<%=CategoryRS("TypeName")%>" size="50" maxlength="50"> 
                                    </td>
                                  </tr>
                                <tr valign="baseline">
                                  <td height="42" align="right" valign="middle" nowrap>&nbsp;</td>
                                  <td>&nbsp;</td>
                                </tr>
                                <tr valign="baseline"> 
                                  <td height="24" align="right" valign="middle" nowrap><span class="textEvent">Category Link Colour :</span>&nbsp;&nbsp;</td>
                                  <td> <select name="LinkColor">
                                    <%
    Dim LinkColorRS
    Set LinkColorRS = Server.CreateObject("ADODB.Recordset")
    	LinkColorRS.Open "SELECT *  FROM LinkColor", Connect, 3, 3
    While (Not LinkColorRS.EOF)
        Response.Write "<option STYLE='color: " & LinkColorRS("ColorCode") & " !important' value='" & LinkColorRS("ColorCode") & "'"
    If (CategoryRS("TypeColor") = LinkColorRS("ColorCode")) Then Response.Write "selected"
    	Response.Write">" & LinkColorRS("ColorName") & "</option>"
        LinkColorRS.MoveNext
    Wend
    	LinkColorRS.Close()
    	CategoryRS.Close()
    								%>
                                    </select> 
                                    </td>
                                  </tr>
                                <tr valign="baseline"> 
                                  <td height="24" align="right" nowrap>&nbsp;</td>
                                  <td> <p>&nbsp;
                                    </p>
                                    <p>
                                      <input name="Submit" type="submit" class="form" id="Submit" value="Submit">
                                    </p></td>
                                  </tr>
                                </table>
                              <input type="hidden" name="Flag" value="True">
                              <input type="hidden" name="TypeId" value="<%=Request("iType")%>">
                              </form>
                              <%
    ' If the form has been submitted (Flag = True), and the Category Name field isn't empty, update the record.
    Else
    
    Dim TypeRS
    Dim Msg
    	Query = "SELECT * FROM Type WHERE TypeId=" & Request("TypeId")
    	Set TypeRS = Server.CreateObject("ADODB.Recordset")
    	TypeRS.Open Query, Connect, 2, 3
    	TypeRS("TypeName") = Request("TypeName")
    	TypeRS("TypeColor") = Request("LinkColor")
    	TypeRS.Update
    	TypeRS.Close()
    	Response.Redirect("category.asp")
    End If
    						%>
    Looking forward to your reply..... regards... DA

  8. #68
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: VB Script will not remove modified data from Database

    I don;t know what else to tell you. I showed you where to put it in Post #35 and I showed you the syntax for using a session var in post #37. I have no idea why you tried to put it in a different place.

    As for the error in post #65 the LinkColorRS has not been defined at the top of the code and where you are trying to use it it does not exist. It is defined near the bottom and that is the area where I showed you to put the code. You simply have to match the colorcode to the right record and then set your var = to the colorname contained in that record.

    Again look at post #35 and Post #37 that should be all you need.
    Always use [code][/code] tags when posting code.

  9. #69
    Join Date
    Jun 2013
    Posts
    102

    Re: VB Script will not remove modified data from Database

    Quote Originally Posted by DataMiser View Post
    I don;t know what else to tell you. I showed you where to put it in Post #35 and I showed you the syntax for using a session var in post #37. I have no idea why you tried to put it in a different place.

    As for the error in post #65 the LinkColorRS has not been defined at the top of the code and where you are trying to use it it does not exist. It is defined near the bottom and that is the area where I showed you to put the code. You simply have to match the colorcode to the right record and then set your var = to the colorname contained in that record.

    Again look at post #35 and Post #37 that should be all you need.
    hi DM..... The advice you gave ... I think dealt with adding new categories with new colours and displaying detail, that bit is now working great. The database is keeping track of everything and recording everything it should do. If I click on an existing category to change details it is done in the form I pasted yesterday. This drags the information from the DB using the associated iType and allows me to make the mods to that record then writes those values back to the DB. I want to capture just those new changes and not recreate the whole category again. Does the advice you gave me still apply in this instance and if so could you point me to the right area of code in that last script. It's in that bit of code that I am trying to create a session var so I can write it to another blank asp file script. Thanks my friend :-)

  10. #70
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: VB Script will not remove modified data from Database

    I do not even know what you are referring to now, I thought we were talking about how to display the color name that goes with the color code?
    Always use [code][/code] tags when posting code.

  11. #71
    Join Date
    Jun 2013
    Posts
    102

    Re: VB Script will not remove modified data from Database

    Quote Originally Posted by DataMiser View Post
    I do not even know what you are referring to now, I thought we were talking about how to display the color name that goes with the color code?
    Hi DM.... ha ha now you know how easy it is for me to get totally lost at times, except you know what you are talking about and I don't. No that wasn't the issue, we resolved that problem weeks ago and it works perfectly, that was the last thread. This one deals with what happens when I want to change the information. I can change 2 of the variables.. The Category name and its associated colors once it has been created. What I want to do is display the modified information before I write it back to the database. This information is handled in the category_edit.asp script which bulls all of the values from the DB. I put all of the code on the board a couple of posts ago.... here's a quick refresh...

    Code:
    <%
    ' If the Category Name field is empty, and the form has been submitted 			
    Dim Flag, Query
    If trim(Request("TypeName"))="" Then
    	If Flag Then
    		Response.Write "<p class='subtitle'>You must enter a category name.</p>"
    	' If Flag isn't true, show the edit form 
    	Else
    	Dim CategoryRS
    	Set CategoryRS = Server.CreateObject("ADODB.Recordset")
    		CategoryRS.Open "SELECT * FROM Type WHERE TypeId =" & Request("iType"), Connect, 2, 3
    	End If
    %>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
                    <tr>      
                      <td align="left" valign="top"> 
                        <table width="100%" border="0" cellspacing="2" cellpadding="2">
                          <tr> 
                            <td height="205" align="left" valign="middle"><p>&nbsp;</p><form method="POST" action="<%= Request.ServerVariables("URL") %>" name="ADD">
                              <table align="center" class="textBold">
                                <tr valign="baseline"> 
                                  <td width="170" height="21" align="right" valign="middle" nowrap><span class="textEvent">Edit Category Name :</span>&nbsp;&nbsp;</td>
                                  <td width="313"> <input name="TypeName" type="text" class="form" value="<%=CategoryRS("TypeName")%>" size="50" maxlength="50"> 
                                    </td>
                                  </tr>
                                <tr valign="baseline">
                                  <td height="42" align="right" valign="middle" nowrap>&nbsp;</td>
                                  <td>&nbsp;</td>
                                </tr>
                                <tr valign="baseline"> 
                                  <td height="24" align="right" valign="middle" nowrap><span class="textEvent">Category Link Colour :</span>&nbsp;&nbsp;</td>
                                  <td> <select name="LinkColor">
                                    <%
    Dim LinkColorRS
    Set LinkColorRS = Server.CreateObject("ADODB.Recordset")
    	LinkColorRS.Open "SELECT *  FROM LinkColor", Connect, 3, 3
    While (Not LinkColorRS.EOF)
        Response.Write "<option STYLE='color: " & LinkColorRS("ColorCode") & " !important' value='" & LinkColorRS("ColorCode") & "'"
    If (CategoryRS("TypeColor") = LinkColorRS("ColorCode")) Then Response.Write "selected"
    	Response.Write">" & LinkColorRS("ColorName") & "</option>"
        LinkColorRS.MoveNext
    Wend
    	LinkColorRS.Close()
    	CategoryRS.Close()
    								%>
                                    </select> 
                                    </td>
                                  </tr>
                                <tr valign="baseline"> 
                                  <td height="24" align="right" nowrap>&nbsp;</td>
                                  <td> <p>&nbsp;
                                    </p>
                                    <p>
                                      <input name="Submit" type="submit" class="form" id="Submit" value="Submit">
                                    </p></td>
                                  </tr>
                                </table>
                              <input type="hidden" name="Flag" value="True">
                              <input type="hidden" name="TypeId" value="<%=Request("iType")%>">
                              </form>
                              <%
    ' If the form has been submitted (Flag = True), and the Category Name field isn't empty, update the record.
    Else
    
    Dim TypeRS
    Dim Msg
    	Query = "SELECT * FROM Type WHERE TypeId=" & Request("TypeId")
    	Set TypeRS = Server.CreateObject("ADODB.Recordset")
    	TypeRS.Open Query, Connect, 2, 3
    	TypeRS("TypeName") = Request("TypeName")
    	TypeRS("TypeColor") = Request("LinkColor")
    	TypeRS.Update
    	TypeRS.Close()
    	Response.Redirect("category.asp")
    End If
    						%>
    Perhaps this is why I though I had gone loopy :-) Is what I would like to do possible within the scope of this script?

    DA

  12. #72
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: VB Script will not remove modified data from Database

    To display data all you need to do is do a lookup. I mentioned this a few times already. It is very simple. You apparently know the value of the colorcode and that value is apparently in the table where the color name is so you use it to get the piece of data you want
    For example instead of a query like this one
    Code:
    CategoryRS.Open "SELECT * FROM Type WHERE TypeId =" & Request("iType"), Connect, 2, 3
    You would use one more like this
    Code:
    RS.Open "SELECT ColorName FROM LinkColor WHERE ColorCode =" & Request("ColorCode"), Connect, 2, 3
    Note those field/table names from the db or form may not be correct, just intended as an example for the concept
    Once you have the RS then you simply grab the data from RS!ColorName and either display it or put it in a var or session var for later use
    Always use [code][/code] tags when posting code.

  13. #73
    Join Date
    Jun 2013
    Posts
    102

    Re: VB Script will not remove modified data from Database

    Quote Originally Posted by DataMiser View Post
    To display data all you need to do is do a lookup. I mentioned this a few times already. It is very simple. You apparently know the value of the colorcode and that value is apparently in the table where the color name is so you use it to get the piece of data you want
    For example instead of a query like this one
    Code:
    CategoryRS.Open "SELECT * FROM Type WHERE TypeId =" & Request("iType"), Connect, 2, 3
    You would use one more like this
    Code:
    RS.Open "SELECT ColorName FROM LinkColor WHERE ColorCode =" & Request("ColorCode"), Connect, 2, 3
    Note those field/table names from the db or form may not be correct, just intended as an example for the concept
    Once you have the RS then you simply grab the data from RS!ColorName and either display it or put it in a var or session var for later use
    I'm sorry DM....I just can't grasp the concept. I don't know which field to grab. If I change the name for example from TEST to TESTED as I won't know what field to use given it has a new identity? I can identify the code that actually performs the change and writes it back to the DB which is what I think I have shown below. I can see where it opens the LinkColorRS and similarly where it opens the CategoryRS. What I don’t see or perhaps understand is how it modifies the information or where to capture just that information and having done so, where to put it into a session var declaration. I am confused and getting annoyed with myself because it seems so easy to explain what I think needs to be done yet so difficult to put words into actions. I think I will wait up and see what ideas you have. In the meantime I’ll carry on tweaking things that I can fully understand  Thanks DM
    Code:
    <input name="TypeName" type="text" class="form" value="<%=CategoryRS("TypeName")%>" size="50" maxlength="50"> 
                                    </td>
                                  </tr>
                                <tr valign="baseline">
                                  <td height="42" align="right" valign="middle" nowrap>&nbsp;</td>
                                  <td>&nbsp;</td>
                                </tr>
                                <tr valign="baseline"> 
                                  <td height="24" align="right" valign="middle" nowrap><span class="textEvent">Category Link Colour :</span>&nbsp;&nbsp;</td>
                                  <td> <select name="LinkColor">
                                    <%
    Dim LinkColorRS
    Set LinkColorRS = Server.CreateObject("ADODB.Recordset")
    	LinkColorRS.Open "SELECT *  FROM LinkColor", Connect, 3, 3
    While (Not LinkColorRS.EOF)
        Response.Write "<option STYLE='color: " & LinkColorRS("ColorCode") & " !important' value='" & LinkColorRS("ColorCode") & "'"
    If (CategoryRS("TypeColor") = LinkColorRS("ColorCode")) Then Response.Write "selected"
    	Response.Write">" & LinkColorRS("ColorName") & "</option>"
        LinkColorRS.MoveNext
    Wend
    	LinkColorRS.Close()
    	CategoryRS.Close()
    								%>
                                    </select>
    Last edited by davida1956; August 9th, 2013 at 07:26 PM. Reason: forgot quotes

  14. #74
    Join Date
    Jun 2013
    Posts
    102

    Re: VB Script will not remove modified data from Database

    Quote Originally Posted by davida1956 View Post
    I'm sorry DM....I just can't grasp the concept. I don't know which field to grab. If I change the name for example from TEST to TESTED as I won't know what field to use given it has a new identity? I can identify the code that actually performs the change and writes it back to the DB which is what I think I have shown below. I can see where it opens the LinkColorRS and similarly where it opens the CategoryRS. What I don’t see or perhaps understand is how it modifies the information or where to capture just that information and having done so, where to put it into a session var declaration. I am confused and getting annoyed with myself because it seems so easy to explain what I think needs to be done yet so difficult to put words into actions. I think I will wait up and see what ideas you have. In the meantime I’ll carry on tweaking things that I can fully understand  Thanks DM
    Code:
    <input name="TypeName" type="text" class="form" value="<%=CategoryRS("TypeName")%>" size="50" maxlength="50"> 
                                    </td>
                                  </tr>
                                <tr valign="baseline">
                                  <td height="42" align="right" valign="middle" nowrap>&nbsp;</td>
                                  <td>&nbsp;</td>
                                </tr>
                                <tr valign="baseline"> 
                                  <td height="24" align="right" valign="middle" nowrap><span class="textEvent">Category Link Colour :</span>&nbsp;&nbsp;</td>
                                  <td> <select name="LinkColor">
                                    <%
    Dim LinkColorRS
    Set LinkColorRS = Server.CreateObject("ADODB.Recordset")
    	LinkColorRS.Open "SELECT *  FROM LinkColor", Connect, 3, 3
    While (Not LinkColorRS.EOF)
        Response.Write "<option STYLE='color: " & LinkColorRS("ColorCode") & " !important' value='" & LinkColorRS("ColorCode") & "'"
    If (CategoryRS("TypeColor") = LinkColorRS("ColorCode")) Then Response.Write "selected"
    	Response.Write">" & LinkColorRS("ColorName") & "</option>"
        LinkColorRS.MoveNext
    Wend
    	LinkColorRS.Close()
    	CategoryRS.Close()
    								%>
                                    </select>
    Hi DM .... after much banging of head and gnashing of teeth I have almost been able to resolve the issue. I can now display the category name and its change on a new page but the color it shows is not the new color but the color it was changed from. So the code is one step behind... here is what I have done.....

    This bit works great :-)

    Code:
    <%
    ' If the form has been submitted (Flag = True), and the Category Name field isn't empty, update the record.
    Else
    
    Dim TypeRS
    Dim NewName
    	Query = "SELECT * FROM Type WHERE TypeId=" & Request("TypeId")
    	Set TypeRS = Server.CreateObject("ADODB.Recordset")
    	TypeRS.Open Query, Connect, 2, 3
    	TypeRS("TypeName") = Request("TypeName")
    	TypeRS("TypeColor") = Request("LinkColor")
    	If (TypeRS("TypeName") = TypeRS("TypeName")) Then Session("NewName")=TypeRS("TypeName")
    	TypeRS.Update
    	TypeRS.Close()
    	Response.Redirect("category_change.asp")
    End If
    						%>
    This bit is dodgy :-(

    Code:
    <%
    Dim NewColor
    Dim LinkColorRS
    Set LinkColorRS = Server.CreateObject("ADODB.Recordset")
    	LinkColorRS.Open "SELECT *  FROM LinkColor", Connect, 3, 3
    While (Not LinkColorRS.EOF)
        Response.Write "<option STYLE='color: " & LinkColorRS("ColorCode") & " !important' value='" & LinkColorRS("ColorCode") & "'"
    If (CategoryRS("TypeColor") = LinkColorRS("ColorCode")) Then Session("NewColor")=LinkColorRS("ColorName"
    	
    If (CategoryRS("TypeColor") = LinkColorRS("ColorCode")) Then Response.Write "selected"
    
    	Response.Write">" & LinkColorRS("ColorName") & "</option>"
    	)
    	
        LinkColorRS.MoveNext
    Wend
    	LinkColorRS.Close()
    	CategoryRS.Close()
    								%>
    The browser shows the following line above the correct category name and I have no idea why .....

    RS.Open "SELECT ColorName FROM LinkColor WHERE ColorCode =" & Request("ColorCode"), Connect, 2, 3



    I feel a little better and not quite as thick now :-) Oh... the problem with IE10 was compatability mode. If it is on I lose most of what I can now see on the screen.... the menu in effect....bold, italic, underscore etc etc. Is this something you guys look after from your end??
    DA

  15. #75
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: VB Script will not remove modified data from Database

    Quote Originally Posted by davida1956 View Post
    I'm sorry DM....I just can't grasp the concept. I don't know which field to grab. If I change the name for example from TEST to TESTED as I won't know what field to use given it has a new identity? I can identify the code that actually performs the change and writes it back to the DB which is what I think I have shown below. I can see where it opens the LinkColorRS and similarly where it opens the CategoryRS. What I don’t see or perhaps understand is how it modifies the information or where to capture just that information and having done so, where to put it into a session var declaration. I am confused and getting annoyed with myself because it seems so easy to explain what I think needs to be done yet so difficult to put words into actions. I think I will wait up and see what ideas you have. In the meantime I’ll carry on tweaking things that I can fully understand  Thanks DM
    Like I said to do a lookup you would do something like
    Code:
    RS.Open "SELECT ColorName FROM LinkColor WHERE ColorCode =" & Request("ColorCode"), Connect, 2, 3
    I'm not sure what you do not understand there, hard to follow your posts sometimes and that code is extremely hard to follow all jumbled together as it is and with me having no idea it that is the complete script, what data is being submitted and what is being passed on if anything.

    Try to keep it simple, focus on one thing at a time and the core of the code.
    Either you have the value you need to display at some point or you need to look it up, those are the only possibilities. The code I showed earlier lets you see the selected color name but apparently that was not what you wanted which means you most likely need to do a lookup hence the select query.

    This query requires you to have the colorcode available and allows you to get the matching colorname from the database which I assume is the case.
    Always use [code][/code] tags when posting code.

Page 5 of 8 FirstFirst ... 2345678 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured