Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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 November 13th, 2004, 06:44 AM
Authorized User
 
Join Date: Oct 2004
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default [Microsoft][ODBC Microsoft Access Driver] Syntax e

RE: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.

Hi, i am new to access dbase. my problem is that i get the above error in the following code
objrs.addnew
objrs("username")=strusername
objrs("date")=date
objrs("time")=time
objrs.update

I have seen microsoft documentation that says this could be a bug, but on another page in my asp application, i have used this exact code sequence to update another table and this error did not occur.
please advice

__________________
Everything takes longer than you expect!
 
Old November 13th, 2004, 07:39 AM
Authorized User
 
Join Date: Oct 2004
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, I made the following changes
objrs.addnew
objrs("username")=strusername
objrs("datein")=cstr(date)
objrs("timein")=cstr(time)
objrs.update
i also deleted my first db and created one with fields "username", "datein", and "timein" all text ("date" and "time" where of type date/time). It now works. my question therefore is why did the first one not work. furthermore, now that i have used string format instead of date/time in my db, can i still use sql to determine for example total time which requires summation of all times

 
Old November 15th, 2004, 03:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

You could have made just this change in the first case.
Code:
objrs("DateColumn")="#" & Date_and_time & "#"
formatted in either mm/dd/yyyy hh:mm:ss or yyyy-mm-dd hh:mm:ss

When you use those columns as TEXT types, you will have to do some patch work to do date/time calculations on those fields.

I would suggest to use date and time as single column and datatype as date/time. That should be the right way of approach for this.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old November 18th, 2004, 03:48 PM
Authorized User
 
Join Date: Oct 2004
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
Thanks for the help, i was begining to feel left out of the forum
:)




Similar Threads
Thread Thread Starter Forum Replies Last Post
ODBC Microsoft Access Driver Issue mat41 Classic ASP Professional 5 June 30th, 2008 10:37 AM
ERROR [42000] [Microsoft][ODBC driver for Oracle][ sanjeev jha General .NET 0 June 28th, 2008 12:50 AM
[Microsoft][ODBC SQL Driver]Connection is busy muthumari_p2003@yahoo.com Pro JSP 0 May 8th, 2006 07:51 AM
java.sql.SQLException: [Microsoft][ODBC Driver Man pvsharinath@gmail.com Java Databases 1 May 5th, 2005 02:40 AM
[ODBC Microsoft Access Driver] !!!Error!!! Varg_88 Classic ASP Databases 3 August 30th, 2004 06:19 AM





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