473,569 Members | 2,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CurrentDb error: function marked as restricted

5 New Member
I have application that runs without any problem on all PCs except one where it produced error obn currentDB line: Function or interface marked as restricted, or the function uses an Automation type not supported by VBA. All PCs have WINXP, SP2. Could not spot the problem on this "trouble" PC. Any ideas? Thank you for your time.
Nov 17 '09 #1
6 2963
ChipR
1,287 Recognized Expert Top Contributor
What's the code that produces the error?
Nov 17 '09 #2
ADezii
8,834 Recognized Expert Expert
@DDB
You can try an alternate approach for referring to the Current Database, and see what happens:
Expand|Select|Wrap|Line Numbers
  1. Dim db As DAO.Database
  2.  
  3. Set db = Workspaces(0)(0)
  4.  
  5. MsgBox db.Name
Nov 17 '09 #3
NeoPa
32,564 Recognized Expert Moderator MVP
I think the very least we'll need is to see the code the error occurs on.
Nov 18 '09 #4
DDB
5 New Member
Expand|Select|Wrap|Line Numbers
  1. If cn Is Nothing Then
  2.  
  3.  
  4.    DBServerName = DLookup("[DBServerName]", "DBParms")
  5.    DBName = DLookup("[DBName]", "DBParms")
  6.    UID = DLookup("[UID]", "DBParms")
  7.    PWD = DLookup("[PWD]", "DBParms")
  8.  ' THIS IS A FAILED SPOT.
  9.   Set rs = CurrentDb.OpenRecordset("SELECT Mode FROM tblMode;")
  10.   gsMode = rs.Fields(0)
  11.     ........
Nov 18 '09 #5
missinglinq
3,532 Recognized Expert Specialist
When apps run fine on one machine and not on another or run fine in one version and not when run under a newer version, the first thing you have to think about are missing references.

Here are Doug Steele's detailed instructions on how to troubleshoot the problem, if you've never done it before:

http://www.accessmvp.com/DJSteele/Ac...nceErrors.html
Nov 18 '09 #6
NeoPa
32,564 Recognized Expert Moderator MVP
I believe OpenRecordset() is found in both DAO & ADODB flavours. Your code allows it to default, which is not good. At best it is unclear.

I suggest you set up variables defined as DAO.Database &/or DAO.Recordset and use these in your code to be explicit.
Nov 18 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

7
1450
by: vegetax | last post by:
I i need a decorator that adds a local variable in the function it decorates, probably related with nested scopes, for example: def dec(func): def wrapper(obj = None): if not obj : obj = Obj() <bind obj to func> return func() return wrapper()
2
2832
by: Sonoman | last post by:
Hi all: I am getting a "missing storage class or idetifier" error and I do not understand what it means, therefore and I cannot figure it out. I am just starting a new project and I cannot get past this (may be very simple) error. My code is as follows: /////////////////////////array.h #ifndef array_h #define array_h
10
7306
by: pauldepstein | last post by:
I am writing a program which will use the ceiling and floor of square roots. If a positive integer is an exact square (and is not overly huge), does sqrt return an integer-valued real? Or might the sqrt function tell me that, for example, sqrt(1024) = 31.99999999999999999999999 You might say "try it". The problem is that I can't try...
2
4015
by: WindAndWaves | last post by:
I recently made a very simple little function: Function x() Dim Tbl As TableDef Dim fld As DAO.Field Set Tbl = currentdb.TableDefs("search") Debug.Print Tbl.Name For Each fld In Tbl.Fields Debug.Print fld.Name Next fld
7
6872
by: John Øllgård Jensen | last post by:
Hi Using MS Asccess 2000: In a query I'm trying to create a new field with following expression: FilmDate: Left(,4) The field "FilmNo" is another text field in the query. This is expression should return the 4 leftmost characters of the FilmNo
7
4983
by: Tony M. | last post by:
I'm trying to execute an append query. I have a case that works, and one that returns an object not set error. THIS WORKS: Private Sub cmdArchiveRecs_Click() BeginTrans CurrentDb.Execute "qapp_RecsNotYetArchived", dbFailOnError CommitTrans End Sub
3
8621
by: Richard Hollenbeck | last post by:
In DAO, is there any difference between "set db = CurrentDb()" with parentheses and "set db = CurrentDb" without parentheses? I'm just looking for data from a single field in a table inside the same Access database, if that means anything. I forgot to put the blank parentheses but I'm not finished building the recordset. I'm betting it will...
0
1859
by: zoobave | last post by:
Hi, When i give "apt-get update" command, i got the following errors. How can i resolve it? root@dvm-desktop:/home/dvm# apt-get update Get:1 http://security.ubuntu.com feisty-security Release.gpg Ign http://security.ubuntu.com feisty-security/main Translation-en_IN Get:2 http://in.archive.ubuntu.com feisty Release.gpg Ign...
3
2629
by: Paul Rudin | last post by:
I'm occasionally seeing tracebacks like this: Traceback (most recent call last): File "logging/__init__.py", line 744, in emit File "logging/__init__.py", line 630, in format File "logging/__init__.py", line 421, in format RuntimeError: instance.__dict__ not accessible in restricted mode I'm not sure what it means. Googling leads me to...
0
7615
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
7924
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
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7979
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...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
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...
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.