Advertisement

09.24.2007 at 01:18PM PDT, ID: 22849415
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

Check database for duplicate dates

Asked by JSmead in TCL Scripting Language, Active Server Pages (ASP)

Tags: , , ,

Hi experts,

This problem has got me stumped. I think this is a Asp1.1 page. What I'm trying to do is check the value from the Request.From("daterequest") textbox against an access database to see if that date is already in the database. The database field is of type "text" the for the submit button is below:

'Dimension variables
Dim adoCon              'Holds the Database Connection Object
Dim rsAddrecord   'Holds the recordset for the new record to be added
Dim strSQL               'Holds the SQL query to query the database
Dim searchstring

'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using DSN connection
adoCon.Open "DSN=appointment"

'Create an ADO recordset object
Set rsAddrecord = Server.CreateObject("ADODB.Recordset")

'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT * FROM appointment;"

'Set the cursor type we are using so we can navigate through the recordset
rsAddrecord.CursorType = 2

'Set the lock type so that the record is locked by ADO when it is updated
rsAddrecord.LockType = 3

'Open the recordset with the SQL query
rsAddrecord.Open strSQL, adoCon
*****************************************************************************
The code and the variables that are inside the code are the only lines that i wrote the rest if my boss
'searchstring = Request.From("daterequest")

If rsAddrecord.Find("daterequest = 02/20/2007") Then
window.open()
End If
******************************************************************************
Now I approached this problem thinking I would just do a recordset.find for the date. I wasn't able to get it to work hard coded and I don't know the syntax to do a .find for a variable string. The second thing i thought would work was to make a new recordset and fill it based on an SQL statement that pulled records WHERE daterequest = userdate then I would count the recordset and if it was greater than zero then "Date is already taken" but once again I couldn't get it to work. I'm not sure where I'm going wrong..

thanks experts

JamesStart Free Trial
[+][-]09.24.2007 at 01:23PM PDT, ID: 19951479

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: TCL Scripting Language, Active Server Pages (ASP)
Tags: duplicate, check, database, dates
Sign Up Now!
Solution Provided By: danataylor
Participating Experts: 2
Solution Grade: B
 
 
[+][-]09.24.2007 at 01:52PM PDT, ID: 19951689

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]10.15.2007 at 11:42AM PDT, ID: 20080424

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_1_20070628