标题:sql程序
只看楼主
jdw1984228
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2006-12-8
 问题点数:0 回复次数:2 
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往后好象没有执行呢??
错在那里??
各位高手帮忙看看
不甚感激
搜索更多相关主题的帖子: sql 
2006-12-27 14:03
bygg
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:乖乖的心中
等 级:版主
威 望:241
帖 子:13555
专家分:3076
注 册:2006-10-23
得分:0 
以下是引用jdw1984228在2006-12-27 14:03:21的发言:
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往后好象没有执行呢??
错在那里??
各位高手帮忙看看
不甚感激

黑体字的前面都有空格.

[此贴子已经被作者于2006-12-27 15:10:47编辑过]


飘过~~
2006-12-27 15:09
jdw1984228
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2006-12-8
得分:0 
谢谢,已解决了
都是空格跟引号惹的祸!!!
2006-12-27 15:29



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-112489-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.124628 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved