相关疑难解决方法(0)

显式vs隐式SQL连接

在显式vs隐式内连接中是否存在效率差异?例如:

SELECT * FROM
table a INNER JOIN table b
ON a.id = b.id;
Run Code Online (Sandbox Code Playgroud)

SELECT a.*, b.*
FROM table a, table b
WHERE a.id = b.id;
Run Code Online (Sandbox Code Playgroud)

sql join

380
推荐指数
7
解决办法
16万
查看次数

记录集在存储过程执行后关闭

我正在使用VBA中的ADO执行存储过程.我正在尝试使用SQL Server 2008中的存储过程的结果填充记录集.下面的VBA示例:

Public Function DoSomething() As Variant()

Dim oDB As ADODB.Connection: Set oDB = New ADODB.Connection
Dim oCM As ADODB.Command: Set oCM = New ADODB.Command
Dim oRS As ADODB.Recordset

oDB.Open gcConn

With oCM
    .ActiveConnection = oDB
    .CommandType = adCmdStoredProc
    .CommandText = "spTestSomething"
    .NamedParameters = True
    .Parameters.Append .CreateParameter("@Param1", adInteger, adParamInput, , 1)
    Set oRS = .Execute
End With

If Not oRS.BOF And Not oRS.EOF Then 'Error thrown here'
    DoSomething = oRS.GetRows()
Else
    Erase DoSomething
End If

oRS.Close
Set oRS = …
Run Code Online (Sandbox Code Playgroud)

sql-server vba stored-procedures ado recordset

7
推荐指数
1
解决办法
6451
查看次数

如何统计ASP经典中的记录?

我不太熟悉ASP经典编程.我只需要在我的网页上运行一个小代码.我如何计算返回查询的记录?

<%
Set rsscroll = Server.CreateObject("ADODB.Recordset")
Dim strSQLscroll, rsscroll
strSQLscroll = "SELECT * FROM tblItems where expiration_date > getdate() order by expiration_date desc;"
rsscroll.open strSQLscroll,oConn
%>
Run Code Online (Sandbox Code Playgroud)

谢谢,

asp-classic

3
推荐指数
2
解决办法
7万
查看次数

标签 统计

ado ×1

asp-classic ×1

join ×1

recordset ×1

sql ×1

sql-server ×1

stored-procedures ×1

vba ×1