분류없음2016.06.10 15:34

===================================

=== ADODB.Command - insert, delete, update ===

===================================

Dim ObjConn_J, ObjCmd_J, ObjRs_J, Rows_J, Index_J


Set ObjConn_J = Server.CreateObject("ADODB.Connection")

ObjConn_J.Open(MEM_CONN_STR)


Set ObjCmd_J = Server.CreateObject("ADODB.Command")    

With ObjCmd_J

.ActiveConnection = ObjConn_J

.CommandType = adCmdStoredProc

.CommandText = "up_AutomaticPayment_Insert"


.Parameters.Append .CreateParameter("@Test", adVarWChar, adParamInput, 50, "TestValue")

.Parameters.Append .CreateParameter("@TestOutput", adVarWChar, adParamOutput, 50, null)


.Execute ,, adExecuteNoRecords


Response.Write(.Parameters("@TestOutput"))


End With    


If ObjConn_J.State = 1 Then 

ObjConn_J.Close  

End if


Set ObjCmd_J = Nothing    

Set ObjConn_J = Nothing



=========================

=== ADODB.Command - select  ===

=========================

Dim ObjConn_J, ObjCmd_J, ObjRs_J, Rows_J, Index_J

    

    Set ObjConn_J = Server.CreateObject("ADODB.Connection")

    ObjConn_J.Open(MEM_CONN_STR)

    

    Set ObjCmd_J = Server.CreateObject("ADODB.Command")

    With ObjCmd_J

        .ActiveConnection = ObjConn_J

        .CommandType = adCmdStoredProc

        .CommandText = "up_AutomaticPayment_SelectList"

        

        '.Parameters.Append .CreateParameter("@ResultCD", adVarWChar, adParamInput, 50, Resultcd)

        '.Parameters.Append .CreateParameter("@ResultMSG", adVarWChar, adParamInput, 50, Resultmsg)

        '.Parameters.Append .CreateParameter("@AutoBillKey", adVarWChar, adParamInput, 50, AutoBillKey)

        '.Parameters.Append .CreateParameter("@CommId", adVarWChar, adParamInput, 50, Commid)

        '.Parameters.Append .CreateParameter("@MobilId", adVarWChar, adParamInput, 50, Mobilid)

        '.Parameters.Append .CreateParameter("@MrchId", adVarWChar, adParamInput, 50, Mrchid)

        '.Parameters.Append .CreateParameter("@MSTR", adVarWChar, adParamInput, 50, MSTR)

        '.Parameters.Append .CreateParameter("@MobileNumber", adVarWChar, adParamInput, 50, No)

        '.Parameters.Append .CreateParameter("@ProductName", adVarWChar, adParamInput, 50, Prdtnm)

        '.Parameters.Append .CreateParameter("@ProductPrice", adInteger, adParamInput, 4, Prdtprice)

        '.Parameters.Append .CreateParameter("@SignDate", adVarWChar, adParamInput, 50, Signdate)

        '.Parameters.Append .CreateParameter("@SvcId", adVarWChar, adParamInput, 50, Svcid)

        '.Parameters.Append .CreateParameter("@TradeId", adVarWChar, adParamInput, 50, Tradeid)

        '.Parameters.Append .CreateParameter("@UserId", adVarWChar, adParamInput, 50, Userid)

        '.Parameters.Append .CreateParameter("@UserKey", adVarWChar, adParamInput, 50, UserKey)

        '.Parameters.Append .CreateParameter("@AutoYN", adWChar, adParamInput, 1, AutoYN)

        '.Parameters.Append .CreateParameter("@PaymentType", adInteger, adParamInput, 4, 1)

        '.Parameters.Append .CreateParameter("@PaymentMethod", adVarWChar, adParamInput, 50, "a")

        '.Parameters.Append .CreateParameter("@ProductInfoId", adBigInt, adParamInput, 8, arrMSTR(2))

    End With

    

    Set ObjRs_J = Server.CreateObject("ADODB.Recordset")

    ObjRs_J.Open ObjCmd_J, , adOpenStatic, adLockPessimistic, adCmdUnknown

    

    If Not ObjRs_J.EOF And Not ObjRs_J.BOF Then

        Rows_J = ObjRs_J.GetRows()

    End If

    

    If ObjRs_J.State = 1 Then 

        ObjRs_J.Close  

    End if

    If ObjConn_J.State = 1 Then 

        ObjConn_J.Close  

    End if    

    

    Set ObjCmd_J = Nothing

    Set ObjRs_J = Nothing

    Set ObjConn_J = Nothing    

    

    

    

    If isArray(Rows_J) then

        For Index_J = 0 To UBound(Rows_J, 2)

            Response.Write Rows_J(0, Index_J) &"<br>"

        Next    

    End If

저작자 표시 비영리 동일 조건 변경 허락
신고

Posted by jangjeonghun

티스토리 툴바