Dim Data_Connection As New ADODB.Connection 'ADO連接對象
Dim data_RecordSet As New ADODB.Recordset 'ADO的記錄集
Dim sqlCmdCheckElement As New ADODB.Command
Dim sqlCmdCalNgNum As New ADODB.Command
Dim sqlDeleteMTMR As New ADODB.Command 'w2007 liutao 2007/02/28
Dim sqlCmdNoMR As New ADODB.Command
Dim sqlCmdNoMRData As New ADODB.Command
Dim adoParam As New ADODB.Parameter
Dim XMAX As Single, XMIN As Single, YMAX As Single, YMIN As Single
Dim Bid As Long
On Error GoTo CheckElement_ErrHandler
Data_Connection.ConnectionString = ConnectionString
Data_Connection.ConnectionTimeout = 0
Data_Connection.Open '打開連接
frmRitek.Label4.Caption = "Check Element ..."
DoEvents
MATCHMODE = CInt(Left$(frmRitek.Combo1.Text, 1))
ciareast = CSng(frmRitek.Text2.Text)
sqareast = CSng(frmRitek.Text3.Text)
If MATCHMODE = 0 Then
sqlCmdCheckElement.ActiveConnection = Data_Connection
sqlCmdCheckElement.CommandText = "CheckElement"
sqlCmdCheckElement.CommandType = adCmdStoredProc
sqlCmdCheckElement.CommandTimeout = 0
Set adoParam = sqlCmdCheckElement.CreateParameter("@ROffset", adSingle, adParamInput, , ROffset)
sqlCmdCheckElement.Parameters.Append adoParam
Set adoParam = sqlCmdCheckElement.CreateParameter("@Areatol", adSingle, adParamInput, , Areatol)
sqlCmdCheckElement.Parameters.Append adoParam 'w1977 added by liutao 2007/01/31
Set adoParam = sqlCmdCheckElement.CreateParameter("@ungnum", adInteger, adParamOutput)
sqlCmdCheckElement.Parameters.Append adoParam
Set adoParam = sqlCmdCheckElement.CreateParameter("@lngnum", adInteger, adParamOutput)
sqlCmdCheckElement.Parameters.Append adoParam
Set adoParam = sqlCmdCheckElement.CreateParameter("@oknum", adInteger, adParamOutput)
sqlCmdCheckElement.Parameters.Append adoParam
sqlCmdCheckElement.Execute
ungnum = sqlCmdCheckElement.Parameters("@ungnum")
lngnum = sqlCmdCheckElement.Parameters("@lngnum")
oknum = sqlCmdCheckElement.Parameters("@oknum")