When i'm trying to exute a piece of code it's giving this error. Please help me on this. i'm in desperate need of this.
Code snippet:
dim rst as recordset
dim db as database
Set rst = db.OpenRecordset("select * from qrySelect",dbOpenSnapshot)
8 4125 NeoPa 32,556
Expert Mod 16PB
At this point db is set to Nothing.
Try using CurrentDB.OpenRecordset or setting db first.
Firstly check that the Microsoft DAO library is ticked on the references list. You will find this on the Tools menu in the VB Editor window.
Then the code is as follows: -
Dim rst As Recordset
-
Dim db As DAO.Database
-
-
Set db = CurrentDB
-
Set rst = db.OpenRecordset("select * from qrySelect",dbOpenSnapshot)
-
hi
This is related to your suggestion for Invalid procedure call in ms access. I tried by setting it as a new datbase but it's giving an error ' wrong usage of New keyword'. here is the snipet(original) of the code used. please let me know where to modify. - Dim db As Database
-
Dim rst As Recordset
-
-
Set db = DBEngine(0)(0)
-
-
Set rst = db.OpenRecordset("select * from qrySelect_CostDifferences", dbOpenSnapshot)
Please help me on this.
regards,
garimella
hi
This is related to your suggestion for Invalid procedure call in ms access. I tried by setting it as a new datbase but it's giving an error ' wrong usage of New keyword'. here is the snipet(original) of the code used. please let me know where to modify. - Dim db As Database
-
Dim rst As Recordset
-
-
Set db = DBEngine(0)(0)
-
-
Set rst = db.OpenRecordset("select * from qrySelect_CostDifferences", dbOpenSnapshot)
Please help me on this.
regards,
garimella
garimella
I used Set db = CurrentDB not DBEngine(0)(0)
Hi
I tried db=CurrentDb(), but it didn't work it's still giving that error. I've checked the project references, they are fine. This was running fine until Jan 10th. I don't why this started giving this error. I'm trying to run this query manually, not from the code, even then it's giving the same error. I've been trying to fix it for the last 10days but i couldn't, Please help me if there are any other things that does cause this error.
Regards,
Garimella
Hi
I tried db=CurrentDb(), but it didn't work it's still giving that error. I've checked the project references, they are fine. This was running fine until Jan 10th. I don't why this started giving this error. I'm trying to run this query manually, not from the code, even then it's giving the same error. I've been trying to fix it for the last 10days but i couldn't, Please help me if there are any other things that does cause this error.
Regards,
Garimella
Check that qrySelect exists as a query and check the spelling of the query.
Exactly which line is the code stopping at?
NeoPa 32,556
Expert Mod 16PB
Hi
I tried db=CurrentDb(), but it didn't work it's still giving that error. I've checked the project references, they are fine. This was running fine until Jan 10th. I don't why this started giving this error. I'm trying to run this query manually, not from the code, even then it's giving the same error. I've been trying to fix it for the last 10days but i couldn't, Please help me if there are any other things that does cause this error.
Regards,
Garimella
If it doesn't work for you when running it manually, when it did before (I assume), then there is something wrong.
You could try posting the SQL of the query here for a quick checkover, but it may well be an issue not directly related to your project.
Hi
I tried db=CurrentDb(), but it didn't work it's still giving that error. I've checked the project references, they are fine. This was running fine until Jan 10th. I don't why this started giving this error. I'm trying to run this query manually, not from the code, even then it's giving the same error. I've been trying to fix it for the last 10days but i couldn't, Please help me if there are any other things that does cause this error.
Regards,
Garimella
Sorry Garimella
Didn't read the last part of this post properly. It sounds like the problem exists in the query rather than the code. Open the query in design view then change the view to sql and copy and paste code here.
Mary
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Martin Lacoste |
last post by:
Ok, before I headbutt the computer... don't know why when I add
criteria in a query, I get an 'invalid procedure call'. I also don't
know why after searching the help in access, the various access...
|
by: PeteCresswell |
last post by:
-----------------------------------------------------------------
Sub Sheesh()
Dim myYears As Double
Dim myRawCumulative As Double
Dim myAnnualizedROR As Double
...
|
by: sara |
last post by:
I am trying to identify if a information in a details field
(damagedetails; soildetails) has NOT been entered if the presence of
damage or soil has been determined (check boxes: chkDamage and...
|
by: chitocute |
last post by:
Hello,
I'm currently maintaining a system software right now (done with visual basic 6.0) that runs on windows 98 flatform before. Time came when we upgraded to win2003 and accessed the server...
|
by: K Viltersten |
last post by:
I've seen some people calling a stored procedure
on MS SQL Server and intercepting an invalid
parameter list by a switch statement, demanding
that each of the parameters names is exactly as
the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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...
|
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...
|
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,...
| |