473,396 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Inseting DateTime into MSAccess

I want to insert datetime values into msaccess using asp.net by vb.. Am getting error that Syntax Error in INSERT INTO statement...

My query is
strSQL="insert into group0 (name,addressline1,addressline2,landmark,city,stat e,pincode,telephone1,telephone2,altcontactno,busin esscategory,product,category,date) values('" & txtname.text & "','" & txtadds1.text & "','" & txtadds2.text & "','" & txtland.text & "', '" & txtcity.text & "', '" & txtstate.text & "' , '" & txtpin.text & "','" & txttel1.text & "','" & txttel2.text & "','" & txtmob.text & "','" & txtbus.text & "','" & txtpro.text & "','" & txtcat.text & "','" & now & "')"

please help me... send to my email id
Jan 29 '07 #1
2 3410
Date/Time fields in MS Access are delimited by the octothorpe (#), not the
single quote.

Robin S.
--------------------------------------
<tm***********@yahoo.com.sgwrote in message
news:un**************@TK2MSFTNGP06.phx.gbl...
>I want to insert datetime values into msaccess using asp.net by vb.. Am
getting error that Syntax Error in INSERT INTO statement...

My query is
strSQL="insert into group0
(name,addressline1,addressline2,landmark,city,stat e,pincode,telephone1,telephone2,altcontactno,busin esscategory,product,category,date)
values('" & txtname.text & "','" & txtadds1.text & "','" & txtadds2.text
& "','" & txtland.text & "', '" & txtcity.text & "', '" & txtstate.text &
"' , '" & txtpin.text & "','" & txttel1.text & "','" & txttel2.text &
"','" & txtmob.text & "','" & txtbus.text & "','" & txtpro.text & "','" &
txtcat.text & "','" & now & "')"

please help me... send to my email id

Jan 29 '07 #2
Well you can actually insert this as a string and as far as i know to every
database ( inclusive Access ) that acceptst the ISO 8601 standard

ISO 8601 implements a universal date format ( example : 2004-05-23T14:25:10)

YYYYMMDD

INSERT INTO Testtabel
(Test)
Values ('2007-01-01')
however as above wil function without problems on any system ( regrdless of
the date time settings )
the recomended way is to use Parameterized query`s in combination with a
..Net date type

HTH

Michel Posseth
"RobinS" wrote:
Date/Time fields in MS Access are delimited by the octothorpe (#), not the
single quote.

Robin S.
--------------------------------------
<tm***********@yahoo.com.sgwrote in message
news:un**************@TK2MSFTNGP06.phx.gbl...
I want to insert datetime values into msaccess using asp.net by vb.. Am
getting error that Syntax Error in INSERT INTO statement...

My query is
strSQL="insert into group0
(name,addressline1,addressline2,landmark,city,stat e,pincode,telephone1,telephone2,altcontactno,busin esscategory,product,category,date)
values('" & txtname.text & "','" & txtadds1.text & "','" & txtadds2.text
& "','" & txtland.text & "', '" & txtcity.text & "', '" & txtstate.text &
"' , '" & txtpin.text & "','" & txttel1.text & "','" & txttel2.text &
"','" & txtmob.text & "','" & txtbus.text & "','" & txtpro.text & "','" &
txtcat.text & "','" & now & "')"

please help me... send to my email id


Jan 29 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Brad Burke | last post by:
From a windows .Net app, I need to 1) check if MSAccess is already open to a certain Access application. If so, then open a form and find a certain record. 2) If not open, then open MSAccess and...
15
by: (Pete Cresswell) | last post by:
I've got a .BAT file that I use for executing various MS Access apps that I wrote way back in the days of 2.0. It's evolved over time, but it still contains a number of possible paths to...
2
by: Juggernath | last post by:
Hi, I spent all morning trying to find a way to select a datetime field from a table (I work with ASP) My SQL is "SELECT * FROM Mytbl WHERE myDate = #2.12.2003# " (I live in Croatia, so that's...
0
by: MLH | last post by:
I've been unable to determine the correct setting to force a copy of msaccess.exe to be written to target disk during runtime installation process. It may be that the runtime installation...
2
by: reidarT | last post by:
I am making an installation program for an Access application. The application is run on both Office 2000, 2002, 2003 and soon 2007 versions of Office, When I install the application I need a...
2
by: tmarunkumarit | last post by:
I want to insert datetime values into msaccess using asp.net by vb.. Am getting error that Syntax Error in INSERT INTO statement... My query is strSQL="insert into group0...
1
by: rolandsk | last post by:
I need help to schedule a MsAccess procedure I want the procedure to run in backgrund and not the MsAccess file to be open during the time when the procedure runs. The procedure in MsAccess picks...
4
by: preeti13 | last post by:
Hi friends i have a probelm i am try to pass the value to the employeeid parameter but getting th error please help me how i can do this i am getting the error here is my code using System;...
0
by: bbrewder | last post by:
I am struggling with some MSAccess automation issues. Basically, we have a .Net application that uses MSAccess for reporting (legacy code). We are able to launch MSAccess fine and even work with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.