Jump to content

dhsd6061

Members
  • Posts

    19
  • Joined

  • Last visited

Posts posted by dhsd6061

  1. Is one of these machines serving the web? ie. is the machine that does not get the error also act as the current web server? If so, can you try accessing this from a machine separate from the two you mention? Hook in a laptop if you don't have any more pc's on this network.

    Poll

    Maybe its just me, but I put my connection string in an 'include'; that way if the connection ever needs to be changed, I can do it in one place instead of fifty.... now I bet that would get repetitive. :)

    why use includes??? Includes make reusing repetitive code easy....none of the provided code makes sense to break into includes.  :)

    Poll

    Use 'includes' and other encapsulation techniques along with standard oop coding practices to make your code more elegant. :)

  2. I agree with asko1981. Use something like this:rs.Open "SELECT * FROM Books WHERE Price < " & highstring & " AND Price > " & lowstring & " ORDER BY BookTitle", conn%>What kind of results are you getting with the other statement?

  3. Do you want to display the column name in an html document? If so:do until rs.EOF for each x in rs.Fields Response.Write(x.name & "</br") rs.MoveNextloopuse 'x.value' for the value of the current field.

    Someone Help me How to Display Column name from an Recordset using ASP and  to store Result in HTML File

  4. I removed the html formatting for ease of reading. Good luck.<% for each x in rs.Fields if trim(x.name) = "" then Response.write("AVAILABLE") else Response.write("RESERVED") end if%></td><%next rs.MoveNext%> </tr><%looprs.closeWhat I want to do is have my display page show the word "RESERVED" for fields in my database that have SOMETHING (words, letters, numbers, characters-etc) typed in them. For fields that are blank or have nothing in them I want the word "AVAILABLE" displayed on the page. <%for each x in rs.Fieldsif x.name = "Time" then%><td align="center" valign="middle" style="background-color:#000099;font-family:Andy;color:#FFFF00;font-size:15pt;font-weight:bold;border:1px solid #666666"><%else%><td align="center" valign="middle" style="background-color:#66FFFF;font-family:Georgia;color:#663300;font-size:12pt;font-weight:normal;border:1px solid #666666"> <span class="style1"><%end if%><%Response.Write(x.value)%></div> </span> <div align="center"></div></td><%next rs.MoveNext%> </tr><%looprs.closeconn.close%></table></body></html>

  5. Hello,I have a drop down that is truncating the default value or the Request.form("foodbank") is truncating it: <% Response.write("<font face='Arial'>Foodbank ") Response.write("<select name='foodbank'>") Response.write("<option value=" & Request.form("foodbank") & ">" & Request.form("foodbank")) Response.write("<option value='Central Illinois Foodbank'>Central Illinois Foodbank") Response.write("<option value='Eastern Illinois Foodbank'>Eastern Illinois Foodbank") Response.write("<option value='Greater Chicago Food Depository'>Greater Chicago Food Depository") Response.write("<option value='Northern Illinois Food Bank'>Northern Illinois Food Bank") Response.write("<option value='Peoria Area Foodbank'>Peoria Area Foodbank") Response.write("<option value='Riverbend Foodbank'>Riverbend Foodbank") Response.write("<option value='St. Louis Area Foodbank'>St. Louis Area Foodbank") Response.write("<option value='Tri-State Foodbank'>Tri-State Foodbank") Response.write("</select></font>")%>when a value is chosen, such as 'Central Illinois Foodbank', and the form is posted to the same page, the choice appears in the dropdown. If the submit is clicked again, the value now appears as only 'Central' instead of 'Central Illinois Foodbank'. Any ideas on why this is a being truncated and how to stop it?? I have tried requesting the form data and putting into a variable, then filling the default value with the variable, but the same truncation happens.Any other ways to get the results I really need (the same value each and every time) would be welcome as well. thanks,chris

  6. See line 79... You need to reference your recordset and use quotations.ie:objPL.Open "UPDATE poll SET .......good luck.chris<%if poll<>"" then UPDATE poll SET " & poll & " = " & poll & " +1 WHERE po_id = Response.Write objPL("po_id")end ifobjPL.CloseSet objPL = NothingobjConn.CloseSet objConn = Nothing%>[/code]When I am trying to open it in explorer it says;Microsoft VBScript-kompileringsfeil error '800a0401' Forventet slutt på setning /tests/poll1.asp, line 79line 79 is; UPDATE poll SET " & poll & " = " & poll & " +1 WHERE po_id = Response.Write

  7. See line 79... You need to reference your recordset and use quotations.ie:objPL.Open "UPDATE poll SET .......good luck.chris<%if poll<>"" then UPDATE poll SET " & poll & " = " & poll & " +1 WHERE po_id = Response.Write objPL("po_id")end ifobjPL.CloseSet objPL = NothingobjConn.CloseSet objConn = Nothing%>[/code]When I am trying to open it in explorer it says;Microsoft VBScript-kompileringsfeil error '800a0401' Forventet slutt på setning /tests/poll1.asp, line 79line 79 is; UPDATE poll SET " & poll & " = " & poll & " +1 WHERE po_id = Response.Write

    CDbl

    Cdbl is a function to convert a number to the data type 'Double'. What this typically means is that a number defined as a byte, integer and long have nothing to right side of the decimal... ie. whole numbers. Defining a number as a double lets you contain this fractional data and also to display it. <% Response.write(cint(9 * .5) & "</br>") %>this outputs 4 because the answer 4.5 is converted to an integer.Check out these other converstion functions. Cstr, Cdate, Cint, Clng, Ccur, etc. One final hint for you, the syntax of these functions are typical of MS Visual Basic /vbscript.search for 'visual basic data type conversion'good luck. :):)

  8. Hello,Is there a canned version of the browse function descriibed below?I would like to include a text input box and browse button. The browse button should open a new window that lets the user browse their directory system and eventually choose a file. After ok'ing their choice the new window should disappear and the path to the file should appear in the text input box.thanks,chris

  9. Have you ever been able to do an INSERT query against this database in this web? If not, your permissions may not be correctly set.1. Right mouse click the access database icon.2. click properties3. select security tab4. click 'everyone' and view the permissions in window below.5. if the box next to 'write' is unchecked, check it6. ok7. Try query again.The above assumes you are on win2000I also suggest removing the 'on error resume next'. You need to know what error is being caused. Simple syntax stuff can drive you crazy without a little help.good luck.chris

  10. I am using session variables to authenticate the users. When I want to update information for my users, I need to spoof their agency number in my UPDATE and INSERT queries. I was wanting to create an Application recordset that I could use on any page without having to run a query everytime everytime I need to make an update.There is an example on W3Schools ASP tutorial on how to add an Application array variable that contains a recordset. Problem is, there is no information on how to traverse the array once it is created. The: for each i in Application("Logins") is the only way I know how to extract the data. If I have to write an algorithm to search the data and find what I need, I might as well just open a new recordset everytime which I can run quieries against. More functional and with the same amount or less coding.Any ideas??thanks,chris

  11. no it is not possible to run sql statements on Application variables.Is this how you are authenticating users to login to your site???If so you should use Session("user"), Session("password")...etc.Sessions are on a user by user basis and will expire when the browser is closed.An Application variable will not expire until the application is stopped via IIS. That means even when someone closes the browser, their credentials stay in the App variable and it keeps growing consuming more and more memoery until your app hangs.

  12. Hello,I have been writing my first asp application and am creating an Application variable to contain a recordset which contains login id, name, etc. I have been successfull in creating the variable, I call it Application("Logins"). My problem is accessing it in the asp pages. I am able to do:For each i in Application("Logins") Response.write("</br>" & iNextThis prints everything in the recordset. How can I access the infomation in the variable as if it were a recordset? ie. I would like run an SQL statement against it.SELECT name FROM App("Logins") WHERE 'UserID' = 'bill1'Is it possible? Is it possible to access records row by row.... App("Logins").MoveNext??? thanks,chris

×
×
  • Create New...