A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

run-time error 1004



 
 
Thread Tools Display Modes
  #1  
Old June 24th, 2008, 04:20 PM posted to microsoft.public.access.queries
LaRue
external usenet poster
 
Posts: 4
Default run-time error 1004

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`.NegativePledgeBal ance 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!

  #2  
Old June 24th, 2008, 08:24 PM posted to microsoft.public.access.queries
Golfinray
external usenet poster
 
Posts: 1,597
Default run-time error 1004

I am no sql expert, but I would see what my ODBC timeout time is. I think the
default is 60 seconds. If something takes longer than that to load, it
timesout. Your query may be taking too long to run and get hit with the time
limitation.

"Larue" wrote:

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`.NegativePledgeBal ance 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!

  #3  
Old June 24th, 2008, 08:50 PM posted to microsoft.public.access.queries
LaRue
external usenet poster
 
Posts: 4
Default run-time error 1004

Do you know where I change the ODBC timeout time? I have removed the flag
check box from the "Cancel the connection if not connected within" in the MS
Query options. Is there another place that I change the timeout time?

"Golfinray" wrote:

I am no sql expert, but I would see what my ODBC timeout time is. I think the
default is 60 seconds. If something takes longer than that to load, it
timesout. Your query may be taking too long to run and get hit with the time
limitation.

"Larue" wrote:

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`.NegativePledgeBal ance 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!

  #4  
Old June 24th, 2008, 09:36 PM posted to microsoft.public.access.queries
Golfinray
external usenet poster
 
Posts: 1,597
Default run-time error 1004

I do not. I know I have had that error before several times. There are some
good resources in the help file for ODBC connections. I think you would have
to set that up in Windows for each machine, though, for everyone to have the
same timeout. Sorry I couldn't help more.

"Larue" wrote:

Do you know where I change the ODBC timeout time? I have removed the flag
check box from the "Cancel the connection if not connected within" in the MS
Query options. Is there another place that I change the timeout time?

"Golfinray" wrote:

I am no sql expert, but I would see what my ODBC timeout time is. I think the
default is 60 seconds. If something takes longer than that to load, it
timesout. Your query may be taking too long to run and get hit with the time
limitation.

"Larue" wrote:

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`.NegativePledgeBal ance 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!

  #5  
Old July 7th, 2008, 07:44 PM posted to microsoft.public.access.queries
LaRue
external usenet poster
 
Posts: 4
Default run-time error 1004

Installing SP3 solved the issue.

"Golfinray" wrote:

I do not. I know I have had that error before several times. There are some
good resources in the help file for ODBC connections. I think you would have
to set that up in Windows for each machine, though, for everyone to have the
same timeout. Sorry I couldn't help more.

"Larue" wrote:

Do you know where I change the ODBC timeout time? I have removed the flag
check box from the "Cancel the connection if not connected within" in the MS
Query options. Is there another place that I change the timeout time?

"Golfinray" wrote:

I am no sql expert, but I would see what my ODBC timeout time is. I think the
default is 60 seconds. If something takes longer than that to load, it
timesout. Your query may be taking too long to run and get hit with the time
limitation.

"Larue" wrote:

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`.NegativePledgeBal ance 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!

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.