473,804 Members | 3,182 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CurrentDb work in MDB but ADP

2 New Member
Hi,

A sample code as below:
Private Sub codetesting()
Dim rs As DAO.Database

Set rs = CurrentDb

MsgBox (rs.Name)
End Sub

Why this code works in a MDB file but error in a ADP file with error code "Object variable or With block variable not set (Error 91)"?

Below the References library were selected both in MDB and ADP file

Visual Basic for Applications
Microsoft Access 9.0 Object library
OLE automation
Microsoft ActiveX Data Objects 2.8 Library
Microsoft DAO 3.6 object library


Jacky
Jun 23 '07 #1
2 1994
missinglinq
3,532 Recognized Expert Specialist
That would be because an ADP file is not a database! A database holds data, while an ADP file simply holds the front end structures!
Jun 23 '07 #2
jkych
2 New Member
That would be because an ADP file is not a database! A database holds data, while an ADP file simply holds the front end structures!
So, how do i open a recordset in ADP file? use ADO?
Jun 26 '07 #3

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

Similar topics

4
72322
by: Matt Parkins | last post by:
I think I may have lost the plot. Just a few years ago I'm sure I wrote something similar to the following code: dim rst as recordset set rst = currentdb.openrecordset("mytable") ' blah blah blah rst.close
8
477
by: frank | last post by:
Below is some code for doing and insert into one of my tables. The inserts do not work because a duplicate key exists, which I want to happen. The problem is, I cannot get access to return an error for this condition. What can I do to get access to return an error on my query? Thanks
5
8277
by: Vladislav Moltchanov | last post by:
I am making data entry tool in Acc2K for several data collecting centres. It is convenient to have several files (mde file, .mdb with tables only etc) located in the same directory. To make linkage automatically it is necessary to get the directory where all these files are located. One way is to supply it through interaction with local user. However, it would be easier to have reliable way to get this infor automatically. Does Somebody...
4
3788
by: polux | last post by:
Hi everyone, i'm getting lost here... used to work with Access97 now Access2002 I'm having trouble finding currentdb Following references are checked: vb for applications
1
10824
by: jnikle | last post by:
I have a parameter query named "qry_employee_info_reports" that I need to run in the OnOpen event of a form. I'm after its total number of records. The query's got several joins in it, and one of them is to query "qry_last_transition," which is also a parameter query. Both querys use the same parameter: a control called "txtSecondDate" on a pop up form. What I've been trying to do up to this point is to open up this parameter form,...
7
5006
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
8633
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 work just fine. Why and when (and what) would anything go inside those parentheses?
4
4153
by: ray | last post by:
I am creating a new module in an existing ADP (new ground for me, have only ever used mdb's before). The module is a copy of some Albert Kallal code posted a while ago, which searches modules. It fails saying 'Object Variable or With Block not set'. It seems that the dbxxx object reference can't be set. When I put my cursor over it, it shows dbxxx=Nothing.
1
3743
by: sphinney | last post by:
As my Access form opens, I want it to find the names of the tables in the current Access database and populate a combobox with the table (recordset) names. Problem is, the CurrentDb.Recordsets object is empty even though I have two tables in the database. I'm using the code below, but the combobox remains empty. That's because CurrentDB.Recordsets is empty. Is this a bug with CurrentDb or have I done something dumb? Dim TBL As...
1
3120
MitchR
by: MitchR | last post by:
Hello Folks; I have run myself into a hole I cannot get of and need some assistance. I have a Form "Frm_ATandT_Activation_Center" that has a sub form "Frm_ATandT_Activation". Frm_ATandT_Activation_Center is standard in Form View with no Master or Child links to the Sub form. this allows me to show available SIM ID"S in inventory for activation. The Subform diplays as a datasheet that has a Query as the control source. So when the user opens...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9577
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10569
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10325
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10315
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
7615
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6847
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5519
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.