473,549 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

MLH
I have the following saved UNION query named qryPeople2NameI nNPaperAd:

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

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

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("*", "qryPeople2Name InNPaperAd") = 0 Then GoTo Point01
'(13-lines down)
440 Dim myDB As Database, MyRst As Recordset
450 Set myDB = CurrentDb
460 Set MyRst = myDB.OpenRecord set("qryPeople2 NameInNPaperAd" ,
dbOpenForwardOn ly)
470 Do Until MyRst.EOF
480 MoreLitigants = MyRst!Item & "; "
490 MyRst.MoveNext
500 Loop
510 MoreLitigants = left$(MoreLitig ants, Len(MoreLitigan ts) - 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(MoreLitigan ts = "", "", "; " &
MoreLitigants) & ". Lien Claim: " & Format$(Current FeesDue, "$#,#")
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 GetCurrentVehic leJobID in Expression.

Now, GetCurrentVehic leJobID() 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 1513
Some things to check:

Make sure the Function GetCurrentVehic leJobID() 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 GetCurrentVehic leJobID?

Put the cursor in the GetCurrentVehic leJobID() 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**@NorthStat e.netwrote in message
news:4d******** *************** *********@4ax.c om...
>I have the following saved UNION query named qryPeople2NameI nNPaperAd:

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

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

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("*", "qryPeople2Name InNPaperAd") = 0 Then GoTo Point01
'(13-lines down)
440 Dim myDB As Database, MyRst As Recordset
450 Set myDB = CurrentDb
460 Set MyRst = myDB.OpenRecord set("qryPeople2 NameInNPaperAd" ,
dbOpenForwardOn ly)
470 Do Until MyRst.EOF
480 MoreLitigants = MyRst!Item & "; "
490 MyRst.MoveNext
500 Loop
510 MoreLitigants = left$(MoreLitig ants, Len(MoreLitigan ts) - 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(MoreLitigan ts = "", "", "; " &
MoreLitigants) & ". Lien Claim: " & Format$(Current FeesDue, "$#,#")
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 GetCurrentVehic leJobID in Expression.

Now, GetCurrentVehic leJobID() 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.md b 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.md b, 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
1446
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 tbl_listings) and user(user login) tbl_review - table which trackes if a user has reviewed the listing. Like tbl_interested it has two columns (the...
8
3701
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: "Date","P1","P2","P3","P4","P5","P6","P7","P8","P9","P10","P11","P12","P13","P14","P15","P16","P17","P18","P19","P20","P21"...
5
3400
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 5), but fails on IIS 6 running on a Win2003 server. The web uses Pages derived from a custom class I wrote (which itself derives from Page) to...
4
1594
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 are both foreign keys to the address table. So, the stored procedure to which my SelectCommand points to reads as: ALTER PROCEDURE...
1
3072
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. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vdtsql/dvrefsqlpane.asp Do u know if there any way to achieve that? Any other alternative is...
6
8953
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 difficult task? Or is this quite easy, like just a few lines of source and using some of the packages from apache.org? Has anybody done this before and...
3
2056
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 parameters...." I have read many articles on the web about how to make a dynamic report based on a cross-tab query. But for some reason mine never...
2
5645
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 table using dmax, which references another query to update the table. Although I have all of the correct keys from the physical table joined to the...
12
2434
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 from table_B where NOT EXISTS
16
3348
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 Latin (text) Genus scientific name tSP - Species names Key (PK) autonum
0
7541
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7464
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7734
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7826
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5385
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5107
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3493
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1074
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
781
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.