Jump to content

Jerome

Members
  • Posts

    94
  • Joined

  • Last visited

Posts posted by Jerome

  1. hi!Try this :

    Dim timeNowtimeNow = nowResponse.Write(DateAdd("d",1,timeNow))

    I'm adding 1 day to the actual time. You can switch with h (hours), m (months), n (minutes), s (seconds) and yyyy (years)!

  2. What I am trying to do is I have a database that has percentages for the values.  And when I display the data if the number from the database is greater than 100% I want it to turn red and if it is less than 100% I want it to turn green.  Is it even possible?

    Yes it's possible,To display your datas from your access database, I assume you will use a loop condition. During the loop you will just have to check for every value if it's greater or smaller than 100. According to the result, you put the data in red or in green... Let's say you have a RecordSet object called Rs :
    Do While Not Rs.EOF If Rs("yourData") > 100 Then     Response.Write("<font color=""red"">" & Rs("yourData") & "</font><br>")Else     Response.Write("<font color=""green"">" & Rs("yourData") & "</font><br>")End IfRs.MoveNextLoop

  3. Hi,What exactly are you planning to do working from another computer? Just read, update and delete data from your database? Because if that is the case you don't need the install sql server... Try to explain with more detail your question.

  4. Hi damini,When a user logs in with a correct login and password then you can assign him a session (default time 20 minutes). Then, on the top of each of your asp pages you should put an include file called for e.g. validate_user.aspIn that file you will verify if the user that is trying to open any page of your site, has an active session, if it's not the case then your redirect him to the default.asp. Got it?Here is the explanation concerning the session object : http://www.w3schools.com/asp/asp_sessions.aspIn your validate_user.asp file you can put something like :

    <%If Len(Trim(session("userID"))) <= 0 Then    Response.Redirect ("../default.asp")End If%>

  5. HiHere you have a function that receives two parameters (highest and lowest number), the "Do Untill" loop provides you a random number between those two parameters, then you just have to put those values into your top and left variables.

    <%Function RandomNumber(intLowestNumber,intHighestNumber)      Do Until (RandomNumber >= intLowestNumber) And (RandomNumber <= intHighestNumber)      Randomize      RandomNumber = Int(Rnd * intHighestNumber) + 1	LoopEnd FunctionleftRndNumber = RandomNumber(5,600)topRndNumber = RandomNumber(5,600)%>

    Happy programming :)

  6. Hi,Now that we have such a nice moderating team, I really think it's necesary to let the users know when a problem is solved (and when it is not)... Here is an example from a french programming forum, you can see that when a problem has been solved, it's written ("[resolu]") next to title of the problem posted... So that you don't have to check every post, it's maybe not too important for the moment, but when you get more than 1000 post in one day (like this french forum does), it becomes really interesting...I would like to have your opinion on this. post-411-1132848239_thumb.png

  7. Denny,You are right, the problem is in your loop... your are asking the cursor to go throught the recordset untill he comes to the End Of File (EOF). If the table contains any value, there is no problem. But if it's empty, it just doesn't find any End Of File, and it keeps looking and looking untill you get an error...Instead, try to use a "Do While" loop like this :

    <%'...Do While Not rs.EOF And Not rs.BOF  Response.Write(rs("ime") & " " & rs("komentar") & " " & rs("vrijeme"))rs.MoveNextLoop'... %>

×
×
  • Create New...