Unexplained code is running!

T

Tom Ellison

A client has sent me an MDB to which he wishes to have alterations.

When I open the database MDB I get a custom error message, that is, a
programmed message box. It refers to the company name of those who
originally programmed it. If I open the database with Shift and then
attempt to open the main form, I get the same error message. I have removed
everything from this form. All that remains is the form and the detail
section. Still the error message occurs when the form opens. If I remove
the Open event, then it does not. So, I removed all the code for the form,
and created my own Open event, with no code. The error message is back. I
removed the open event and created an OnActivate event. The message is
back.

So, it would seem there must be come code that executes on any event you add
to this form. It would appear that this code contacts the developer's
website for permission. Now that's some kind of copy protection!

In order to contact my client and explain this to him, I'd really like to
know what is going on. He has told me he has full proprietary rights to
this software. Indeed, he originally had only and MDE to this front end,
but he has obtained an MDB from the people he hired to do the work.

I'm trying to respect everyone's rights here. I now have all their code and
the ability to modify it. But I cannot RUN it. Wierd, eh?

Perhaps I'd like to add this kind of copy protection to my applications as
well. I'm thinking this pings their server and it checks my address for
validity, because my client never has this problem. Or maybe it's just the
Computer Network Name or something like that it checks. It's really awfully
quick for pinging somewhere accross the net.

Anyway, what can you tell me about this?

Tom Ellison
 
T

Tom Ellison

Dear Allan:

There is an autoexec macro. It has only one step, which is to run this
form. It is not my understanding that an autoexec macro would run when you
open a form, only when you open the application, which I have avoided by
opening it whith Shift down.

I'm not aware of a module that would run when opening a from that is not
related to an event of that form. I have pared the form down to where there
is but one event, and that's the one I'm controlling. The event procedure
does nothing, just a declaration and exit. I put that in myself.

What I'm probably looking for is someone who has seen this somewhere.

By the way, I've looked at references, and there are no special libraries
referenced, unless one of them was modified, but then I wouldn't have that
modified library here, so that couldn't be it either, could it?

Thanks, Allen.

Tom Ellison
 
M

Marshall Barton

Tom said:
A client has sent me an MDB to which he wishes to have alterations.

When I open the database MDB I get a custom error message, that is, a
programmed message box. It refers to the company name of those who
originally programmed it. If I open the database with Shift and then
attempt to open the main form, I get the same error message. I have removed
everything from this form. All that remains is the form and the detail
section. Still the error message occurs when the form opens. If I remove
the Open event, then it does not. So, I removed all the code for the form,
and created my own Open event, with no code. The error message is back. I
removed the open event and created an OnActivate event. The message is
back.

So, it would seem there must be come code that executes on any event you add
to this form. It would appear that this code contacts the developer's
website for permission. Now that's some kind of copy protection!

In order to contact my client and explain this to him, I'd really like to
know what is going on. He has told me he has full proprietary rights to
this software. Indeed, he originally had only and MDE to this front end,
but he has obtained an MDB from the people he hired to do the work.

I'm trying to respect everyone's rights here. I now have all their code and
the ability to modify it. But I cannot RUN it. Wierd, eh?

Perhaps I'd like to add this kind of copy protection to my applications as
well. I'm thinking this pings their server and it checks my address for
validity, because my client never has this problem. Or maybe it's just the
Computer Network Name or something like that it checks. It's really awfully
quick for pinging somewhere accross the net.


That is a pretty neat trick, Tom. The only idea that comes
to mind is that there is some class module that's sinking
the form's events. But I think there must be some code in
the form to hook it up.

What happens if you open a copy of the form?

What if you set the form's HasModule property to No?
 
T

Tom Ellison

Dear Marsh:

Hi! Yeah, I think it is an incredible trick. I was beginning to wonder if
there's some new feature they're exploiting I don't know about.

I did just that, I copied the form, removed all the controls, and all the
code in its module. That, of course removed all the events. When I opened
it, I just got a blank form, as expected.

I created another new form, created an Open event, but it doesn't do this.

I have not created a new MDB and imported this. I don't think there's
likely any point to that.

Then I put in an empty Open event, and the error message comes back. Not
only this message, but when you click OK, the form closes! You cannot get
in! It's locked down tightly.

So, I removed the Open event and created an Activate event instead. Boom!
Error is there, form closes!

I'm not sure I believe what I just said. The client who sent me this has it
running on his computer. So, it is identifying the computer somehow, and
keeping me out, but letting him in.

WOW!

Would you mind bringing this to the attention of the MVPs internally? Maybe
one of them would care to give me a hand. I'd really appreciate that.

I don't know who would know anything about this unless they've seen it
somewhere. Maybe someone is selling this to developers. If I had it, I
think I would! No pay, no play! Build in a 30 day timer so when the
invoice goes past due, BOOM! Well, it sounds good, anyway.

So, how do you build something into a form so I can't even see it, or remove
it?

Well, when I post a question, it's likely to be a good one.

Tom Ellison
 
T

Tom Ellison

Dear Marsh:

Oh, yeah, about the possible class module. I searched all the VBA code for
the name of the company that shows up in the message box. It's not coded
anywhere.

Tom Ellison
 
T

Tom Ellison

Dear Marshall:

I have prepared a database with only this form. Zipped, it is 9K. It still
exhibits the primary problem, but it no longer closes the form when it has
failed, but leaves it open.

Tom Ellison
 
J

John Nurick

Hi Tom,

Export the form using Application.SaveAsText. Is there anything
unexpected in the text file?

Create a new empty MDB and use Application.LoadAsText to import the form
from the text file. Any improvement?

Dear Marsh:

Oh, yeah, about the possible class module. I searched all the VBA code for
the name of the company that shows up in the message box. It's not coded
anywhere.

Tom Ellison
 
T

Tom Ellison

Dear John:

Thanks so much for jumping in. I'm staying up most of the night to see
what's up. I love a mystery, and don't think I could sleep.

I'll start up your suggested approach and get back.

Tom Ellison


John Nurick said:
Hi Tom,

Export the form using Application.SaveAsText. Is there anything
unexpected in the text file?

Create a new empty MDB and use Application.LoadAsText to import the form
from the text file. Any improvement?
 
T

Tom Ellison

Dear John:

OK, maybe I'm not doing what you said.

Files/Export then Save as type: Text files. Click Export and that's it,
right?

The text file is created. It is empty.

So, what's up with that? The database has one object, a form. The form has
a detail section with nothing on it.

Tom Ellison


John Nurick said:
Hi Tom,

Export the form using Application.SaveAsText. Is there anything
unexpected in the text file?

Create a new empty MDB and use Application.LoadAsText to import the form
from the text file. Any improvement?
 
T

Tom Ellison

No, it doesn't exhibit the same problem at all, but it is a bit wierd.
Maybe now I'll be able to isolate some of it.

But if you know or suspect anything, pleace come back!

Tom Ellison


Tom Ellison said:
Dear Marshall:

I have prepared a database with only this form. Zipped, it is 9K. It
still exhibits the primary problem, but it no longer closes the form when
it has failed, but leaves it open.

Tom Ellison
 
D

Dirk Goldgar

Tom Ellison said:
Dear John:

OK, maybe I'm not doing what you said.

Files/Export then Save as type: Text files. Click Export and that's
it, right?

I don't think that's what John had in mind. In the Immediate window,
enter

Application.SaveAsText acForm, "TheFormName",
"C:\Temp\TheFormName.txt"

Don't expect to see an intellisense item for SaveAsText when you type
the "dot", because you won't -- this is an undocumented method.

Could there be some other executable module that is made part of the
install, loaded with Access, that is watching the windows?
 
M

Marshall Barton

Tom said:
Would you mind bringing this to the attention of the MVPs internally? Maybe
one of them would care to give me a hand. I'd really appreciate that.


I did that as soon as I saw your post. This may need all
the brains we can muster ;-)
 
T

Tom Ellison

Dear Dirk:

Well, I'm not adept at learning undocumented methods. So, your information
is priceless.

Here's what it produced:

Version =20
VersionRequired =20
Checksum =-1545696752
Begin Form
AutoResize = NotDefault
RecordSelectors = NotDefault
AutoCenter = NotDefault
NavigationButtons = NotDefault
DividingLines = NotDefault
AllowDesignChanges = NotDefault
DefaultView =0
ScrollBars =0
ViewsAllowed =1
TabularCharSet =161
TabularFamily =255
PictureAlignment =2
DatasheetGridlinesBehavior =3
GridY =10
Width =11479
DatasheetFontHeight =10
ItemSuffix =17
Left =5655
Top =3105
Right =13050
Bottom =6675
DatasheetGridlinesColor =12632256
RecSrcDt = Begin
0x77f3549fafbce240
End
GUID = Begin
0xa2e60b098033d34a851c5e2bf67f0336
End
NameMap = Begin
0x0acc0e55
End
Caption ="17/10/2005 4:57:50 µµ 17/10/2005 4:57:55 µµ"
DatasheetFontName ="Arial"
OnActivate ="[Event Procedure]"
Begin
Begin Label
BackStyle =0
TextFontCharSet =161
FontName ="Tahoma"
End
Begin CommandButton
TextFontCharSet =161
Width =1701
Height =283
FontSize =8
FontWeight =400
ForeColor =-2147483630
FontName ="Tahoma"
End
Begin TextBox
FELineBreak = NotDefault
SpecialEffect =2
OldBorderStyle =0
TextFontCharSet =161
Width =1701
LabelX =-1701
FontName ="Tahoma"
AsianLineBreak =255
End
Begin ListBox
SpecialEffect =2
TextFontCharSet =161
Width =1701
Height =1417
LabelX =-1701
FontName ="Tahoma"
End
Begin Subform
SpecialEffect =2
Width =1701
Height =1701
End
Begin Section
CanGrow = NotDefault
Height =6236
BackColor =10079487
Name ="?ept?µ??e?a"
GUID = Begin
0xeb07f3597002594684c8e46c16388915
End
End
End
End
CodeBehindForm
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Compare Database

Private Sub Form_Activate()

End Sub

Do you see anything odd in that. I'm not accustomed to studying this
myself.

Tom Ellison
 
F

Fred Boer

Dear Marsh:

You might want to qualify that a bit... ;)

Dr. Frederick Frankenstein: Igor, would you mind telling me whose brain I
did put in?
Igor: And you won't be angry?
Dr. Frederick Frankenstein: I will NOT be angry.
Igor: Abby someone.
Dr. Frederick Frankenstein: Abby someone. Abby who?
Igor: Abby Normal.
Dr. Frederick Frankenstein: Abby Normal?
Igor: I'm almost sure that was the name.
Dr. Frederick Frankenstein: Are you saying that I put an abnormal brain into
a seven and a half foot long, fifty-four inch wide GORILLA? IS THAT WHAT
YOU'RE TELLING ME?

End Quote...

Cheers!
Fred Boer

P.S. I'd offer you my brain, but it is completely occupied at the moment
trying to remember where I put the bagel I was going to have for lunch...
 
J

John Nurick

Tom, I think you should have gone to bed. I didn't mean (or say)
File|Export, but the undocumented Application.SaveAsText method, which
exports a seemingly complete specification of the form, its controls,
and code. E.g., in the Immediate pane,

Application.SaveAsText acForm, "2Line", "C:\Temp\2line.bas"
 
T

Tom Ellison

Dear John:

Yes. Got it. With some help from Dirk, I posted the text a bit ago.

Tom Ellison
 
J

John Nurick

I don't pretend to know what all this means, though most of it looks
vaguely familiar. But I'd be suspicious of any objects with properties
like these:
Caption ="17/10/2005 4:57:50 µµ 17/10/2005 4:57:55 µµ"
Name ="?ept?µ??e?a"

Could they indicate corruption somewhere?

But the next thing I'd try is to create a new empty database and use
Application.LoadFromText (not LoadAsText, as I said in my first message)
to import the form, and see if it still behaves strangely.

Doing this should also leave behind any hidden stuff you may not have
spotted.


Version =20
VersionRequired =20
Checksum =-1545696752
Begin Form
AutoResize = NotDefault
RecordSelectors = NotDefault
AutoCenter = NotDefault
NavigationButtons = NotDefault
DividingLines = NotDefault
AllowDesignChanges = NotDefault
DefaultView =0
ScrollBars =0
ViewsAllowed =1
TabularCharSet =161
TabularFamily =255
PictureAlignment =2
DatasheetGridlinesBehavior =3
GridY =10
Width =11479
DatasheetFontHeight =10
ItemSuffix =17
Left =5655
Top =3105
Right =13050
Bottom =6675
DatasheetGridlinesColor =12632256
RecSrcDt = Begin
0x77f3549fafbce240
End
GUID = Begin
0xa2e60b098033d34a851c5e2bf67f0336
End
NameMap = Begin
0x0acc0e55
End
Caption ="17/10/2005 4:57:50 µµ 17/10/2005 4:57:55 µµ"
DatasheetFontName ="Arial"
OnActivate ="[Event Procedure]"
Begin
Begin Label
BackStyle =0
TextFontCharSet =161
FontName ="Tahoma"
End
Begin CommandButton
TextFontCharSet =161
Width =1701
Height =283
FontSize =8
FontWeight =400
ForeColor =-2147483630
FontName ="Tahoma"
End
Begin TextBox
FELineBreak = NotDefault
SpecialEffect =2
OldBorderStyle =0
TextFontCharSet =161
Width =1701
LabelX =-1701
FontName ="Tahoma"
AsianLineBreak =255
End
Begin ListBox
SpecialEffect =2
TextFontCharSet =161
Width =1701
Height =1417
LabelX =-1701
FontName ="Tahoma"
End
Begin Subform
SpecialEffect =2
Width =1701
Height =1701
End
Begin Section
CanGrow = NotDefault
Height =6236
BackColor =10079487
Name ="?ept?µ??e?a"
GUID = Begin
0xeb07f3597002594684c8e46c16388915
End
End
End
End
CodeBehindForm
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Compare Database

Private Sub Form_Activate()

End Sub

Do you see anything odd in that. I'm not accustomed to studying this
myself.

Tom Ellison


Dirk Goldgar said:
I don't think that's what John had in mind. In the Immediate window,
enter

Application.SaveAsText acForm, "TheFormName",
"C:\Temp\TheFormName.txt"

Don't expect to see an intellisense item for SaveAsText when you type
the "dot", because you won't -- this is an undocumented method.

Could there be some other executable module that is made part of the
install, loaded with Access, that is watching the windows?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top