L
Larue
Hello,
I am getting the following error message when I try to run an Excel macro
that is accessing a SQL Stored Procedure via a Pass-Through query in MS
Access.
Run-time error '1004'
[Microsoft][ODBC Microsoft Access Driver] Reserved error (|); there is no
message for this error
The VB script is as follows:
Sub NPB_Macro()
'
' NPB_Macro Macro
' Macro recorded 6/23/2008 by susan
'
'
Application.CommandBars("Forms").Visible = False
Workbooks.OpenDatabase Filename:= _
"X:\Finance\FinanceDB\Negative_Pledge_Balance.dqy",
CommandText:=Array( _
"SELECT NegativePledgeBalance.CoFRID, NegativePledgeBalance.Name,
NegativePledgeBalance.CapCode, NegativePledgeBalance.CapYear,
NegativePledgeBalance.TransTyp, NegativePledgeBalance.TotPlgAmt,
NegativePledgeBalance.TotPayAmt, Negat" _
, _
"ivePledgeBalance.StaffFRID, NegativePledgeBalance.StaffName FROM
`X:\Finance\FinanceDB\FinanceDB`.NegativePledgeBalance NegativePledgeBalance
ORDER BY NegativePledgeBalance.CapCode" _
), CommandType:=xlCmdSql
Columns("F:G").Select
Selection.Style = "Currency"
Range("A1").Select
End Sub
I am able to run this on some computers and not on others. Any help will be
greatly appreciated.
Thank you!
I am getting the following error message when I try to run an Excel macro
that is accessing a SQL Stored Procedure via a Pass-Through query in MS
Access.
Run-time error '1004'
[Microsoft][ODBC Microsoft Access Driver] Reserved error (|); there is no
message for this error
The VB script is as follows:
Sub NPB_Macro()
'
' NPB_Macro Macro
' Macro recorded 6/23/2008 by susan
'
'
Application.CommandBars("Forms").Visible = False
Workbooks.OpenDatabase Filename:= _
"X:\Finance\FinanceDB\Negative_Pledge_Balance.dqy",
CommandText:=Array( _
"SELECT NegativePledgeBalance.CoFRID, NegativePledgeBalance.Name,
NegativePledgeBalance.CapCode, NegativePledgeBalance.CapYear,
NegativePledgeBalance.TransTyp, NegativePledgeBalance.TotPlgAmt,
NegativePledgeBalance.TotPayAmt, Negat" _
, _
"ivePledgeBalance.StaffFRID, NegativePledgeBalance.StaffName FROM
`X:\Finance\FinanceDB\FinanceDB`.NegativePledgeBalance NegativePledgeBalance
ORDER BY NegativePledgeBalance.CapCode" _
), CommandType:=xlCmdSql
Columns("F:G").Select
Selection.Style = "Currency"
Range("A1").Select
End Sub
I am able to run this on some computers and not on others. Any help will be
greatly appreciated.
Thank you!