473,287 Members | 1,582 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,287 software developers and data experts.

"An unexpected error has occurred" - A97

MLH
Private Sub ButtonP_Click()
On Error GoTo Err_ButtonP_Click
Dim ThisForm As String
ThisForm = Me.Name

Exit_ButtonP_Click:
Exit Sub

Err_ButtonP_Click:
Dim r As String, k As String, Message3 As String
r = "The following unexpected error occurred in Sub ButtonP_Click,
CBF on " & ThisForm & "."
k = CRLF & CRLF & str$(Err) & ": " & Quote & Error$ & Quote
Message3 = r & k
MsgBox Message3, vbExclamation, "Unexpected Error - " & MyApp$ &
", rev. " & MY_VERSION$
Resume Exit_ButtonP_Click

End Sub

I have a problem with ButtonP on frmAdministrativeActivities. The
above code is what's run OnClick. There's no problem with the
MouseDown code. It runs fine. Of course, all the code compiles.
But OnClick of ButtonP, I get the unnumbered error. Strange is
that even when I delete ALL the ButtonP click code - the error
still persists on click of ButtonP. Ideas?
Apr 3 '06 #1
11 4163
It is rather unusual to Dim variables in the error handler, and you are also
referring to other things we don't know about which could be part of the
problem (MyApp$ and MY_VERSION$.)

However, if the error persists even when *all* this code is removed, the
database has a corruption of the type that should be fixed by a decompile.

Suggested sequence:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact

3. Close Access. Make a backup copy of the file. Decompile the database by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

4. Open Access, and compact again.

--
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.net> wrote in message
news:do********************************@4ax.com...
Private Sub ButtonP_Click()
On Error GoTo Err_ButtonP_Click
Dim ThisForm As String
ThisForm = Me.Name

Exit_ButtonP_Click:
Exit Sub

Err_ButtonP_Click:
Dim r As String, k As String, Message3 As String
r = "The following unexpected error occurred in Sub ButtonP_Click,
CBF on " & ThisForm & "."
k = CRLF & CRLF & str$(Err) & ": " & Quote & Error$ & Quote
Message3 = r & k
MsgBox Message3, vbExclamation, "Unexpected Error - " & MyApp$ &
", rev. " & MY_VERSION$
Resume Exit_ButtonP_Click

End Sub

I have a problem with ButtonP on frmAdministrativeActivities. The
above code is what's run OnClick. There's no problem with the
MouseDown code. It runs fine. Of course, all the code compiles.
But OnClick of ButtonP, I get the unnumbered error. Strange is
that even when I delete ALL the ButtonP click code - the error
still persists on click of ButtonP. Ideas?

Apr 4 '06 #2
MLH
Thx, Allen, for the insight. When I launch using
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\db\timnall\N.mdb"
I get an unnumbered "Invalid Operation" error. If I click OK there, it
is followed by an "Unexpected Error 35012" msg. Clicking OK there,
I'm told to contact Microsoft Technical Support.

I'm thinking of exporting the entire database to text & rebuilding it
from the raw text files. I'd rather do only the problematic form. Can
I do that?
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx
On Tue, 4 Apr 2006 10:15:46 +0800, "Allen Browne"
<Al*********@SeeSig.Invalid> wrote:
It is rather unusual to Dim variables in the error handler, and you are also
referring to other things we don't know about which could be part of the
problem (MyApp$ and MY_VERSION$.)

However, if the error persists even when *all* this code is removed, the
database has a corruption of the type that should be fixed by a decompile.

Suggested sequence:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact

3. Close Access. Make a backup copy of the file. Decompile the database by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

4. Open Access, and compact again.


Apr 4 '06 #3
MLH
Allen, I tried this:
Application.LoadFromText acForm, "1234567890",
"c:\temp\frmAdministrativeActivities.txt"
after saving frmAdministrativeActivities to a text file.

It rebuilt frmAdministrativeActivities in the Forms tab
of the database window as "1234567890". Opening
that form and clicking ButtonP - identical same error.

Reducing the code behind ButtonP to this:
Private Sub ButtonP_Click()
End Sub
.... I still get the same error message clicking on it.
Which is... "An unexpected error has occurred."

And finally, deleting the final 2 lines, removing all
the OnClick code for ButtonP - the same error occurs
when clicking the button. Hmmm???
Apr 4 '06 #4
If the decompile fails, it is time to create a new (blank) database, turn
Name AutoCorrect off, and import all the *other* objects.

Then decompile the new database, since importing the modules can import the
corruption. Create the form from scratch. Then paste in the code from
notepad if you wish.

--
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.net> wrote in message
news:sm********************************@4ax.com...
Thx, Allen, for the insight. When I launch using
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\db\timnall\N.mdb"
I get an unnumbered "Invalid Operation" error. If I click OK there, it
is followed by an "Unexpected Error 35012" msg. Clicking OK there,
I'm told to contact Microsoft Technical Support.

I'm thinking of exporting the entire database to text & rebuilding it
from the raw text files. I'd rather do only the problematic form. Can
I do that?
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx
On Tue, 4 Apr 2006 10:15:46 +0800, "Allen Browne"
<Al*********@SeeSig.Invalid> wrote:
It is rather unusual to Dim variables in the error handler, and you are
also
referring to other things we don't know about which could be part of the
problem (MyApp$ and MY_VERSION$.)

However, if the error persists even when *all* this code is removed, the
database has a corruption of the type that should be fixed by a decompile.

Suggested sequence:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact

3. Close Access. Make a backup copy of the file. Decompile the database by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

4. Open Access, and compact again.

Apr 4 '06 #5
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in
news:44**********************@per-qv1-newsreader-01.iinet.net.au:
Suggested sequence:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact

3. Close Access. Make a backup copy of the file. Decompile the
database by entering something like this at the command prompt
while Access is not running. It is all one line, and include the
quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe"
/decompile
"c:\MyPath\MyDatabase.mdb"
3b. Close the instance of Access that you used to decompile.
4. Open Access, and compact again.


5. open up the VBE and compile the Access project.

6. compact again.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Apr 4 '06 #6
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in
news:44**********************@per-qv1-newsreader-01.iinet.net.au:
If the decompile fails, it is time to create a new (blank)
database, turn Name AutoCorrect off, and import all the *other*
objects.


If I'm remembering correctly, MLH uses Access97, so Name AutoCorrect
wouldn't actually be relevant (if that's still true).

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Apr 4 '06 #7
MLH
On Tue, 4 Apr 2006 16:33:02 +0800, "Allen Browne"
<Al*********@SeeSig.Invalid> wrote:
If the decompile fails, it is time to create a new (blank) database, turn
Name AutoCorrect off, and import all the *other* objects.

Then decompile the new database, since importing the modules can import the
corruption. Create the form from scratch. Then paste in the code from
notepad if you wish.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Am running A97. Don't have Name AutoCorrect.

Glad. Here's what I did.
I restarted Access. Created a new database (db2). I imported the form
using Application.LoadFromText acForm, "1234567890",
"c:\temp\frmAdministrativeActivities.txt" Then I removed all code
from ButtonP (OnClick and MouseDown). Clicking ButtonP - same
error.

So, I created a new form - blank. I opened 1234567890 in design view,
selected ButtonP, pressed CTRL-c, pasted it into the new form
(remember, it has NO code now). Saved new form as Form1. Opened
it. Clicked ButtonP. Same error. Opened Form1 in design view, added
a new button - no code. Saved it. Opened it. Clicked new button. No
error.

So. Error is specific to the command button. I've never seen this
before. I went back to the original database. I copied the ButtonP
click 'n mousedown code to notepad. I deleted ButtonP. I clicked
on ButtonO in design view, pressed CTRL-c, CTRL-v, renamed the
new command bttn to ButtonP, pasted in the code from notepad.
It worked. No error.
Apr 4 '06 #8
There has to be some kind of naming clash there.

--
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.net> wrote in message
news:t6********************************@4ax.com...
On Tue, 4 Apr 2006 16:33:02 +0800, "Allen Browne"
<Al*********@SeeSig.Invalid> wrote:
If the decompile fails, it is time to create a new (blank) database, turn
Name AutoCorrect off, and import all the *other* objects.

Then decompile the new database, since importing the modules can import
the
corruption. Create the form from scratch. Then paste in the code from
notepad if you wish.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Am running A97. Don't have Name AutoCorrect.

Glad. Here's what I did.
I restarted Access. Created a new database (db2). I imported the form
using Application.LoadFromText acForm, "1234567890",
"c:\temp\frmAdministrativeActivities.txt" Then I removed all code
from ButtonP (OnClick and MouseDown). Clicking ButtonP - same
error.

So, I created a new form - blank. I opened 1234567890 in design view,
selected ButtonP, pressed CTRL-c, pasted it into the new form
(remember, it has NO code now). Saved new form as Form1. Opened
it. Clicked ButtonP. Same error. Opened Form1 in design view, added
a new button - no code. Saved it. Opened it. Clicked new button. No
error.

So. Error is specific to the command button. I've never seen this
before. I went back to the original database. I copied the ButtonP
click 'n mousedown code to notepad. I deleted ButtonP. I clicked
on ButtonO in design view, pressed CTRL-c, CTRL-v, renamed the
new command bttn to ButtonP, pasted in the code from notepad.
It worked. No error.

Apr 4 '06 #9
MLH
Allen - I think I have a clue. Can you tell me
how to determine exactly when I installed the
SP2 update? I just did it in the past 2-3 weeks.
It took HOURS to run!

I am just now discovering that ALL my work in
all my databases having any modules with XML
calls has been HIDDEN. I cannot SEE the code.
I know its there, though. That's what's causing
the error I'm getting. I went back to apps I'd written
last June - none of the XML procedures appear
completely. The comments display. The error trapping
displays. The generic DIM stmts 'n such display. But
the real meat of the code is hidden somehow. Its
still there and trying to run - but I cannot see nor
modify it. How could MicroSoft bypass all my security
and modify my code w/o permission like that?

SP2 changed my PC somehow - I cannot launch
links in emails now by clicking on them. I have to
copy them and paste them DIRECTLY into IE for
them to work. I lost the ability to open a 2nd instance
of IE by holding down the SHIFT key and clicking
on a link in active IE window.

Even stranger, apps I've rolled out onto customer
sites with A97 runtime since installing SP2 are WORKING. The XML
calls are functioning. But I cannot see nor modify my code
here - and it is not working for me.

Apr 4 '06 #10
Sorry: I don't know anything about how Access 97 could be hiding XML code in
VBA. If anyone else does, please contribute.

The stuff that is happening outside of Access (such as how IE or OE work)
would be due to other security settings that have been changed with the
update, but the disappearing VBA code makes no sense to me.

--
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.net> wrote in message
news:rm********************************@4ax.com...
Allen - I think I have a clue. Can you tell me
how to determine exactly when I installed the
SP2 update? I just did it in the past 2-3 weeks.
It took HOURS to run!

I am just now discovering that ALL my work in
all my databases having any modules with XML
calls has been HIDDEN. I cannot SEE the code.
I know its there, though. That's what's causing
the error I'm getting. I went back to apps I'd written
last June - none of the XML procedures appear
completely. The comments display. The error trapping
displays. The generic DIM stmts 'n such display. But
the real meat of the code is hidden somehow. Its
still there and trying to run - but I cannot see nor
modify it. How could MicroSoft bypass all my security
and modify my code w/o permission like that?

SP2 changed my PC somehow - I cannot launch
links in emails now by clicking on them. I have to
copy them and paste them DIRECTLY into IE for
them to work. I lost the ability to open a 2nd instance
of IE by holding down the SHIFT key and clicking
on a link in active IE window.

Even stranger, apps I've rolled out onto customer
sites with A97 runtime since installing SP2 are WORKING. The XML
calls are functioning. But I cannot see nor modify my code
here - and it is not working for me.

Apr 4 '06 #11
MLH
My conclusions are probably wrong. But I have
presented the facts correctly. After installing SP2
sometime in the past month, I am unable to see
code in form modules that I wrote and could see
and modify prior to the SP2 update. This is true
in NUMEROUS databases - at least 20 I've examined
so far.
Apr 4 '06 #12

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

Similar topics

0
by: Jairam Panickssery | last post by:
I have a simple JDBC 2.0(app driver) code snippet like: ########################### cSQL = DriverManager.getConnection(sDBURL, sDBUser, sDBPasswd); DatabaseMetaData dmd = cSQL.getMetaData(); //rs...
1
by: Stan | last post by:
I get this error when I try to access any page on the website: An error occurred while try to load the string resources (GetModuleHandle failed with error 126). At the same time here is what I...
2
by: Luke | last post by:
Hi I have the following code which is an ASP questionnaire using an Access database. (I am using access as I have no choice!). Basically there is an html form which submits the form to the page...
1
by: Chris Magoun | last post by:
I suddenly received an unexpected error in my project. I have been working on this project for some time without this issue. Nothing has changed in the form that caused the exception. A little...
0
by: David Mediavilla | last post by:
I am writing a client for an HTTPS web service using WSE 1.0 but I always get an error like "The underlying connection was closed: An unexpected error occurred on a send." Sometimes the error...
4
by: lisa | last post by:
I have an XML file that starts like this: <?xml version="1.0" encoding="ISO-8859-1" xmlns:fn="http://www.w3.org/2005/xpath-functions"?> <Authors> <Author> <ID>2</ID>...
1
by: Willard Farwark | last post by:
DB2 7.2. I do an export each night of important tables. Nothing else should be touching the DB at this time. About every 2 days I get the error below on the same tables most of the time. What...
3
crystal2005
by: crystal2005 | last post by:
I found such eror message when i tried to test sending email. Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in...
3
by: flea2k | last post by:
I am trying to run this select statment against my DB2 database and it is throwing the following error, is there a setting in my db2 database to allow for this call "USE AND KEEP UPDATE LOCKS"? ...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.