0
<code>
Private Sub CmbRNO_Click()
sql = "SELECT
          A.ROLLNO,A.FIRST_NAME,A.MIDDLE_NAME,A.LAST_NAME,A.CONTACT,A.CONTACT1,A.CONTACT2,A.ADDRESS,A.GRADE,B.DIV,A.BLOOD_GROUP,C.HOUSE,A.DATE_OF_BIRTH,A.TRANSPORT,A.SNAME,A.MEAL,A.BUSNO,A.RUTNO,D.DNAME,D.DCONT,E.ANM,D.DADD,A.CARD_TYPE,A.CARD_NO 
       FROM 
          STUDENT_RECORD_DATABASE A,DIVISION B,HNM C,DRIVER D,ATTEND E 
       WHERE 
          A.DIVID=B.DIVID AND A.HID=C.HID AND A.DID=D.DID AND A.AID=E.AID AND ROLLNO ='" & CmbRNO.Text & "'"

Set RES = CON.Execute(sql)
        TxtFNM.Text = RES!FIRST_NAME
        TxtMIDNM.Text = RES!MIDDLE_NAME
        TxtLNM.Text = RES!LAST_NAME
        Text5.Text = RES!CONTACT
        Text6.Text = RES!CONTACT1
        Text7.Text = RES!CONTACT2
        TxtADDR.Text = RES!ADDRESS
        COMBO1.Text = RES!GRADE
        CmbDIV.Text = RES!DIV
        CmbBG.Text = RES!BLOOD_GROUP
        CmbHOUSE.Text = RES!HOUSE
        DTPicker1.Value = RES!DATE_OF_BIRTH     //error showing
        Combo10.Text = RES!TRANSPORT
        CmbSTOP.Text = RES!SNAME
        Combo11.Text = RES!MEAL
        CmbBUS.Text = RES!BUSNO
        Combo12.Text = RES!RUTNO
        CmbDRIVER.Text = RES!DNAME
        TxtDCONT.Text = RES!DCONT
        CmbATTEND.Text = RES!ANM
        Text10.Text = RES!DADD
        Combo13.Text = RES!CARD_TYPE
        Text11.Text = RES!CARD_NO
 End If
 End Sub
</code>

这是在组合点击上显示学生记录的完整代码,
但错误是:Invalid property value date_of_birth

请帮忙

4

1 回答 1

0

这可能是 oracle 和 vb6 之间日期格式不同的结果。为避免这种情况,我会在选择这样的列时明确定义日期格式

SELECT
 A.ROLLNO,
 A.FIRST_NAME,
 A.MIDDLE_NAME,
 ...
 TO_CHAR(A.DATE_OF_BIRTH,'DD-MON-YYYY') DATE_OF_BIRTH
 ...

然后通过将其转换为日期在 VB6 中读取它:

DTPicker1.Value = CDate(RES!DATE_OF_BIRTH)
于 2013-01-23T12:04:10.003 回答