Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 August 21st, 2003, 09:25 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default help...

i've done a page to edit a Access db, n i use it to edit another Access db, it cant work, it keep showing me the ms "error updating to db" all the columns is in text format, n i've to change it to date/time format for check, but it still cant update.
here is my sql statment, can any1 take a look n give some suggestion? thanks.

INSERT INTO Schedule1(Location, Date, Time) VALUES ( 'asdf', '#2/2/2002#' , '0300')

INSERT INTO Schedule1(Location, Date, Time) VALUES ( 'asdf', '#2/2/2002#' , '#03:00#')

INSERT INTO Schedule1(Location, Date, Time) VALUES ( 'asdf', '#2/2/2002#' , '#0300#')

 
Old August 21st, 2003, 09:30 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default

i think there is some problem for the sql statement or the Access database... but i just cant figure out the problem.
all the solution in my mind, i already tried it out...

 
Old August 22nd, 2003, 09:54 AM
Authorized User
 
Join Date: Jul 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Lose the single quotes from the date. You should not need them as the date is already incased in #

 
Old August 22nd, 2003, 01:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

INSERT INTO Schedule1(Location, Date, Time) VALUES ( 'asdf', '#2/2/2002#' , '0300')

INSERT INTO Schedule1(Location, Date, Time) VALUES ( 'asdf', '#2/2/2002#' , '#03:00#')

INSERT INTO Schedule1(Location, Date, Time) VALUES ( 'asdf', '#2/2/2002#' , '#0300#')


Should read like CraigJones said:

INSERT INTO Schedule1(Location, Date, Time) VALUES ( 'asdf', #2/2/2002# , 0300)

INSERT INTO Schedule1(Location, Date, Time) VALUES ( 'asdf', #2/2/2002# , #03:00#)

INSERT INTO Schedule1(Location, Date, Time) VALUES ( 'asdf', #2/2/2002# , #0300#)

Both time and dates can't have single quotes because they are not text fields(strings)
 
Old August 22nd, 2003, 08:20 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default

i've change the columns name in database to TheName n TheDate, n its works...
my sql statement is become like this:
INSERT INTO Schedule1 (Location, TheDate, TheTime) VALUES ('asdf', '2/2/2002', '1200')

all my colomns is in text format.
thanks for reply










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