×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Disconnected Recordset

Disconnected Recordset

Disconnected Recordset

(OP)
HELLO!!!
is it possible  to work with disconnected  recordset in
Access project (ADP)???

When I write Set Rs.ActiveConnection = Nothing
and then
Set Rs.ActiveConnection = CurrentProject.Connection
Rs.UpdateBatch

the table in the SQL Server are NOT update
Are there any other ways to solve this problem ?

Thanks in advance !


RE: Disconnected Recordset

There is not enough information to work with.

Can you update the table from the ADP when NOT using the batch update?

Do you have sufficient permissions on the sql server tables?

What cursor location settings are you using? Is it a static cursor on the client side? What Locktype? i.e batchoptimistic

Is there something unique in the sql server table like a primary key or a timestamp field?

Are you iterating through the errors collection?

Need to see the connection and recordset properties on the Open.

RE: Disconnected Recordset

(OP)
Hello cmmrfrds

Yse, when i'am not set the Rs.ActiveConnection = Nothing it is working fine.

I have sufficient permissions

I  use adUseClient

There is nothing unique in the sql
I do not get any  errors.

RE: Disconnected Recordset

paste in your code.

RE: Disconnected Recordset

(OP)
on the  Form_Open event

Set Me.Recordset = AdoRS
Me.UniqueTable = "Customers"
Set AdoRS.ActiveConnection = Nothing

And then the user uses the form to do some
changes on the Recordset

In the CmdSave event

Set AdoRS.ActiveConnection = CurrentProject.Connection
     
AdoRS.UpdateBatch

I don't get any errors
But the table "Customers" has not  changed

RE: Disconnected Recordset

yaya013, I tried to recreate your example, but ran into the error message "data changed on Form but does not match criteria in recordsource". It is almost like Access is trying to resync with the data source. Did you run into this error and how did you get by it.

What you are trying to do makes sense, but there needs to be a way to tell Access just to accept the updates on the Form until one is ready for the batch update.

On your example, I wonder if you need to set the Form Recordset back to the other recordset before the batch update.

RE: Disconnected Recordset

(OP)
I got this error but it's ok.

I understand my mistake.
I did not open the recordset proparely (adLockBatchOptimistic)
now i'ts working perfect.

Thanks !!

RE: Disconnected Recordset

(OP)
to solve  this error :

on the Form_Error event

If DataErr = 30014 Then Response = False
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close