|
|
|
Vb6.0 เจอ ดีบัคครับ ช่วยทีครับไม่รู้ว่า Inner join อะไรผิดหรือเปล่าครับ ทำให้โปรแกรมไปต่อไม่ได้ |
|
|
|
|
|
|
|
Code (VB.NET)
Public SQL, SQL1, sql2, getcode, TTT, Ex, Numtest, Re_ID, T1, T2, T3, T4 As String
Dim Cus, P, NE, R, In_A, N_Re, Max_T, Min_T, Min_TT As Integer
Dim a, b As Date
Dim CUS_ID, Ex_No As Long
'***************************************************** ¡´»ØèÁ ÊÃØ»ÃÐÂÐàÇÅÒ¡Ò÷´Êͺ*****************************************************
Private Sub cmdStart_Click()
Dim fds, pok, pok1 As Integer
TTT = Text9.Text
If Text5 = "" Or Text6 = "" Then
MsgBox " ¡ÃÍ¡¢éÍÁÙÅàÅ¢·ÐàºÕ¹´éǤÃѺ ", vbOKOnly + vbExclamation, "á¨é§àµ×͹"
Text5.SetFocus
Else
'Call M_clearall_Click '*** ¿Ñ§¡ìªÑè¹à¤ÅÕÂÃì¤èÒã¹µÒÃÒ§ committime
fds = 0
pok1 = 0
T1 = Text5.Text
T2 = Text6.Text
cn.Open "DSN=reportSQL", "sa", "cm0608"
SQL = "SELECT Ex_type FROM Committime ORDER BY Ex_type ASC"
rsCommittime.Open SQL, cn, adOpenKeyset
pok = rsCommittime.RecordCount
Do Until rsCommittime.EOF
ProgressBar1.Value = (pok1 / pok * 100) '*********** µÑÇáÊ´§Ê¶Ò¹Ð¡Ò÷ӧҹ
Ex = rsCommittime!Ex_type '**** à¡çº¤èÒÃËÑÊ ª¹Ô´µÑÇÍÂèÒ§ àªè¹ Ex = 2010
SQL1 = " Update Committime Set N_reportex = " & 5 & ",N_report = " & 5 & ",Mindate = " & 5 & " ,Maxdate = " & 5 & " ,success= " & 5 & ",late = " & 5 & " WHERE ex_type = '" & Ex & "' ; "
cn.Execute SQL1
'Call CheckTime '******** ¿Ñ§¡ìªÑ¹ÊÃØ»ÃÒ§ҹàÊÃ稵ÒÁࡳ±ìáÅЪéÒ¡ÇèÒࡳ±ì
II = 0 '********µÑÇá»Ãà¡çº¤èÒµÑÇÍÂèÒ§ã¹áµèÅÐÃÒ§ҹ·Õèà»ç¹µÒÁࡳ±ì
JJ = 0 '********µÑÇá»Ãà¡çº¤èÒµÑÇÍÂèÒ§ã¹áµèÅÐÃÒ§ҹ·ÕèªéÒ¡ÇèÒࡳ±ì
i = 0 '********µÑÇá»Ãà¡çº¤èÒµÑÇÍÂèÒ§µÒÁࡳ±ìÃÇÁ
J = 0 '********µÑÇá»Ãà¡çº¤èÒµÑÇÍÂèÒ§ªéÒ¡ÇèÒࡳ±ìÃÇÁ
IJ = 0 '********µÑÇá»Ãà¡çº¤èÒµÑÇÍÂèÒ§·Ñé§ËÁ´
tot_report = 0 '********µÑÇá»Ãà¡çº¤èҨӹǹµÑÇÍÂèÒ§·Ñé§ËÁ´ã¹áµèÅÐ Ex_type
max_day = 0 '********¨Ó¹Ç¹ÇѹÊÙ§ÊØ´ã¹áµèÅÐ Ex_type
b_no = ""
Text8 = ""
't11 = T1
't22 = T2
fb = T2 - T1 + 1 '**** µÑÇá»Ãà¡çº¤èҨӹǹàÃ礤ÍÃì´·Ñé§ËÁ´·Õèµéͧ¤Ó¹Ç¹
'cn.Open "DSN=reportsql", "sa", "cm0608"
sql2 = " SELECT Report.Book_Number, Sample_Submission.Ex_type, Sample_Submission.EXsum, Sample_Submission.sum, Report.R_time FROM Sample_Submission INNER JOIN Report ON Sample_Submission.Submission = Report.Test_Number WHERE ((Sample_Submission.Ex_type = '" & Ex & "') and (Report.Book_Number BETWEEN ('" & Text5 & "') AND ('" & Text6 & "'))) "
rsReport2.Open sql2, cn, adOpenKeyset <---- Debug ครับ ไม่รูว่าเพราะอะไร
Tag : .NET, MySQL, VBScript, Crystal Report, Win (Windows App), VB.NET
|
ประวัติการแก้ไข 2012-05-23 11:09:48 2012-05-23 11:10:17
|
|
|
|
|
Date :
2012-05-23 11:09:02 |
By :
bankujang |
View :
1076 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cn.Open "DSN=reportSQL", "sa", "cm0608"
rsCommittime.Open SQL, cn, adOpenKeyset
เปิด 2 รอบป่าว?
|
|
|
|
|
Date :
2012-05-23 12:10:21 |
By :
pp |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ช่วยอธิบายหน่อยได้ไหมครับ ว่า เปิด2รอบนี่คือส่วนไหน
|
|
|
|
|
Date :
2012-05-23 13:15:09 |
By :
bankujang |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขึ้นเออเรอร์แบบนี้ครับ
แล้วก็ตามด้วยดีบัคที่เกิด
|
ประวัติการแก้ไข 2012-05-23 14:31:00 2012-05-23 14:40:53
|
|
|
|
Date :
2012-05-23 14:29:15 |
By :
bankujang |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|