473,503 Members | 9,887 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 2952
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,557 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,557 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
1447
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()...
2
2826
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...
10
7302
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...
2
4007
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...
7
6863
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...
7
4980
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...
3
8619
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...
0
1857
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...
3
2626
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...
0
7095
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...
0
7361
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...
0
7470
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...
0
5602
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,...
1
5026
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...
0
4693
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3183
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1523
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 ...
0
403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.