dbTalk Databases Forums  

Data Type Mismatch - but not really.... ?

comp.databases.ms-access comp.databases.ms-access


Discuss Data Type Mismatch - but not really.... ? in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Data Type Mismatch - but not really.... ? - 01-18-2011 , 04:52 PM






"(PeteCresswell)" <x@y.Invalid> wrote in
news:44lbj6prjdrhdd1nqgv0mfsf88845ibhe4 (AT) 4ax (DOT) com:

Quote:
Per Bob Barrows:
Well, aside from guessing that the error is occurring in the
IsBizDay function (not clear why you have a Variant argument
there, rather than the expected Date ...), I really can't tell any
more. Can't you step through the code to figure it out? Without
knowing exactly what the input arguments were, we haven't a chance
in hell of determining the cause.

I should have emphasized the " Access throws
this: http://tinyurl.com/486rcv8 - which to indicate a missing
reference, except that the "reference" would be by the
application to itself." part.
Is the database referenced there really a database, or is it a temp
file? I'm just guessing here, but it looks like a compile problem.
Have you decompiled and recompiled?

Quote:
I really don't think it's around typing bc the routine has worked
all these years.

That may sound hokey... but it seems to me like the "missing
reference" error trumps all. I suspect that once I explain/fix
that, the problem will go away.
I don't see anything in particular, but I really think I'd change
the date argument of your IsBizDate() function to be ByVal instead
of ByRef, since when you pass a control to a ByRef, you're operating
on the control, and not on the value in the control. I assume you've
defined it as variant because you want it to work with a Null, but
you don't have a guard clause in your IsBizDate() function that
handles Nulls. It may be that it will fall over to returning False
on Null, but I'd still want to handle it explicitly.

Also, you're not using your explanation variable, which makes your
code more confusing than it needs to be.

Indeed, the whole things looks quite convoluted to me -- it looks
like vastly overengineered code to me, and when that's the case it
often becomes very hard to troubleshoot. I'd get back to basics and
see if I can generate the same error with much simpler code.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #12  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Data Type Mismatch - but not really.... ? - 01-18-2011 , 04:53 PM






"(PeteCresswell)" <x@y.Invalid> wrote in
news:0llbj614o6h3pjohkdl38qv40ukth14aeq (AT) 4ax (DOT) com:

Quote:
Per (PeteCresswell):
This routine has been working in the past - and is used daily in
production.... but not today.... -)

FWIW, I'm putting my money on a corrupt form.
Do you decompile regularly? If not, why not? It really is something
that is necessary to maintain good code health (as well as having
COMPILE ON DEMAND turned off, OPTION EXPLICIT in all modules, and
compiling every few minutes when coding).

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #13  
Old   
(PeteCresswell)
 
Posts: n/a

Default Re: Data Type Mismatch - but not really.... ? - 01-19-2011 , 08:55 AM



Per David-W-Fenton:
Quote:
Do you decompile regularly? If not, why not? I
It's like a religion with me: multiple times per day.

I suffix my development versions with a letter and every time I
take a break or something, I zip up the current version, move the
..ZIP to an archive location, /Decompile, Compile, and then
Compact/Repair into the next-lettered version.

--
PeteCresswell

Reply With Quote
  #14  
Old   
Phil
 
Posts: n/a

Default Re: Data Type Mismatch - but not really.... ? - 01-19-2011 , 09:45 AM



On 19/01/2011 14:55:14, "(PeteCresswell)" wrote:
Quote:
Per David-W-Fenton:
Do you decompile regularly? If not, why not? I

It's like a religion with me: multiple times per day.

I suffix my development versions with a letter and every time I
take a break or something, I zip up the current version, move the
.ZIP to an archive location, /Decompile, Compile, and then
Compact/Repair into the next-lettered version.

Intersting, because I have seen numerous postings on this NG that the
automatic compact & repair on closing a Db is a bad idea. Are you suggesting
it is a good idea if you have decompiled first?

Phil

Reply With Quote
  #15  
Old   
Marshall Barton
 
Posts: n/a

Default Re: Data Type Mismatch - but not really.... ? - 01-19-2011 , 10:24 AM



Phil wrote:

Quote:
On 19/01/2011 14:55:14, "(PeteCresswell)" wrote:
Per David-W-Fenton:
Do you decompile regularly? If not, why not? I

It's like a religion with me: multiple times per day.

I suffix my development versions with a letter and every time I
take a break or something, I zip up the current version, move the
.ZIP to an archive location, /Decompile, Compile, and then
Compact/Repair into the next-lettered version.


Intersting, because I have seen numerous postings on this NG that the
automatic compact & repair on closing a Db is a bad idea. Are you suggesting
it is a good idea if you have decompiled first?

Automatic CR on close is a bad idea, but that's not what
Pete's doing. He first makes the critically important
backup BEFORE doing the other things. Auto CR skips this
steo so if anything goes wrong with the CR, you're dead.

I would consider moving the Compile step to after the CR
step, but I think his procedure is absolutely safe and
sound.

--
Marsh

Reply With Quote
  #16  
Old   
Phil
 
Posts: n/a

Default Re: Data Type Mismatch - but not really.... ? - 01-19-2011 , 10:49 AM



On 19/01/2011 16:24:05, Marshall Barton wrote:
Quote:
Phil wrote:

On 19/01/2011 14:55:14, "(PeteCresswell)" wrote:
Per David-W-Fenton:
Do you decompile regularly? If not, why not? I

It's like a religion with me: multiple times per day.

I suffix my development versions with a letter and every time I
take a break or something, I zip up the current version, move the
.ZIP to an archive location, /Decompile, Compile, and then
Compact/Repair into the next-lettered version.


Intersting, because I have seen numerous postings on this NG that the
automatic compact & repair on closing a Db is a bad idea. Are you suggesting
it is a good idea if you have decompiled first?


Automatic CR on close is a bad idea, but that's not what
Pete's doing. He first makes the critically important
backup BEFORE doing the other things. Auto CR skips this
steo so if anything goes wrong with the CR, you're dead.

I would consider moving the Compile step to after the CR
step, but I think his procedure is absolutely safe and
sound.

--
Marsh

Yup, that sounds very sensible.
Thanks
Phil

Reply With Quote
  #17  
Old   
(PeteCresswell)
 
Posts: n/a

Default Re: Data Type Mismatch - but not really.... ? - 01-19-2011 , 03:48 PM



Per Phil:
Quote:
Intersting, because I have seen numerous postings on this NG that the
automatic compact & repair on closing a Db is a bad idea. Are you suggesting
it is a good idea if you have decompiled first?
I don't know from automatic.

I close the thing, open it up again with /Decompile, compile it,
close it, and then compact/repair.
--
PeteCresswell

Reply With Quote
  #18  
Old   
(PeteCresswell)
 
Posts: n/a

Default Re: Data Type Mismatch - but not really.... ? - 01-19-2011 , 03:49 PM



Per (PeteCresswell):
Quote:
I close the thing, open it up again with /Decompile, compile it,
close it, and then compact/repair.
But before I do any of that, I zip up the archive copy.
--
PeteCresswell

Reply With Quote
  #19  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Data Type Mismatch - but not really.... ? - 01-20-2011 , 04:13 PM



Marshall Barton <marshbarton (AT) wowway (DOT) com> wrote in
news:gd3ej6p7hpi22meamsnlj2gqmvjp1u0q34 (AT) 4ax (DOT) com:

Quote:
I would consider moving the Compile step to after the CR
step, but I think his procedure is absolutely safe and
sound.
I always do a decompile cycle with:

1. backup

2. compact

3. decompile

4. compact

5. compile

6. compact

My theory is that there is less chance of any discarded data pages
being retained with a compact before and after every step.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.