Jump to content

dhsd6061

Members
  • Posts

    19
  • Joined

  • Last visited

Everything posted by dhsd6061

  1. dhsd6061

    TRY.... CATCH

    Sorry, you in you will need to use the getlaterror.http://www.w3schools.com/asp/asp_ref_error.asp
  2. 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.
  3. dhsd6061

    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.
  4. dhsd6061

    Poll

    Use 'includes' and other encapsulation techniques along with standard oop coding practices to make your code more elegant.
  5. 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?
  6. Try here:http://www.w3schools.com/asp/showasp.asp?f...ame=demo_server
  7. 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.
  8. 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> <{POST_SNAPBACK}>
  9. Are the OS's on the two pc's the same or is one win98x and the other win2000 or above?
  10. 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
  11. dhsd6061

    What is wrong ?

    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 <{POST_SNAPBACK}>
  12. dhsd6061

    What is wrong ?

    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 <{POST_SNAPBACK}>
  13. dhsd6061

    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.
  14. dhsd6061

    browse algorithm

    duh....thanks.chris
  15. dhsd6061

    browse algorithm

    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
  16. 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
  17. 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
  18. 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...