Hello Friend!
I am new for ASP. Database is Microsoft Access. So pls help me.....
My problem is ---
1. In login page, two text boxs. first textbox is username & second textbox is Password. Password is Date of Birth.
If DOB is starting 09-08-90 or 11-01-91 is not login or DOB is starting more than 13 (13-03-91 or 28-11-91) is succefully login.
2. So I check, How? the date is print. Below code - if IsDate(rs("DOB")) then
-
Response.Write(CDate(pwd) & "<br>") --- output is (11/2/90)
-
Response.Write(rs("DOB") & "<br>") --- output is (2/11/90)
-
else
-
Response.Write("Error")
-
end if
3. How i can solve this?
4.Because in my program, I check the ( if rs("DOB")= CDate(pwd) then)
Pls check the below coding... and reply me immediately is very very urgent advances thanks....... -
-
<%
-
dim uname
-
dim pwd, password, varDate
-
uname = Request.Form("txtUname")
-
uname = UCASE(uname)
-
Session.Contents("IDNO") = uname
-
pwd = Request.Form("txtPwd")
-
Set rs = Server.CreateObject("ADODB.Recordset")
-
Set rs.ActiveConnection = my_Conn
-
rs.Open "SELECT * FROM " & TBL_Data &" where "& TFL_IDNO & " = '" & Session.Contents("IDNO") & "'", my_Conn, 1
-
if rs.RecordCount = 0 then
-
rs.Close
-
my_Conn.Close
-
set rs=nothing
-
set my_Conn=nothing
-
Response.Redirect("verify.asp?Submit=namefailed")
-
end if
-
if isdate(pwd) then
-
if rs("DOB")= CDate(pwd) then
-
rs.Close
-
my_Conn.Close
-
set rs=nothing
-
set my_Conn=nothing
-
Response.Redirect("verifyParticulars.asp")
-
end if
-
else
-
alert("Wrong Password Format")
-
end if
-
rs.Close
-
my_Conn.Close
-
set rs=nothing
-
set my_Conn=nothing
-
Response.Redirect("verify.asp?Submit=passfailed")
-
-
%>
7 2202
Hello Friend!
I am new for ASP. Database is Microsoft Access. So pls help me.....
My problem is ---
1. In login page, two text boxs. first textbox is username & second textbox is Password. Password is Date of Birth.
If DOB is starting 09-08-90 or 11-01-91 is not login or DOB is starting more than 13 (13-03-91 or 28-11-91) is succefully login.
2. So I check, How? the date is print. Below code - if IsDate(rs("DOB")) then
-
Response.Write(CDate(pwd) & "<br>") --- output is (11/2/90)
-
Response.Write(rs("DOB") & "<br>") --- output is (2/11/90)
-
else
-
Response.Write("Error")
-
end if
3. How i can solve this?
4.Because in my program, I check the ( if rs("DOB")= CDate(pwd) then)
Pls check the below coding... and reply me immediately is very very urgent advances thanks....... -
<%
-
dim uname
-
dim pwd, password, varDate
-
uname = Request.Form("txtUname")
-
uname = UCASE(uname)
-
Session.Contents("IDNO") = uname
-
pwd = Request.Form("txtPwd")
-
Set rs = Server.CreateObject("ADODB.Recordset")
-
Set rs.ActiveConnection = my_Conn
-
rs.Open "SELECT * FROM " & TBL_Data &" where "& TFL_IDNO & " = '" & Session.Contents("IDNO") & "'", my_Conn, 1
-
if rs.RecordCount = 0 then
-
rs.Close
-
my_Conn.Close
-
set rs=nothing
-
set my_Conn=nothing
-
Response.Redirect("verify.asp?Submit=namefailed")
-
end if
-
if isdate(pwd) then
-
if rs("DOB")= CDate(pwd) then
-
rs.Close
-
my_Conn.Close
-
set rs=nothing
-
set my_Conn=nothing
-
Response.Redirect("verifyParticulars.asp")
-
end if
-
else
-
alert("Wrong Password Format")
-
end if
-
rs.Close
-
my_Conn.Close
-
set rs=nothing
-
set my_Conn=nothing
-
Response.Redirect("verify.asp?Submit=passfailed")
-
-
%>
Hi shivasusan,
Welcome to Bytes.com. Please don't double post your questions - it is against the rules laid out in the Posting Guidelines. If you wish to add more information or you want to 'bump' your thread back to the top of the list then you can simply reply to it.
Please don't forget to wrap your code in CODE tags - it makes your posts much easier to read.
You have posted another question about date formatting in the forum which I have answered - does this help you with the problem above? If not can you try to explain your problem again as i'm not sure what it is - are you getting an error?
Dr B
This is a common problem. In the US the standard date format is mm/dd/yy (because we would say October 7th rather than 7th of October) whereas in the rest of the English-speaking world the standard date format is dd/mm/yy. Since MS is a US-based company, unless you specify otherwise, all MS products assume that date in US format is correct, but dates in other formats are incorrect and are recorded as text, not as a date. To resolve this issue, all dates must be saved in unambiguous date formats (such as 2008-Oct-07 or 07-Oct-2008) or specify that this field in the db is a text field rather than a date field.
Jared
This is a common problem. In the US the standard date format is mm/dd/yy (because we would say October 7th rather than 7th of October) whereas in the rest of the English-speaking world the standard date format is dd/mm/yy. Since MS is a US-based company, unless you specify otherwise, all MS products assume that date in US format is correct, but dates in other formats are incorrect and are recorded as text, not as a date. To resolve this issue, all dates must be saved in unambiguous date formats (such as 2008-Oct-07 or 07-Oct-2008) or specify that this field in the db is a text field rather than a date field.
Jared
Hi Jared!
Thanks for your reply.
I try to convert the date dd/mm/yy to mm/dd/yy. I got answer, but i don't know its correct way. Please check my coding and reply me... - <%
-
-
dim uname
-
dim pwd, password, changepwd
-
dim mm, dd, yy, mmddyy, repwd
-
-
uname = Request.Form("txtUname")
-
uname = UCASE(uname)
-
Session.Contents("IDNO") = uname
-
Session.Timeout = 120
-
-
pwd = Request.Form("txtPwd")
-
-
repwd=Replace(pwd,"/","_")
-
-
dd = Mid(repwd,1,2)
-
mm = Mid(repwd,4,2)
-
yy = Mid(repwd,7,2)
-
-
mmddyy = mm & "/" & dd & "/19" & yy
-
-
Set rs = Server.CreateObject("ADODB.Recordset")
-
Set rs.ActiveConnection = my_Conn
-
-
rs.Open "SELECT * FROM " & TBL_Data &" where "& TFL_IDNO & " = '" & Session.Contents("IDNO") & "'", my_Conn, 1
-
-
-
if rs.RecordCount = 0 then
-
rs.Close
-
my_Conn.Close
-
set rs=nothing
-
set my_Conn=nothing
-
Response.Redirect("verify.asp?Submit=namefailed")
-
end if
-
-
if isdate(mmddyy) then
-
password = FormatDateTime(mmddyy,0)
-
if rs("DOB")= CDate(password) then
-
rs.Close
-
my_Conn.Close
-
set rs=nothing
-
set my_Conn=nothing
-
Response.Redirect("verifyParticulars.asp")
-
end if
-
else
-
end if
-
rs.Close
-
my_Conn.Close
-
set rs=nothing
-
set my_Conn=nothing
-
Response.Redirect("verify.asp?Submit=passfailed")
-
%>
Regards,
susan
Changing to mm/dd/yy is only a partial fix and I wouldn't do that for something that is going to stay permanent. The best permanent fix would be to change it to Mmm/dd/yyyy or some such variation where Mmm is the three-letter abbreviation for the month.
This is the problem: If a user enters 10/12/2008 or 12/10/2008 there is no way you can be sure you know which date he means and there is no way to ensure that he will write it the same way next time (experienced internet users are used to seeing different formats requested depending on the regional location of the coder). It would be much better to select a date from a drop down list or calendar control, but I understand that is not ideal for a password.
You could make the field be plain text in the db (varchar(8 or 10)) and then it wouldn't matter what the user entered, it would be his responsibility to get it the same way the next time.
You could assume that all of your users are going to enter the date in the same format, then your solution is valid, but the easiest way would be to specify a different region coding in your asp script (as DrBunchman suggested in another thread recently, maybe it was posted by you, I don't remember) or in the db. But if you don't want to do that, the simplest solution would be to ask the users to enter the date in a format like this: "12/Oct/2008" or "12-Oct-2008". I have seen all sorts of variations on this format and all are accepted and interpreted correctly by the db, even when put in apparently random order. Then even if the site owner comes to you later and says, "I don't like the date format '12-Oct-2008'. Can we enter the date as 'October 12, 2008'?" and you can say, "why yes. I'll add a special patch to allow you to enter dates that way. It will cost you another $350 ." but you won't even have to do anything, because the db and the script will still know how to handle it.
From my point of view, the solution you give has the same weakness as the original, it just assumes that the other date format will be used. Does this make sense?
Jared
Changing to mm/dd/yy is only a partial fix and I wouldn't do that for something that is going to stay permanent. The best permanent fix would be to change it to Mmm/dd/yyyy or some such variation where Mmm is the three-letter abbreviation for the month.
This is the problem: If a user enters 10/12/2008 or 12/10/2008 there is no way you can be sure you know which date he means and there is no way to ensure that he will write it the same way next time (experienced internet users are used to seeing different formats requested depending on the regional location of the coder). It would be much better to select a date from a drop down list or calendar control, but I understand that is not ideal for a password.
You could make the field be plain text in the db (varchar(8 or 10)) and then it wouldn't matter what the user entered, it would be his responsibility to get it the same way the next time.
You could assume that all of your users are going to enter the date in the same format, then your solution is valid, but the easiest way would be to specify a different region coding in your asp script (as DrBunchman suggested in another thread recently, maybe it was posted by you, I don't remember) or in the db. But if you don't want to do that, the simplest solution would be to ask the users to enter the date in a format like this: "12/Oct/2008" or "12-Oct-2008". I have seen all sorts of variations on this format and all are accepted and interpreted correctly by the db, even when put in apparently random order. Then even if the site owner comes to you later and says, "I don't like the date format '12-Oct-2008'. Can we enter the date as 'October 12, 2008'?" and you can say, "why yes. I'll add a special patch to allow you to enter dates that way. It will cost you another $350 ." but you won't even have to do anything, because the db and the script will still know how to handle it.
From my point of view, the solution you give has the same weakness as the original, it just assumes that the other date format will be used. Does this make sense?
Jared
Hi!
Thank you, for your reply.
I changed the db fieldname into text. But my Boss didn't accept. Try to do the fieldname in date format, Pls help me.... is any way to do these....
Regards,
Susan
Which part does your boss not like? Does he just want the db field to be a DateTime field? Does he insist the date needs to be entered by the user in a particular format?
Jared
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Laurence Neville |
last post by:
This is regarding a change in the Short Date format under Hebrew Regional
Settings, that has caused huge problems in our ASP web application. The
change appears to have been introduced sometime...
|
by: martini |
last post by:
Need help:
I am trying to call a DB2 stored procedure that requires parameters: 4x int,
date, varchar, int. I use VB6 & oledb.
I'm using statements:
cmd.CommandText = "{call db2admin.proc(1, 0,...
|
by: David B |
last post by:
I have 2 querys with the following in the date criteria
Between DateAdd("m",-6,(!!)) And
(!!)
Between DateAdd("m",-24,(!!)) And
DateAdd("m",-6,(!!))
Problem is they both look at the same...
|
by: Dustin Wilson |
last post by:
I have a problem with the following line of code.
rstOutput! = FormatDateTime("January 1, 2004", vbLongDate)
When I run this on my computer at home it runs without problem but when I
run it at...
|
by: Lyn |
last post by:
Hi,
I am developing a project in which I am checking for records with
overlapping start/end dates. Record dates must not overlap date of birth,
date of death, be in the future, and must not...
|
by: Julie Wardlow |
last post by:
Help!
I am calculating a future date using the DateAdd function in a query (the
calculation also involves an IIf statement), and have managed to get this
formula to produce the required result....
|
by: TN Bella |
last post by:
Hello,
I was looking through the older posts for a solution to this problem,
but I am still confused on how to fix my problem. There are two dates on
my form, one (txtInvDate) is entered by the...
|
by: James P. |
last post by:
Hello there,
In my asp.net page using VB, I have a date text field in mm/dd/yyyy
format. When a date is entered, I'd like to validate it to make sure
the date is greater than or equal to the...
|
by: Jim Armstrong |
last post by:
Hi all -
This problem has been driving me crazy, and I'm hoping the answer is
something stupid I am neglecting to see....
The procedure posted below is part of an Access/SQL database I have...
|
by: creative1 |
last post by:
Hello everyone.
I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this.
The problem is:
I want to print account statement (or any other...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |