473,385 Members | 1,587 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

multiple dao recordsets???

I am trying to append records in one table depending on records in two
other tables. I have tried to do it using DAO, but I keep getting an
error message saying

'The Microsoft Jet database engine could not find the object ". Make
sure that the object exists and that you spell its name and the path
name correctly.'

Can you not have three different recordsets in the DAO recordset? Or
is that a completely stupid question?
My code is

Dim MyDb As Database
Dim MyRecs As DAO.Recordset

Set MyDb = CurrentDb()
Set MyRecs = MyDb.OpenRecordset(Table1,DB_OPEN_TABLE)

Dim MyRecs2 As DAO.Recordset
Set MyRecs2 = MyDb.OpenRecordset(Table2, DB_OPEN_TABLE)

Dim MyRecs3 As DAO.Recordset
Set MyRecs3 = MyDb.OpenRecordset(Table3, DB_OPEN_DYNASET)

The records in Table3 are the ones I wish to add to and alter using
information from and depending on certain entries in Table1 and
Table2. Have I the DB_OPEN_?=(table or dynaset) written wrongly? I
can't find any info in the help as regards exactly what these mean,
but using them in this way in the past has worked. Putting checks into
the above code, the error is thrown up after or during the definition
of MyRecs2.

If this method just won't work...how might I move periodically through
fields and records in both Table1 and Table2, and subsequently alter
Table3? Any suggestions would be greatly appreciated. Thank you in
advance.
Nov 13 '05 #1
3 2835
Assuming Table1, Table2 and table3 exist, put them in inverted comas in the
openrecordset statement
Set MyRecs = MyDb.OpenRecordset("Table1") etc

HTH

Phil
"MissiMaths" <mi********@hotmail.com> wrote in message
news:75**************************@posting.google.c om...
I am trying to append records in one table depending on records in two
other tables. I have tried to do it using DAO, but I keep getting an
error message saying

'The Microsoft Jet database engine could not find the object ". Make
sure that the object exists and that you spell its name and the path
name correctly.'

Can you not have three different recordsets in the DAO recordset? Or
is that a completely stupid question?
My code is

Dim MyDb As Database
Dim MyRecs As DAO.Recordset

Set MyDb = CurrentDb()
Set MyRecs = MyDb.OpenRecordset(Table1,DB_OPEN_TABLE)

Dim MyRecs2 As DAO.Recordset
Set MyRecs2 = MyDb.OpenRecordset(Table2, DB_OPEN_TABLE)

Dim MyRecs3 As DAO.Recordset
Set MyRecs3 = MyDb.OpenRecordset(Table3, DB_OPEN_DYNASET)

The records in Table3 are the ones I wish to add to and alter using
information from and depending on certain entries in Table1 and
Table2. Have I the DB_OPEN_?=(table or dynaset) written wrongly? I
can't find any info in the help as regards exactly what these mean,
but using them in this way in the past has worked. Putting checks into
the above code, the error is thrown up after or during the definition
of MyRecs2.

If this method just won't work...how might I move periodically through
fields and records in both Table1 and Table2, and subsequently alter
Table3? Any suggestions would be greatly appreciated. Thank you in
advance.

Nov 13 '05 #2
MissiMaths wrote:
Dim MyRecs2 As DAO.Recordset
Set MyRecs2 = MyDb.OpenRecordset(Table2, DB_OPEN_TABLE)

Dim MyRecs3 As DAO.Recordset
Set MyRecs3 = MyDb.OpenRecordset(Table3, DB_OPEN_DYNASET)


As Phil suggested, enclose the table name in double quotes.

Also, it's good programming practice todeclare ALL variables at the very
beginning of a procedure, regardless of where the variable will be used.

--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #3
Thank you! Thought it was something simple but just couldn't see it.
So obvious now. Thanks for your help!
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: (Pete Cresswell) | last post by:
I posted this in the MS Access group, but no luck. ------------------------------------------ I've got another stored procedure in the same app that returns multiple recordsets and the code works....
3
by: sans_spam | last post by:
I want to pull 2 different recordsets using 2 different stored procedures using the same Data Connection. Below is the code that I currently have, but I'm getting an 'Object Required' error...
2
by: Keith Chadwick | last post by:
I prefer to use stored procedures over having sql statements sitting in my ..NET code. My problem is I can not figure out how get .NET to understand there are multiple recordsets coming back. ...
8
by: Tull Clancey | last post by:
Hi, hope someone can help. I'm writing a decent size app as a first project in Net, have been writing in VB for years. I've stumbled on a small problem, I can't open two connections to a...
12
by: Scott | last post by:
Front-end Access 2000 I have a stored procedure that has 2 parameters BusinessUnitID and Year. It returns multiple record sets (5 to be exact). I thought I could use a Pass through query but...
16
by: Randy Harris | last post by:
I was inspired by the recent discussion of returning multiple recordsets to ADO from a stored procedure. (Amazed is probably more accurate). I asked about how to accomplish same with Oracle and...
6
by: blue875 | last post by:
Hello helper people who are smarter than me: I have a form that needs to submit multiple queries to different tables during one Sub's execution. Some sections are as simple as: 1| With rst 2|...
0
by: nachiket2k2 | last post by:
Hi, I am using VB 6.0, ADO 2.0 with MS Access 2000 Database. in a vb form, i need to fatch data from 3 different tables (ABC.MDB). it will be a tedious job if i create 3 connections with 3...
3
by: Dooza | last post by:
Hi there, I have a Stored Procedure in SQL 2000 that takes 10 input paremeters, and outputs 11 recordsets, not rows, but 11 different SELECT statements. The purpose of this is to for a menu...
0
it0ny
by: it0ny | last post by:
Hi guys, thanks I am fairly new to this forum so I hope I chose the right place to post this question. I try to make my program printout a deposit's report. I created a class to store the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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
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,...
0
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...

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.