由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - 怎么从VBA里读SQL procedure?我的code有什么问题?
相关主题
DSN-less connection to SQL serverNeed help on VBA! Please!
Question about DSN (for oracle)Access VBA 语句 问题请教 (转载)
how to link to remote access database?create table on SQL server from python pyodbc (转载)
[合集] Question about DSN (for oracle)get value returned by SQLstored procedure from python (转载)
My SQL and Crystal reportrun SQL stored procedure from python
wuwu... I hate doing this...pypyodbc error access netezza SQL server on win7
大俠 问个关于asp连SQL server的问题问一个 Access VBA programming的问题
SSRS 新问题-Report Manager Unable to connect to the remoteASP高人们帮忙看看这几行 SQL codes的问题,谢乐!
相关话题的讨论汇总
话题: set话题: dim话题: value话题: pmw话题: new
进入Database版参与讨论
1 (共1页)
c****y
发帖数: 3592
1
我的程序可以跑但是没结果。
rs.Field.Count是有结果的
rs.RecordCount结果是-1(肯定不对)
rs.GetRow或者掉rs结果都是error type mismatch.
我感觉是没有调出东西来?procedure肯定是好的,直接在excel上用connection有结果的
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim Cmd As ADODB.Command
Dim strConn As String
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
Set Cmd = New ADODB.Command
strConn = "Provider=MSDASQL.1;Persist Security Info=True;DSN=pmw;Description
=PMW;UID=pmwreader;Trusted_Connection=Yes;APP=2007 Microsoft Office system;
WSID=BG-RXU;DATABASE=pmw"
cn.Open strConn
Cmd.ActiveConnection = cn
Cmd.CommandText = "Reports.HistoricalReturns"
Cmd.CommandType = adCmdStoredProc
Cmd.Parameters.Refresh
Cmd.Parameters(1).Value = "capf"
Cmd.Parameters(2).Value = Null
Cmd.Parameters(3).Value = "01/01/08"
Cmd.Parameters(4).Value = "10/31/11"
Set rs = Cmd.Execute()
1 (共1页)
进入Database版参与讨论
相关主题
ASP高人们帮忙看看这几行 SQL codes的问题,谢乐!My SQL and Crystal report
Help about SQL Serverwuwu... I hate doing this...
Help on using SQL in ExcelVBA大俠 问个关于asp连SQL server的问题
急问: 问一个SQL的问题 在线等!SSRS 新问题-Report Manager Unable to connect to the remote
DSN-less connection to SQL serverNeed help on VBA! Please!
Question about DSN (for oracle)Access VBA 语句 问题请教 (转载)
how to link to remote access database?create table on SQL server from python pyodbc (转载)
[合集] Question about DSN (for oracle)get value returned by SQLstored procedure from python (转载)
相关话题的讨论汇总
话题: set话题: dim话题: value话题: pmw话题: new