I created a Save button and I also have made the code for the Save button
But why the error message like this:

Run-time error '-2147217913(80040e07)
convension failed when converting the varchar value '28/08/2013 10:11:01 to data type bit

mohon bantuannya,
thanks,
V

Recommended Answers

All 14 Replies

As far as my understanding goes, you can't convert a date type to a bit type.

Stuugie:
I also do not understand why there is an error like this, but it is used typenya all data types DATE / TIME,
do i need to explain the code SAVE?
thanks

Member Avatar for Rahul47

I you are not applying the proper conversions. Post your code here.

can you give your save code?

this is my code:

SQLTambah = "INSERT INTO iMUSIC " & _
        "(ID_MUSIC, TITLE, SINGER, FID_M_CATEGORY, FILE_NAME, SOURCE, PATH, ACTIVE, VOL , ANALOG, DATE_ADDED)" & _
        " VALUES (" & _
        "'" & Text1.Text & "', " & _
        "'" & Text7.Text & "', " & _
        "'" & Text3.Text & "', " & _
         "'" & Text9.Text & "', " & _
        "'" & Text2.Text & "', " & _
         "'" & Text5.Text & "', " & _
        "'" & Text8.Text & "', " & _
         "'" & Label11.Caption & "', " & _
          "'" & Text10.Text & "', " & _
           "'" & Combo2.Text & "', " & _
            "'" & Label1.Caption & "' " & _ 'this is This label is used to display the date
        ")"
                 conn.Execute SQLTambah
Member Avatar for Rahul47

If datatype of DATE_ADDED is datetime in table iMUSIC, then you need to use a DateTimePicker instead of a Label.

While passing parameter you need to use conversion like this:

DateValue(DateTimePicker1.Value.Date)

Do the above and check.

Rahul47 :
how should bring a DateTimePicker?
I've been looking for the whole time of its existence but did not find,
please help,

Member Avatar for Rahul47

how should bring a DateTimePicker?

You can find it in Tool Box. Look harder you will find it.

can you tell what you are in search of ?
are you in search of how to add date and time?
I can't understand what you mean./..
so please can you elaborate it.?

DM Galaxy :
yes I am looking for the components of the date and time,
according to the suggestions of Rahul47, I have to use the DateTimePicker,
and I was looking for the location of the DateTimePicker,
if you can help me to find it?

Rahul47:

Okay I'll look harder about it,
okay thanks for all the advice and help,
regards,

Member Avatar for Rahul47

I don'see how you are not able to find DateTimePicker as it is present in ToolBox itself. I hope you are not missing it by chance.

as to see the code of date and time then watch the below codes:
Label1 as time and
label2 as date

Label1.Text = TimeOfDay
Label2.Text = DateString

I think this code will tell you the time as well as date too.
If i just misunderstood what you tell me then please correct me by elaborating the data...

oh I've found the components of the
thank you for all your help,

Vivi

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.