Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / February 2005

Tip: Looking for answers? Try searching our database.

"Compile Error: Function or Interface Marked as Restricted..."

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ron B. - 24 Feb 2005 16:45 GMT
I've recently converted an Access97 file to Access2003.   During the
conversion, there were "compilation errors" due to old DAO syntax no
longer supported.

I hired an Access programer to fiddle with the code and he got it
working.    Been using the program for over a month....   when we just
started getting the following error:

"Compile Error: Function or Interface Marked as Restricted..."

On the following code:
#################
Dim mydb As Database, MyQuery As QueryDef
If IsNull(GreigePattern) Then
    Exit Sub
End If
Set mydb = CurrentDb()
'Set MyQuery = mydb.CreateQueryDef("Change Dept")   ' Create query.
If IsNull(mydb.QueryDefs("Change Dept")) Then
    Set MyQuery = mydb.CreateQueryDef("Change Dept")   ' Create query.
Else
    Set MyQuery = mydb.QueryDefs("Change Dept")
End If
' Set SQL property.
MyQuery.SQL = "UPDATE DISTINCTROW GreigePattern SET
GreigePattern!Department = [prmDepartment] WHERE
GreigePattern!GreigeNumber = [prmGreige] AND GreigePattern!KnitterCode =
[prmKnitter];"
MyQuery.Parameters("prmDepartment") =
[Forms]![frmColorRequests]![cboDepartment]
MyQuery.Parameters("prmGreige") = [Forms]![frmColorRequests]![GreigeNumber]
MyQuery.Parameters("prmKnitter") = [Forms]![frmColorRequests]![cboKnitter]
MyQuery.Execute     ' Invoke query.
MyQuery.Close           ' Close query.
mydb.DeleteQueryDef ("Change Dept")   ' Delete query.
#############

The error is with the very lastline:   "DeleteQueryDef"

This type of code, with the DeleteQueryDef is used in about 5 other
places in the program.   they all error.

Any Ideas???    Especially, since it has been working just fine, till a
day or two ago...    no updates of any kind have been made either...
that I know of.

Thanks!
Ron
Brendan Reynolds - 24 Feb 2005 16:59 GMT
The mystery is not why it stopped working, but how it ever worked at all in
Access 2003. It shouldn't. It should be changed to ...

mydb.QueryDefs.Delete "Change Dept"

Signature

Brendan Reynolds (MVP)

> I've recently converted an Access97 file to Access2003.   During the
> conversion, there were "compilation errors" due to old DAO syntax no
[quoted text clipped - 45 lines]
> Thanks!
> Ron
Ron B. - 24 Feb 2005 18:56 GMT
THANK YOU KIND SIR!

I changed the code and viola! it works like a charm.

Wierd... it TRULY DID work for about 3 weeks with the original
command...   I don't understand.  But.... I don't care either.

Truly appreciated!
Ron

> The mystery is not why it stopped working, but how it ever worked at all in
> Access 2003. It shouldn't. It should be changed to ...
>
> mydb.QueryDefs.Delete "Change Dept"
david epsom dot com dot au - 25 Feb 2005 06:03 GMT
Cool!

Not 'Method or Function not found', but 'Marked as Restricted'
- ie only for use with the DAO2535 type library
(And note that the display syntax parser still recognizes it!)

Since 'restricted' means only that VBA can't bind to the interface,
I'm wondering if removing the DAO2535 type library failed to
correctly mark the code as uncompiled?

(david)

> The mystery is not why it stopped working, but how it ever worked at all
> in Access 2003. It shouldn't. It should be changed to ...
[quoted text clipped - 51 lines]
>> Thanks!
>> Ron
Brendan Reynolds - 25 Feb 2005 12:38 GMT
I think you know more about that kind of thing than I do, David, so if you
think that's a likely explanation, my guess would be that you're probably
right! :-)

Signature

Brendan Reynolds (MVP)

> Cool!
>
[quoted text clipped - 63 lines]
>>> Thanks!
>>> Ron
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.