Unsolved
This post is more than 5 years old
33 Posts
0
27395
March 9th, 2006 13:00
Error message when running Pass-Through query in Access 2002
I have an Access 2002 database in which I'm trying to create a pass-through query to a SQL 2000 database. If I run the query without variables (insert the values I need in the various places I need them), the query runs fine. But if I try to use variables, I get an error message that reads, "Pass-through query with ReturnsRecords property set to True did not return any records." I couldn't find anything on this in the MSKB. The variables are declared as follows: Declare @YEAR as int Declare @PERIOD as int Set @YEAR = 2006 Set @PERIOD = 2 Again, the exact same query works if I don't use the variables.
No Events found!



abach
1.7K Posts
0
March 9th, 2006 15:00
If you're using the SQL view of the query, copy and paste the entire code and I'll look at it. The reason I asked was there is no variable type int, only Integer in VBA
abach
1.7K Posts
0
March 9th, 2006 15:00
jjkatz
33 Posts
0
March 9th, 2006 15:00
jjkatz
33 Posts
0
March 9th, 2006 17:00
Declare @PERIOD as int
Set @YEAR = 2006
Set @PERIOD = 2
from zone_lookup
where Go_Live >= dbo.GetPeriodBeginDate( @YEAR, @PERIOD ) AND Go_Live < DATEADD(day, 1, dbo.GetPeriodEndDate( @YEAR, @PERIOD ))
abach
1.7K Posts
0
March 10th, 2006 11:00
jjkatz
33 Posts
0
March 10th, 2006 19:00