Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 3rd, 2004, 11:00 AM
Registered User
 
Join Date: Dec 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error with SQL UPDATE

I am using an Access database behind some Intranet pages and I have an ASP script that updates one of the tables in the database.....straight forward enough !!

Unfortunately the update script works when run on 2 out of 3 Windows 2000 machines and fails with a datatype mismatch on the 3rd !! All machines are running the same code against identical copies of the database.

Any idea's anyone?

 
Old December 3rd, 2004, 11:16 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Can you post your code?

 
Old December 3rd, 2004, 11:37 AM
Registered User
 
Join Date: Dec 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The code in question is:

"insert into user_time (initials, date_worked, time_from, time_to, num_hours) Values('" & request("u") & "','" & Request.Form("date") & "','" & Request.Form("time_from") & "','" & Request.Form("time_to") & "'," & Hours & ")"



 
Old December 3rd, 2004, 11:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

It is probably a question of date-formats. Have you checked the locale settings?

 
Old December 3rd, 2004, 12:48 PM
Registered User
 
Join Date: Dec 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I already have <%@Language=vbscript LCID=2057%> specified at the top of the script which has stopped previous date problems from occurring. Does this have an affect on the SQL dates?
 
Old December 3rd, 2004, 03:02 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Have you tried putting ## around Response.Form("date")?

 
Old December 3rd, 2004, 03:32 PM
Registered User
 
Join Date: Dec 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, I have tried the #'s. I have had problems with this machine before as it assumes American date format. Maybe this is causing the problem when writing to the DB.
 
Old December 4th, 2004, 05:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

What are the datatypes of the DBFields?

 
Old December 4th, 2004, 05:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

Try looking for differences between the three windows-installations - are they set to the same locale? Do they have the same level of patches? If you're using ODBC to connect to the DB check the ODBC-versions on the machines aso.






Similar Threads
Thread Thread Starter Forum Replies Last Post
T-SQL statement causing error with insert/update saf SQL Language 0 September 7th, 2007 04:48 PM
SQL Update query (error message) Neal SQL Server 2000 1 August 3rd, 2007 08:57 PM
update sql kim Beginning VB 6 0 April 2nd, 2006 02:25 PM
Access SQL Update Error lindsay SQL Language 4 April 20th, 2004 02:40 PM
Update sql dhborchardt Classic ASP Databases 1 June 10th, 2003 10:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.