Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error inserting mm/dd/yyyy 1

Status
Not open for further replies.

schase

Technical User
Sep 7, 2001
1,756
US
I have my access2000 database set up to take short date format (mm/dd/yyyy).

I have the date values passing along great to the insert page, the url will show like month=6&day=11&year=2002 but then It wont let me combine the month/day/year into one value of mm/dd/yyyy to insert.

here is my code, any suggestions are greatly appreciated.
the MM_EPHIntra_String is part of Dreamweaver's code, and I have left the response.redirect empty on purpose to see how it's passing values.


<%
Dim RS
set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rs.ActiveConnection = MM_EPHIntra_STRING
rs.Source = &quot;SELECT Top 1 * FROM tblTasks&quot;
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 3
rs.Open()
%>
<%
rs.addnew
rs(&quot;fldUser&quot;)= Request.cookies(&quot;EPHUsername&quot;)
rs(&quot;fldSubject&quot;)= Request.Form(&quot;txtTaskSub&quot;)
rs(&quot;fldTaskDetail&quot;)= Request.Form(&quot;txtTaskDetail&quot;)
rs(&quot;fldDateDue&quot;)= &quot;#&quot; & Request.Form(&quot;month&quot;) & &quot;/&quot; & Request.Form(&quot;day&quot;) & &quot;/&quot; & Request.Form(&quot;year&quot;) & &quot;#&quot;
rs.update
response.redirect &quot;&quot;
%> &quot;I like a man who grins when he fights.&quot;

-- Prime Minister Winston Churchill

Stuart
 
Try combining the string into a variable and assigning that to your recordset. Also, write out the variable to ensure that you are getting the values that you expect in your string.


Dim dtDueDate
dtDueDate = &quot;#&quot; & Request.Form(&quot;month&quot;) & &quot;/&quot; & Request.Form(&quot;day&quot;) & &quot;/&quot; & Request.Form(&quot;year&quot;) & &quot;#&quot;
Response.write(&quot;Date is &quot; & dtDueDate & &quot;<br>&quot;)

rs.addnew
rs(&quot;fldUser&quot;)= Request.cookies(&quot;EPHUsername&quot;)
rs(&quot;fldSubject&quot;)= Request.Form(&quot;txtTaskSub&quot;)
rs(&quot;fldTaskDetail&quot;)= Request.Form(&quot;txtTaskDetail&quot;)
rs(&quot;fldDateDue&quot;)= dtDueDate
rs.update
response.redirect &quot;&quot;
 
found a few errors that I had done - and your suggestions made me find them, for the future - as long as the form is set on post, the second page should not have the &quot;#&quot;

darn ufo's

Thanks again
&quot;I like a man who grins when he fights.&quot;

-- Prime Minister Winston Churchill

Stuart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top