473,385 Members | 1,622 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.

Access won't commit (to SQL Server linked table)

Hi,

Wondering if anyone can help with an append query I'm running in
Access. It should add records from an Access table to a linked SQL
Server table (linked via ODBC). I run the query by double clicking it
in Access - nothing clever.

Trouble is, the first thing Access does when I run the query (judging
by the SQL trace) is "set implicit_transactions on". Then, after the
query has run, it just doesn't commit the transaction.

In fact, the transaction stays open until the whole Access App (not
just the database) is closed. Obviously this means the table is locked
to all other connections in the mean time, and the appended data is
lost in the end anyway (because the transaction is never committed).

This seems really buggy to me, and I wondered if anyone had seen
it\solved it before.

Thanks,

Tim

Nov 13 '05 #1
5 4104
Biguana wrote:
Hi,

Wondering if anyone can help with an append query I'm running in
Access. It should add records from an Access table to a linked SQL
Server table (linked via ODBC). I run the query by double clicking it
in Access - nothing clever.

Trouble is, the first thing Access does when I run the query (judging
by the SQL trace) is "set implicit_transactions on". Then, after the
query has run, it just doesn't commit the transaction.

In fact, the transaction stays open until the whole Access App (not
just the database) is closed. Obviously this means the table is locked
to all other connections in the mean time, and the appended data is
lost in the end anyway (because the transaction is never committed).

This seems really buggy to me, and I wondered if anyone had seen
it\solved it before.


I've not noticed this but I do notice if the table has an identity
column and you insert into it, it turns IDENTITY_INSERT ON before the
query but doesn't turn it off again afterwards.

You might try executing the query from VBA e.g.
with currentdb
.execute "queryname",dbSeeChanges + dbFailOnError
end with

or wrap it in your own transaction although now that SQL Server supports
multi level transactions that might not work either.

--
[OO=00=OO]
Nov 13 '05 #2
Biguana wrote:
Hi,

Wondering if anyone can help with an append query I'm running in
Access. It should add records from an Access table to a linked SQL
Server table (linked via ODBC). I run the query by double clicking it
in Access - nothing clever.

Trouble is, the first thing Access does when I run the query (judging
by the SQL trace) is "set implicit_transactions on". Then, after the
query has run, it just doesn't commit the transaction.

In fact, the transaction stays open until the whole Access App (not
just the database) is closed. Obviously this means the table is locked
to all other connections in the mean time, and the appended data is
lost in the end anyway (because the transaction is never committed).

This seems really buggy to me, and I wondered if anyone had seen
it\solved it before.


I've not noticed this but I do notice if the table has an identity
column and you insert into it, it turns IDENTITY_INSERT ON before the
query but doesn't turn it off again afterwards.

You might try executing the query from VBA e.g.
with currentdb
.execute "queryname",dbSeeChanges + dbFailOnError
end with

or wrap it in your own transaction although now that SQL Server supports
multi level transactions that might not work either.

--
[OO=00=OO]
Nov 13 '05 #3
Cheers.

Unfortunately the query was running from VBA originally when the
problem was discovered. I started it running "manually" to try and
simplify things. The weird thing is, it works sometimes but I can't
work out what why.

Anybody else got any ideas? Maybe I should try a SQL Server group.

Tim

Nov 13 '05 #4
Cheers.

Unfortunately the query was running from VBA originally when the
problem was discovered. I started it running "manually" to try and
simplify things. The weird thing is, it works sometimes but I can't
work out what why.

Anybody else got any ideas? Maybe I should try a SQL Server group.

Tim

Nov 13 '05 #5
Biguana wrote:
Cheers.

Unfortunately the query was running from VBA originally when the
problem was discovered. I started it running "manually" to try and
simplify things. The weird thing is, it works sometimes but I can't
work out what why.

Anybody else got any ideas? Maybe I should try a SQL Server group.


You could try, but they'll probably send you back here :-) But then
again, it wouldn't hurt to try.

--
[OO=00=OO]
Nov 13 '05 #6

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

Similar topics

3
by: Freelobly Li | last post by:
Hi all, I have encountered two problems when using linked tables; the linked table is connected to SQL server 2000. 1) How can I add the N prefix of a string constant in a query in order to...
1
by: annie | last post by:
Hi all, I have recently ported my Access 2000 app to SQL Server, keeping the Access client as the front end using linked tables. I am also using triggers on my SQL tables to trap orphan...
4
by: Neil Ginsberg | last post by:
I have ODBC linked tables to a SQL 7 database in an A2K database. The linked tables do not have the password stored in them, so the first time the user accesses them, they need to enter the SQL...
8
by: Bri | last post by:
Greetings, I'm having a very strange problem in an AC97 MDB with ODBC Linked tables to SQL Server 7. The table has an Identity field and a Timestamp field. The problem is that when a new record...
3
by: Zlatko Matić | last post by:
Hi! What happens with linked tables if they were linked using File DSN, when I copy the Access file on some other PC without File DSN ? What is the difference between DSN on linked tables and...
0
by: Biguana | last post by:
Hi, Wondering if anyone can help with an append query I'm running in Access. It should add records from an Access table to a linked SQL Server table (linked via ODBC). I run the query by...
4
by: Wayne Wengert | last post by:
I am trying to create a VB.NET Windows application to move some data from a local Access DB table to a table in a SQL Server. The approach I am trying is to open an OLEDB connection to the local...
20
by: TC | last post by:
I need an automated procedure to copy data from an Access table to a SQL Server table. Speed is important. What is the recommended technique? I can export the data from Access, copy it via FTP,...
1
by: mgworek | last post by:
access xp, sql server 2000. Just converted entire database to sql and keeping access front end. Problem is only with one table. inserting a new record works fine. If I go back to that record...
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: 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...
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.