473,322 Members | 1,610 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,322 software developers and data experts.

splitted database crashes when adding records to linked table

k
Hi all

I split a database in a table-part and a all-the-rest-part and linked
the tables, but my code adding records to a table crashes on

Set rs = db.OpenRecordset("tblDeltakelse", dbOpenTable,
dbAppendOnly)

I think, some places where I do the same thing to another table it just
says "Invalid Operation", I press OK and nothing happens, and I am just
as wise as to what operation was invalid.

I guess the OpenRecordset needs to know that it's supposed to open a
table that is linked, but I have no idea how to tell it that.

Anyone?
K

Nov 13 '05 #1
8 2064
k wrote:
Set rs = db.OpenRecordset("tblDeltakelse", dbOpenTable,
dbAppendOnly)


Use dbOpenDynaset with linked tables.

--
--
Lyle
--
Nov 13 '05 #2
k
Thanks

But "method or data member not found"

I guess I should replace my line right before the openrecordset:
Set db = CurrentDb

with something else, to indicate that I am opening another db?

I'm a bit clueless here, nubi with this coding stuff in access

K

Nov 13 '05 #3
k wrote:
Thanks

But "method or data member not found"

I guess I should replace my line right before the openrecordset:
Set db = CurrentDb

with something else, to indicate that I am opening another db?

I'm a bit clueless here, nubi with this coding stuff in access

K


Are you sure you have a reference to DAO? What choices do you get from
the intellisense dropdown?

--
This sig left intentionally blank
Nov 13 '05 #4
k
I guess I'm in over my head here, my db was working fine, but I wanted
to split it to easier make updates.
I seem not to be able to answer your questions...

Q: Are you sure you have a reference to DAO
A: I'm not sure, I don't know what you mean, and really never got the
hang of DAO...

Q: What choices do you get from the intellisense dropdown?
A: What is the intellisense dropdown?

Nov 13 '05 #5
k wrote:
I guess I'm in over my head here, my db was working fine, but I wanted
to split it to easier make updates.
I seem not to be able to answer your questions...

Q: Are you sure you have a reference to DAO
A: I'm not sure, I don't know what you mean, and really never got the
hang of DAO...
If it was working before it must have been there, the method of data
access you're using is DAO.
Q: What choices do you get from the intellisense dropdown?
A: What is the intellisense dropdown?


When you type something like "db." in the code window you get a dropdown
list of methods and properties for the database object.

--
This sig left intentionally blank
Nov 13 '05 #6
k
> When you type something like "db." in the code window you get a
dropdown
list of methods and properties for the database object.

--
This sig left intentionally blank


Thanks for hanging in there with me...

The dropdown doesn't give me a .opendynaset but the openrecordset is
there.

I paste the whole code-piece here, what i does, or what it did before i
split my db, was to add a number of records to a many-to-many relation
table (tbl1), based on the selected items in a list.

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim varEvent As Variant
Dim ctlEvent As Control

Set ctlEvent = Me.List1
Set db = CurrentDb
Set rs = db.OpenRecordset("tbl1", dbOpenTable, dbAppendOnly)

For Each varEvent In ctlEvent.ItemsSelected
rs.AddNew
rs.Fields("field1") = Me.ID
rs.Fields("field2") = ctlEvent.ItemData(varEvent)
rs.Update
Next varEvent
rs.Close
Set rs = Nothing
Set db = Nothing
I guess the first to codelines is my reference to DAO...
K

Nov 13 '05 #7
k wrote:
When you type something like "db." in the code window you get a


dropdown
list of methods and properties for the database object.

--
This sig left intentionally blank

Thanks for hanging in there with me...

The dropdown doesn't give me a .opendynaset but the openrecordset is
there.


Set rs = db.OpenRecordset("tbl1", dbOpenDynaset, dbAppendOnly)
--
This sig left intentionally blank
Nov 13 '05 #8
k

Trevor Best wrote:

Set rs = db.OpenRecordset("tbl1", dbOpenDynaset, dbAppendOnly)
--
This sig left intentionally blank


Thank you Trevor!

K

Nov 13 '05 #9

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

Similar topics

7
by: Andante.in.Blue | last post by:
Hello everyone! I've been working with a problematic legacy database for a while. While I am still fairly new to Access, the more I work with the database, the more problems I've uncovered. ...
7
by: Danny J. Lesandrini | last post by:
I know this has been discussed before, as I've seen the Google posts, but they all leave me with an unanswered question: Does my DAO code executed in the front end cause the back end to bloat?...
1
by: Mike Ridley | last post by:
I am trying to create a new query using 3 linked tables. As soon as I add the third table to the design grid Access crashes. I have looked in the newsgroup and find that there have been problems...
4
by: Andi Plotsky | last post by:
I have a database (2000.mdb) which links to my data tables (Data2000.mdb). The database has a Main Menu screen (not a switchboard - a custom one). I need to import records from 5 text files into...
12
by: Gary | last post by:
I have a backend Database with just one main table in it (no form/queries etc) The network pc's have the front end database (with all the forms, queries,macros etc). These front ends are linked...
29
by: MP | last post by:
Greets, context: vb6/ado/.mdb/jet 4.0 (no access)/sql beginning learner, first database, planning stages (I think the underlying question here is whether to normalize or not to normalize this...
5
by: alingsjtu | last post by:
Hello, every body. When execute dynamic generated multiple OPENQUERY statements (which linkes to DB2) in SQLServer, I always got SQL1040N The maximum number of applications is already connected...
10
by: Jim Devenish | last post by:
I have a split front end/back end system. However I create a number of local tables to carry out certain operations. There is a tendency for the front end to bloat so I have set 'compact on...
0
by: David | last post by:
On Wed, Jun 18, 2008 at 11:16 AM, M.-A. Lemburg <mal@egenix.comwrote: Thanks for your reply. How do you maintain foreign key references with this approach? eg, you have these 4 tables: ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.