Bug #51356 [Opn->Fbk]: using COM to call MSSQL Stored Procedure
| From: | cmb@php.net | Date: | Fri, 30 Jul 2021 17:09:20 +0000 |
| Subject: | Bug #51356 [Opn->Fbk]: using COM to call MSSQL Stored Procedure | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-235490@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=51356&edit=1
ID: 51356
Updated by: cmb@php.net
Reported by: zhou_wen_bo at 163 dot com
Summary: using COM to call MSSQL Stored Procedure
-Status: Open
+Status: Feedback
Type: Bug
Package: COM related
Operating System: WINDOWS
PHP Version: 5.2.13
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Hard to say what's the issue, but is this even still relevant?
Previous Comments:
------------------------------------------------------------------------
[2010-03-23 07:50:58] zhou_wen_bo at 163 dot com
The VB Code "Private ESPTest As New espNew.espc" should be:
Private ESPTest As New esp.espc
------------------------------------------------------------------------
[2010-03-23 07:42:30] zhou_wen_bo at 163 dot com
Description:
------------
I wrote a Active Dll to call mssql stored procedure using ADO, something like below:
Option Explicit
Private db As New ADODB.Connection
Private adocomm As New ADODB.Command
Public Function ExecSP(sql As String) As ADODB.Recordset
Set db = New ADODB.Connection
db.ConnectionString = CONNECT_STRING
db.CursorLocation = adUseClient
db.ConnectionTimeout = 30
db.Open
Set adocomm.ActiveConnection = db
adocomm.CommandType = adCmdStoredProc
adocomm.CommandText = "p_Common_Pagination"
adocomm.Parameters(1) = sql
adocomm.Parameters(2) = 1
adocomm.Parameters(3) = 20
Set ExecSP = adocomm.Execute
End Function
And Tested OK using VB code, there are some chinese characters:
Option Explicit
Private rs As New ADODB.Recordset
Private ESPTest As New espNew.espc
Private sql as String
Private Sub Command1_Click()
sql = "select * from t_User where FUserID>1000 and FName like
'%ä¸å½äºº%' order by FUserID"
Set rs = ESPTest.ExecSP(sql)
End Sub
Below is the Sql Profiler's output:
exec p_Common_Pagination N'select * from t_User where FUserID>1000 and FName like
''%ä¸å½äºº%'' order by FUserID', 1, 20
But if I use php to call this DLL:
<?php
$sql = "select * from t_User where FUserID>1000 and FName like
'%ä¸å½äºº%' order by FUserID";
$b= new COM("esp.espc");
$list=$b->ExecSP($sql);
?>
The output of the SQL Profiler is :
exec p_Common_Pagination N'select * from t_User where FUserID>1000 and FName like
''%ä¸å½äºº%'' order by FUserID
The second and the third parameters are missing.
I have tesed for a long time, and I'm sure the code I wroted are all right.
What's the matter ?
Test script:
---------------
like above
Expected result:
----------------
Fix the bug.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=51356&edit=1