舉一個例:
CREATE PROCEDURE ORDERbyPNNO
@pnno char (8) ='%'
AS
set nocount on
SELECT XXXXXXXXXXXXXXX
FROM ORDERA INNER JOIN
CUST_A ON ORDERA.O_C_id = CUST_A.C_ID
WHERE (ORDERA.O_PNNO LIKE @pnno )
set cn =new adodb.connection
cn.open "XXXXXXXXXXXXXXXXXxx"
Set rspnno = New adodb.Recordset
rspnno.CursorLocation = adUseClient
rspnno.Open "orderbypnno %", cn, adOpenDynamic, adLockOptimistic, adCmdStoredProc
為什麼這樣查不到東西呢? 這樣查,出現語法錯誤,把 % 拿掉,又會出現 @PNNO 這個變數是空的!
請教高手,怎麼樣才可以出把參數帶進@pnno中呢?謝謝