473,408 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Saved query and FN calling it now failing after 18-mos of use?

MLH
I have the following saved UNION query named qryPeople2NameInNPaperAd:

SELECT [AddnlOwnrFName] & " " & [AddnlOwnrLName] & " " &
[AddnlOwnrAddr] & " " & [AddnlOwnrCity] & ", " & [AddnlOwnrState] & "
" & [AddnlOwnrZip] AS Item, tblVehicleJobs.VehicleJobID
FROM tblVehicleJobs INNER JOIN tblAddnlOwnrs ON
tblVehicleJobs.VehicleJobID = tblAddnlOwnrs.VehicleJobID Where
tblVehicleJobs.VehicleJobID = GetCurrentVehicleJobID();

UNION SELECT [LienHolderName] & " " & [LienHolderAddr] & " " &
[LienHolderCity] & ", " & [LienHolderState] & " " & [LienHolderZip]
AS Item, tblVehicleJobs.VehicleJobID
FROM tblVehicleJobs INNER JOIN tblLienHolders ON
tblVehicleJobs.VehicleJobID = tblLienHolders.VehicleJobID Where
tblVehicleJobs.VehicleJobID = GetCurrentVehicleJobID();

The query has worked fine now for 1.5 years and still opens and runs
fine today.

It is used in Function MakeNPaperAd() As String the following way...
431 If DCount("*", "qryPeople2NameInNPaperAd") = 0 Then GoTo Point01
'(13-lines down)
440 Dim myDB As Database, MyRst As Recordset
450 Set myDB = CurrentDb
460 Set MyRst = myDB.OpenRecordset("qryPeople2NameInNPaperAd",
dbOpenForwardOnly)
470 Do Until MyRst.EOF
480 MoreLitigants = MyRst!Item & "; "
490 MyRst.MoveNext
500 Loop
510 MoreLitigants = left$(MoreLitigants, Len(MoreLitigants) - 2) 'Trim
trailing semicolon-space pair
520 MyRst.Close
530 myDB.Close
540 Set MyRst = Nothing
550 Set myDB = Nothing
Point01:
560 MyString = "Notice of Sale by Lienor: " & TowCoName & ", " &
TowCoAddrCSZ & " at " & SaleHour & ", " & SaleDate & ". " &
VehicleDescr
570 MyString = MyString & "; VIN: " & VIN & "; Odo: " & MyOdo & ".
Litigants: " & OwnerName & ", " & OwnerAddr & " " & OwnerCSZ
580 MyString = MyString & IIf(MoreLitigants = "", "", "; " &
MoreLitigants) & ". Lien Claim: " & Format$(CurrentFeesDue, "$#,#")
600 MyString = MyString & " on SALE date."
620 MakeNPaperAd = MyString

Ths FN has worked fine now for 1.5 years. Now I might have made
some mod's that I cannot recall in the past couple of weeks - but I
certainly don't think so.

Here's the problem: When I run the function (designed to return a
string), an error is captured saying that in line #460, citing an
Unknown Function GetCurrentVehicleJobID in Expression.

Now, GetCurrentVehicleJobID() has been around for a long time. It
is certain that it isn't "unknown". It runs fine called from the debug
window. The UNION query runs fine opened & run from the database
window - no such errors. But the code in Function MakeNPaperAd()
is crashing apparently in line #460. I cannot imagine why. I suspect
corruption because the report calling the query runs fine in my dev
copy of the database. I don't know what to do about it if it is
corruption.

Dec 20 '07 #1
4 1502
Some things to check:

Make sure the Function GetCurrentVehicleJobID() declaration is in scope. It
could be in the same module, or in a standard module (provided it doesn't
have Private preceeding it), but not in a class module or in the module of
another form/report (for the way you are calling it.)

Is there anything else using the name GetCurrentVehicleJobID?

Put the cursor in the GetCurrentVehicleJobID() call on line 460, and press
Shift+F2. What does Access say?

Are your library references okay:
http://allenbrowne.com/ser-38.html

If that does not identify the problem, make sure Name AutoCorrect is off,
then compact, decompile, and compact again. Post back if you need more
detail on that.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"MLH" <CR**@NorthState.netwrote in message
news:4d********************************@4ax.com...
>I have the following saved UNION query named qryPeople2NameInNPaperAd:

SELECT [AddnlOwnrFName] & " " & [AddnlOwnrLName] & " " &
[AddnlOwnrAddr] & " " & [AddnlOwnrCity] & ", " & [AddnlOwnrState] & "
" & [AddnlOwnrZip] AS Item, tblVehicleJobs.VehicleJobID
FROM tblVehicleJobs INNER JOIN tblAddnlOwnrs ON
tblVehicleJobs.VehicleJobID = tblAddnlOwnrs.VehicleJobID Where
tblVehicleJobs.VehicleJobID = GetCurrentVehicleJobID();

UNION SELECT [LienHolderName] & " " & [LienHolderAddr] & " " &
[LienHolderCity] & ", " & [LienHolderState] & " " & [LienHolderZip]
AS Item, tblVehicleJobs.VehicleJobID
FROM tblVehicleJobs INNER JOIN tblLienHolders ON
tblVehicleJobs.VehicleJobID = tblLienHolders.VehicleJobID Where
tblVehicleJobs.VehicleJobID = GetCurrentVehicleJobID();

The query has worked fine now for 1.5 years and still opens and runs
fine today.

It is used in Function MakeNPaperAd() As String the following way...
431 If DCount("*", "qryPeople2NameInNPaperAd") = 0 Then GoTo Point01
'(13-lines down)
440 Dim myDB As Database, MyRst As Recordset
450 Set myDB = CurrentDb
460 Set MyRst = myDB.OpenRecordset("qryPeople2NameInNPaperAd",
dbOpenForwardOnly)
470 Do Until MyRst.EOF
480 MoreLitigants = MyRst!Item & "; "
490 MyRst.MoveNext
500 Loop
510 MoreLitigants = left$(MoreLitigants, Len(MoreLitigants) - 2) 'Trim
trailing semicolon-space pair
520 MyRst.Close
530 myDB.Close
540 Set MyRst = Nothing
550 Set myDB = Nothing
Point01:
560 MyString = "Notice of Sale by Lienor: " & TowCoName & ", " &
TowCoAddrCSZ & " at " & SaleHour & ", " & SaleDate & ". " &
VehicleDescr
570 MyString = MyString & "; VIN: " & VIN & "; Odo: " & MyOdo & ".
Litigants: " & OwnerName & ", " & OwnerAddr & " " & OwnerCSZ
580 MyString = MyString & IIf(MoreLitigants = "", "", "; " &
MoreLitigants) & ". Lien Claim: " & Format$(CurrentFeesDue, "$#,#")
600 MyString = MyString & " on SALE date."
620 MakeNPaperAd = MyString

Ths FN has worked fine now for 1.5 years. Now I might have made
some mod's that I cannot recall in the past couple of weeks - but I
certainly don't think so.

Here's the problem: When I run the function (designed to return a
string), an error is captured saying that in line #460, citing an
Unknown Function GetCurrentVehicleJobID in Expression.

Now, GetCurrentVehicleJobID() has been around for a long time. It
is certain that it isn't "unknown". It runs fine called from the debug
window. The UNION query runs fine opened & run from the database
window - no such errors. But the code in Function MakeNPaperAd()
is crashing apparently in line #460. I cannot imagine why. I suspect
corruption because the report calling the query runs fine in my dev
copy of the database. I don't know what to do about it if it is
corruption.
Dec 20 '07 #2
Allen, what's MS's position on the decompile switch? I've seen posts
advocating its use and others which say that it is an untested, rough
and ready approach that may even trash your database. I'm confused!
Dec 20 '07 #3
Hi, Anthony

anthony wrote:
Allen, what's MS's position on the decompile switch? I've seen posts
advocating its use and others which say that it is an untested, rough
and ready approach that may even trash your database. I'm confused!
I suggest to you to read the following article written by Michael Kaplan:

The real deal on the /Decompile switch

http://www.trigeminal.com/usenet/usenet004.asp?1033

Regards
Jens
Dec 20 '07 #4
MLH
The code has been in use for 18-months. I'm thinking this
is not something 'obvious'. In a DOS window - I did this...

C:\DB\TimN>copy tpmclivedata.mdb testing.mdb /v
Overwrite testing.mdb? (Yes/No/All): y
1 file(s) copied.

C:\DB\TimN>

I opened testing.mdb, set the prerequisite vars and ran
the report. Perfect. No errors. No hitches. I reopened
tpmclivedata.mdb, did the same, ran the report, got the
error - exactly the same as before. Now that is scary.
Dec 20 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: tdmailbox | last post by:
I have a database with three tables tbl_listings - listings of houses on for sale tbl_intersted - table which tracks if a user is interested in the listing, it has two columns mls(the key for...
8
by: Maxi | last post by:
There is a lotto system which picks 21 numbers every day out of 80 numbers. I have a table (name:Lotto) with 22 fields (name:Date,P1,P2....P21) Here is the structure and sample data: ...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
4
by: Mervin Williams | last post by:
I have several tables involved in my application, but the two in question here are the company and address tables. The company table has business_address_id and mailing_address_id columns, which...
1
by: Norton | last post by:
Hi all , i would like to make a small utility which allow me to reformat the sql statement from clipboard. I am finding ways which allow me to make use of MS SQL's Query Designer. ...
6
by: Sascha Schmidt | last post by:
Hi again! Well, the first part of my "mission" (calling remoting objects from a webservice) is solved. But there's another part: Calling this C#-Webservice from a java client. Is this a...
3
by: Richard Hollenbeck | last post by:
I am very sorry about the (almost) re-post, but you will see that my first question wasn't very clear; I have another question I posted this morning called, "in DAO: Run time error 3061 Too few...
2
by: joeyrhyulz | last post by:
Hi, I'm trying to make a very simple update statement (in Oracle) in jet sql that seems much more difficult than it should be. The root of my problem is that I'm trying to update a field on a...
12
by: Michel Esber | last post by:
Hello, Db2 Linux LUW FP 15. Consider table A (ID varchar, EXECUTION_DATE date). a) I want to first retrieve all IDs that have not executed during the last 90 days: select distinct ID...
16
by: OldBirdman | last post by:
I have tables to contain the names of the birds of the world. tGN - Genus scientific (Latin) names Key (PK) autonum Ptr->FA (FK) pointer to key in table=FA Not used in this problem...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.