473,396 Members | 1,929 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.

Insert DTPicker in Access DB

1
Masters, please help me with my DTPicker.. I want it to be saved in my db (access). But it always says: "Syntax Error in Insert Into Statement"

And this is my code:

Dim statement1 As String
Dim conn1 As ADODB.Connection

Set conn1 = New ADODB.Connection
conn1.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\DB.mdb"
conn1.Open

statement1 = "INSERT INTO tblDPSR (Date) VALUES (' " & Me.DTPicker1.value & " ' )"

conn1.Execute statement1, , adCmdText




..and my Date in Access is Date/Time
Feb 25 '12 #1
1 4340
you may try this one:

statement1 = "INSERT INTO tblDPSR (Date) VALUES (' " & DateValue(DTPicker1.Value) & " ' )"

conn1.Execute statement1, , adCmdText
Feb 27 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: thejackofall | last post by:
Hi. This is killing me. I am trying to insert a row into an Access table, but it's giving me an exception as below. "Syntax error in INSERT INTO statement." When I debug and look at the...
5
by: Jazper | last post by:
Hi i got a big problem and don't know how to solve it... i have an access DB and try to insert a new record! Fild1: ID - Numeric - PrimaryKey Fild2: User - Text //---My...
1
by: Abareblue | last post by:
I have no clue on how to insert a record into access. here is the whole thing using System; using System.Drawing; using System.Collections; using System.ComponentModel;
3
by: Ekhaat | last post by:
Hi I followed the Web Matrix guided tour and came to the "ASP.NET Pages with Data (Microsoft Access)" part. There is really not much you can do wrong there, but for some reason, the INSERT...
1
by: Mike | last post by:
I have asp.net web app (C#) where i'm trying to insert data into a table and i'm gettng the following error. I'm not updating anything i'm trying to insert via my SQL. I'm getting an error now...
2
by: tpafr | last post by:
Hi, I would like to insert multiple rows in an Access DB from a datagrid (or a txt file) It is very slow for large number of insertions(5000 -> >30 seconds !). Is there another way to do this ...
7
by: evilash | last post by:
Hi, am new to c# so any help here would be greatly appreciated. Am trying to insert into my access database called Users.mdb located in my app data folder. My current code is as follows: ...
2
by: cday119 | last post by:
Can someone help me out with this one. I am trying to insert a row of data into an access database. The primary key is set to auto increment. It will work once but the next time you try an insert...
1
by: ajmani | last post by:
how data insert and access in vaspread sheet in vb6
0
by: Ed Pisa | last post by:
Hello, I have been working with this problem now for several days. I can delete and Update my data but I can not get it to insert a new record. I receive the syntax error insert into. I am not...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.