ODBC--调用失败。 [英] ODBC-- call failed.

查看:353
本文介绍了ODBC--调用失败。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ODBC调用失败

------------------------------------ --------------------------------------------


我们最近将SQL Server从7.0升级到2000.从那时起,当我尝试显示报告时,我的Access数据库生成数据报告会出现此错误:


ODBC调用失败。

[Microsoft] [ODBC SQL Server驱动程序] [SQL Server]子查询返回的值超过1。当子查询遵循=,!,<,< =,>,> =或子查询用作表达式时,不允许这样做。 (#512)[Microsoft] [ODBC SQL Server驱动程序] [SQL Server]表''SG_412007上已有一个名为''ixTable''的索引。(#1913)

ODBC call failed
--------------------------------------------------------------------------------

We have recently upgraded our SQL Server from 7.0 to 2000. Since then my Access database to generate reports on the data is giving this error when I try to display a report:

ODBC call failed.
[Microsoft][ODBC SQL Server Driver][SQL Server]Subquery returned more than 1 value. This is not permitted when the subquery follows =, !, <,<=, >, >=, or when the subquery is used as an expression. (#512) [Microsoft][ODBC SQL Server Driver][SQL Server]There is already an index on table ''SG_412007 named ''ixTable''.(#1913)

推荐答案


ODBC调用失败

---------------------- -------------------------------------------------- --------


我们最近将我们的SQL Server从7.0升级到2000.从那时起,我的Access数据库生成数据报告,当我尝试时会出现此错误显示报告:


ODBC调用失败。

[Microsoft] [ODBC SQL Server驱动程序] [SQL Server]子查询返回的值超过1。当子查询遵循=,!,<,< =,>,> =或子查询用作表达式时,不允许这样做。 (#512)[Microsoft] [ODBC SQL Server驱动程序] [SQL Server]表''SG_412007上已有一个名为''ixTable''的索引。(#1913)
ODBC call failed
--------------------------------------------------------------------------------

We have recently upgraded our SQL Server from 7.0 to 2000. Since then my Access database to generate reports on the data is giving this error when I try to display a report:

ODBC call failed.
[Microsoft][ODBC SQL Server Driver][SQL Server]Subquery returned more than 1 value. This is not permitted when the subquery follows =, !, <,<=, >, >=, or when the subquery is used as an expression. (#512) [Microsoft][ODBC SQL Server Driver][SQL Server]There is already an index on table ''SG_412007 named ''ixTable''.(#1913)



你能发布你的查询吗?看起来问题出现在子查询定义中。也许,你需要使用EXISTS代替IN或其他东西。无论如何,发布它,我们会看到。

Can you post your query? It looks like the problem is in the subquery definition. Maybe, you need to use EXISTS instead of IN or something to that effect. Anyway, post it and we''ll see.



你能发布你的查询吗?看起来问题出现在子查询定义中。也许,你需要使用EXISTS代替IN或其他东西。无论如何,发布它,我们会看到。
Can you post your query? It looks like the problem is in the subquery definition. Maybe, you need to use EXISTS instead of IN or something to that effect. Anyway, post it and we''ll see.



Private Sub CmdCAAPreview_Click()

On Error GoTo Err_CmdCAAPreview_Click

''预览报告。

Dim strDocName As String


''检查在公用事业年度的组合框中是否选择了值为实用工具


If IsNull(Me.CboCAARec.Value)然后

MsgBox"您必须在查看CAA报告之前选择会计年度。

Me.CboCAARec .SetFocus

Else

Me.TxtHoldingTypeOfRpt =" CAA"

Me.TxtHoldingNameOfRpt =" CAA"

strDocName =" RCrosstabUTLRpt"

Me.Visible = False

DoCmd.OpenReport strDocName,acViewPreview

结束如果


Exit_CmdCAAPreview_Click:

退出子

Err_CmdCAAPreview_Click:

如果Err = ConErrRptCanceled那么

Re sume Exit_CmdCAAPreview_Click

Else

MsgBox Err.Description

恢复退出_CmdCAAPreview_Click

结束如果


End Sub

Private Sub CmdCAAPreview_Click()
On Error GoTo Err_CmdCAAPreview_Click
'' Preview report.
Dim strDocName As String

''Check to see that there is a value selected in the combo box of Fiscal year for Utilities

If IsNull(Me.CboCAARec.Value) Then
MsgBox "You must select a Fiscal Year prior to view a report on CAA."
Me.CboCAARec.SetFocus
Else
Me.TxtHoldingTypeOfRpt = "CAA"
Me.TxtHoldingNameOfRpt = "CAA"
strDocName = "RCrosstabUTLRpt"
Me.Visible = False
DoCmd.OpenReport strDocName, acViewPreview
End If

Exit_CmdCAAPreview_Click:
Exit Sub

Err_CmdCAAPreview_Click:
If Err = ConErrRptCanceled Then
Resume Exit_CmdCAAPreview_Click
Else
MsgBox Err.Description
Resume Exit_CmdCAAPreview_Click
End If

End Sub



Private Sub CmdCAAPreview_Click()

On Error GoTo Err_CmdCAAPreview_Click

''预览报告。

Dim strDocName As String


''检查是否在组合框中选择了一个值公用事业的财政年度


如果IsNull(Me.CboCAARec.Value)那么

MsgBox"您必须在查看CAA报告之前选择会计年度。"

Me.CboCAARec.SetFocus

Else

Me.TxtHoldingTypeOfRpt =" CAA"

Me .TxtHoldingNameOfRpt =" CAA"

strDocName =" RCrosstabUTLRpt"

Me.Visible = False

DoCmd.OpenR eport strDocName,acViewPreview

结束如果


Exit_CmdCAAPreview_Click:

退出子


Err_CmdCAAPreview_Click:

如果Err = ConErrRptCanceled则

恢复Exit_CmdCAAPreview_Click

否则

MsgBox Err.Description

恢复退出_CmdCAAPreview_Click

结束如果


结束子
Private Sub CmdCAAPreview_Click()
On Error GoTo Err_CmdCAAPreview_Click
'' Preview report.
Dim strDocName As String

''Check to see that there is a value selected in the combo box of Fiscal year for Utilities

If IsNull(Me.CboCAARec.Value) Then
MsgBox "You must select a Fiscal Year prior to view a report on CAA."
Me.CboCAARec.SetFocus
Else
Me.TxtHoldingTypeOfRpt = "CAA"
Me.TxtHoldingNameOfRpt = "CAA"
strDocName = "RCrosstabUTLRpt"
Me.Visible = False
DoCmd.OpenReport strDocName, acViewPreview
End If

Exit_CmdCAAPreview_Click:
Exit Sub

Err_CmdCAAPreview_Click:
If Err = ConErrRptCanceled Then
Resume Exit_CmdCAAPreview_Click
Else
MsgBox Err.Description
Resume Exit_CmdCAAPreview_Click
End If

End Sub



我仍​​然不喜欢看不到你的疑问。如果它在代码中不可用,请从SQL Server sp或函数中获取它。或者,在执行程序时运行SQL Server Profiler工具以捕获查询的实际参数。

I still don''t see your query. If it''s not available in the code, get it from the SQL Server sp or function. Alternatively, run the SQL Server Profiler tool while executing the program to capture the actual parameters of the query.


这篇关于ODBC--调用失败。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆