主题:一段程序
sql程序strsql = "SELECT A.DELETE_FLG,B.DELETE_FLG ,F.DELETE_FLG,G.DELETE_FLG FROM M_CODE_1 as A"
strsql = strsql & "left join M_CODE_2 as B on A.CODE_1 = B.CODE_1"
strsql = strsql & "left join T_RECORD_TOTAL as C on A.CODE_1 = C.CODE_1"
strsql = strsql & "left join T_STUDENT_RECORD as D on C.STUDENT_ID = D.STUDENT_ID and D.CODE_2=B.CODE_2"
strsql = strsql & "left join T_BASE_INFO as E on E.STUDENT_ID = D.STUDENT_ID"
strsql = strsql & "left join M_SCHOOL as F on E.SCHOOL_ID = F.SCHOOL_ID"
strsql = strsql & "left join M_FULLTIME as G on F.SCHOOL_ID=G.SCHOOL_ID"
strsql = strsql & "where D.STUDENT_ID =" & id & "AND F.SCHOOL_NAME=" & school & "AND G.FULLTIME_NAME=" & Depart
adoRead = conStr.RunQueryCmd(strsql)
If adoRead.Read() Then
lblMessage.Text = "fsdfs"
C1delete = adoRead.GetValue(0)
C2delete = adoRead.GetValue(1)
Sdelete = adoRead.GetValue(2)
Fdelete = adoRead.GetValue(3)
adoRead.Close()
conStr.CloseConnection()
结果好象C1delete,C2delete,Sdelete,Fdelete没有获值
sql语句在查询分析器里能得到结果,应该没什么问题
但为什么If adoRead.Read() Then往后好象没有执行呢??
错在那里??
各位高手帮忙看看
strsql = strsql & "left join M_CODE_2 as B on A.CODE_1 = B.CODE_1"
strsql = strsql & "left join T_RECORD_TOTAL as C on A.CODE_1 = C.CODE_1"
strsql = strsql & "left join T_STUDENT_RECORD as D on C.STUDENT_ID = D.STUDENT_ID and D.CODE_2=B.CODE_2"
strsql = strsql & "left join T_BASE_INFO as E on E.STUDENT_ID = D.STUDENT_ID"
strsql = strsql & "left join M_SCHOOL as F on E.SCHOOL_ID = F.SCHOOL_ID"
strsql = strsql & "left join M_FULLTIME as G on F.SCHOOL_ID=G.SCHOOL_ID"
strsql = strsql & "where D.STUDENT_ID =" & id & "AND F.SCHOOL_NAME=" & school & "AND G.FULLTIME_NAME=" & Depart
adoRead = conStr.RunQueryCmd(strsql)
If adoRead.Read() Then
lblMessage.Text = "fsdfs"
C1delete = adoRead.GetValue(0)
C2delete = adoRead.GetValue(1)
Sdelete = adoRead.GetValue(2)
Fdelete = adoRead.GetValue(3)
adoRead.Close()
conStr.CloseConnection()
结果好象C1delete,C2delete,Sdelete,Fdelete没有获值
sql语句在查询分析器里能得到结果,应该没什么问题
但为什么If adoRead.Read() Then往后好象没有执行呢??
错在那里??
各位高手帮忙看看