0

I have VB6 app that has date picker control which has "dd-MMM-yyyy" format Now when user has regional setting set to French, month is displayed in French. Unfortunately I'm making query to Oracle data base with the input date, it gives invalid month error (ORA-01843) if the month is set in French. I don't want to change regional setting and my company is set on "dd-MMM-yyyy" format

Is there anyway to display the month in English on date picker?

joce
  • 9,624
  • 19
  • 56
  • 74
  • don't you want to convert the date to correct format before passing to the database? Why isn't the database in French? – Jodrell Mar 12 '13 at 17:40
  • 1
    Apparently you are taking the textual representation of the DatePicker contents and [injecting it into an SQL string](http://stackoverflow.com/q/332365/11683). You should instead take the `.Value` property and use parametrized statements. – GSerg Mar 12 '13 at 18:19
  • @Jodrell I didn't realize database language was changed also when regional setting is changed :( so I guess I have to stick with French date – user2162079 Mar 12 '13 at 18:30
  • @GSerg Nope, I am using .Value property – user2162079 Mar 12 '13 at 18:31
  • 1
    @user2162079 Yes, but how? `sql = "insert into t(v) values(" & DTPicker1.Value & ")"` would be using the textual representation. – GSerg Mar 12 '13 at 19:19
  • @GSerg I'm using ADODB.COMMAND so it would be TO_DATE(?,'DD/Mon/YYYY') and call CreateParameter – user2162079 Mar 12 '13 at 21:08
  • 1
    @user2162079 your're still specifying a format there. Does oracle not have a specific date literal format? Maybe [ISO 8601](http://xkcd.com/1179/)? Can you please udate your question with the relevant code. – Deanna Mar 13 '13 at 09:07

1 Answers1

0

Use ISO-8601 Date format.

The format: '1994-11-05T13:15:30'.

Look web: https://www.w3.org/TR/NOTE-datetime

Shadros
  • 728
  • 2
  • 10
  • 19