如何在vb6和oracle中设置DTPICKER1的日期格式? [英] How to set date format of DTPICKER1 in vb6 and oracle?

查看:327
本文介绍了如何在vb6和oracle中设置DTPICKER1的日期格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Private sub cmbrollno_click()
x = Format(DTPicker1.Value, "dd-mmm-yyyy")
        DTPicker1.Value = RES!DATE_OF_BIRTH
End sub



我在combo中编写了这段代码 - rollno click event。我没有将date_of_birth加载到form_load事件上。我在各种控件中使用此代码,例如:command1 - Inserting,command2 - 更新和组合rollno - 显示所选卷号的信息。

我想问一下这个代码在语法上是否正确用于vb6?或代码应放在其他事件或其他任何东西?



插入和更新记录时,它给出的错误如下:无效使用财产

请帮帮我.....


I wrote this code in combo - rollno click event.I do not loaded date_of_birth onto form_load event.I am using this code at various controls like: command1 - Inserting, command2 - Updating and combo rollno - displaying info of selected roll no.
I wanted to ask that is this code syntactically correct to be used in vb6? or code should be placed in other event or anything else?

While inserting and updating records it is giving error like: Invalid Use of Property.
Please help me.....

推荐答案

我在我的项目中使用以下代码





可能以下代码将有所帮助



I am using following code in my project


May be following code will help

DTPicker1.Value = Date
DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = "dd/MM/yyyy"





及其工作方式如魅力



and its working like charm


这篇关于如何在vb6和oracle中设置DTPICKER1的日期格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆