.asp/ access help?
.asp/ access help?
.asp/ access help?
.asp/ access help?
.asp/ access help?
.asp/ access help? .asp/ access help? .asp/ access help? .asp/ access help? .asp/ access help? .asp/ access help? .asp/ access help? .asp/ access help?
.asp/ access help? .asp/ access help?
.asp/ access help?
Go Back  Xtreme Visual Basic Talk > > > .asp/ access help?


Reply
 
Thread Tools Display Modes
  #1  
Old 10-20-2005, 08:08 AM
Caoimhain Caoimhain is offline
Newcomer
 
Join Date: Oct 2005
Posts: 3
Default .asp/ access help?


Hi,
I don't know if I'm in the right forum, but I'm building a form using asp/access combo and I want to insert using a hidden field so that the form basically ads the date itself (not the user).

For some reason the form won't insert the record into the access dbase. Here's the error I get:

Microsoft JET Database Engine error '80040e07'

Data type mismatch in criteria expression.

/yoursite/form_add.asp, line 115



And here's the code i'm using:

<input name="EnterDate" type="hidden" id="EnterDate" value="EnterDate">

<input type="hidden" name="MM_insert" value="form_add">
</form>


If I take the 'EnterDate' value out the form works fine but doesn't insert the date. Anyone know why?
Reply With Quote
  #2  
Old 10-20-2005, 08:37 AM
wayneph's Avatar
wayneph.asp/ access help? wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

Quote:
Originally Posted by Caoimhain
I don't know if I'm in the right forum, but I'm building a form using asp/access combo and I want to insert using a hidden field so that the form basically ads the date itself (not the user).
You're in the right forum now.

If you are just trying to get the date that a record was submitted there is no reason to use a hidden field. You can add in the date on the server side using ASP. It actually makes your app a little more secure because people could still change the Hidden Variable. If it's just on the server, no one can touch it.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #3  
Old 10-20-2005, 09:11 AM
Caoimhain Caoimhain is offline
Newcomer
 
Join Date: Oct 2005
Posts: 3
Default

Quote:
Originally Posted by wayneph
You're in the right forum now.

If you are just trying to get the date that a record was submitted there is no reason to use a hidden field. You can add in the date on the server side using ASP. It actually makes your app a little more secure because people could still change the Hidden Variable. If it's just on the server, no one can touch it.
Thanks for info Wayne (love your avatar btw ;0) ). How would I go about doing it server side? (I'm a novice).

Cheers, Caoimhain.
http://www.irishbandslist.com/
Reply With Quote
  #4  
Old 10-20-2005, 11:02 AM
wayneph's Avatar
wayneph.asp/ access help? wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

Since you haven't posted the ASP code you're using to update Access, I can only assume that somewhere in your code you are looking for a value from request("EnterDate"). Basically at that point I would just replace it with "Now()"

If this is your code:
Code:
strSQL = strSQL & "#" & request("EnterDate") & "#, "
You could replace it with this to use the Now function in ASP:
Code:
'You use the # sign in Access to deliminate dates.
strSQL = strSQL & "#" & Now & "#, "
Or, this to use the Now function directly in Access
Code:
strSQL = strSQL & "Now, "
Another possibility would be to just set up a default value in your Access database, and you don't have to pass it in at all. Access will take care of it all behind the scenes.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
.asp/ access help?
.asp/ access help?
.asp/ access help? .asp/ access help?
.asp/ access help?
.asp/ access help?
.asp/ access help? .asp/ access help? .asp/ access help? .asp/ access help? .asp/ access help? .asp/ access help? .asp/ access help?
.asp/ access help?
.asp/ access help?
 
.asp/ access help?
.asp/ access help?
 
-->