|
Sub com_search_click()
On Error GoTo Err_com_search_Click
Dim cmd As ADODB.Command
Dim cnt As New ADODB.Connection
Dim prm1 As New ADODB.Parameter
Dim prm2 As New ADODB.Parameter
Dim sql As String
cnt.Open "provider =sqloledb,user id = sa,password =;date source = sql2k;"
MsgBox cnt.State
sql = "upr_qry_trade_wh_ins_line_pt"
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandType = adCmdStoredProc
cmd.CommandText = sql
Set prm1 = cmd.CreateParameter("@wh_ins_line_no", adInteger, adParamInput, , 1)
Set prm2 = cmd.CreateParameter("@wh_ins_line_pt", adDecimal, adParamOutput)
cmd.Parameters.Append prm1
cmd.Parameters.Append prm2
Debug.Print "outpt", cmd.Parameters(1)
cmd.Execute
Exit_com_search_Click:
Exit Sub
Err_com_search_Click:
MsgBox Err.Description
Resume Exit_com_search_Click
End Sub
----------------------------------------------
code sure but proc err:
provider cannot be found.it may not be properly installed
---------------------------------------------------------
請問高手,SQLOLEDB,是在參照中引用哪 一項
[em02] |
|