Date format problem

H

Herryandi

Hi all,

Im having date format in my ms sql server 2000
database. I always get a problem in inserting or updating
data because of my date format. Im taking the value of
date from textbox. This is how the code:

dim d as date
d = txtDate1.Text

and the sql string is like this

sqlStr1 = "INSERT INTO CONTACT Values( " & _
d.ToShortDateString & ",'" & txtName.Text
& "')"

The error is with the date format.
Anyone have any idea about this problem

Thanks

But
 
S

Sparky Arbuckle

What is the name of your Date Field in your database. I know that date
is a reserved word in Access.

Have you tried:

dim d as string
 
P

Patrick Olurotimi Ige

HerrYAndi
Guess it would be better if u write a stored procedure for ur SQl
insert!
Patrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top