Problem writing to server

DianeG63

Registered User.
Local time
Today, 01:23
Joined
May 13, 2008
Messages
12
I have an access database version 2003 that when I run it locally, it runs fine, but when I attach it to live on the server it will not write the records. I have set a boolean return on my sub routines and they are coming back without any errors, but the darn thing will not write the records. I started by using just the .addnew and .update, but then added .begintrans and .committrans, but still get the same results. Any records that have been updated to the local database are writing fine. Does anyone have any ideas on what I can do to correct this. BTW, the live version does not have any restrictions and is not read only. Thanks,
 
If you open a linked table from the navigation pane can you edit records directly?
 
yes, I didn't write the original database and it is using the autonumber. I'm wondering if that has something to do with it. Although, I am writing that autonumber to a local table and it is coming in. Thanks,
 
What does you code look like for ading/editing data on your server? I asume you are using a split database. FE-BE
 
Nothing out of the ordinary. strpath is a constant that is set in the globals module and I have used extensively in the past.

set db = currentdb
set dbs = dbengine(0).opendatabase (strpath)

set rst = db.openrecordset ("Table 1")
set rst2 = dbs.openrecordset ("Table 2")
if not rst.eof then
do
with rst2
.addnew
!field1 = rst!field1
.update
end with
rst.movenext
loop until rst.eof
end if
 
Try being explicit in your declarations

Dim db As DAO.Database
Dim rs As DAO.Recordset
 
When you say it does not add is it doing anything? what error messages ar you getting.
 
I can step through the code and it hits all the fields, and I can see the data moving from each field, but after the .update, nothing appears in the other table. All tables within the currentDB update correctly. It is only the ones that are in another db. The routine completes with no errors.
 
Folder permissions on the server?

edit: sorry should have explained it a bit more, can you see the permissions of the folder the back end is sitting in? you may have read only permissions
 
Try removing the dbengine(0). of the server connection

Then try this

Code:
Dim Rst As DAO.Recordset
Dim dbs as DAO.Database
Set dbs = OpenDatabase("S:\Path\File.mdb")

Set rst = dbs.OpenRecordset("Table 2")

Do Until rst.EOF
  Debug.print Rst(0)
  rst.MoveNext
Loop
rst.Close
Set rst = Nothing

Where S:\Path\File.mdb is the full path and file name of the backend

Does it return any data items
 
that worked!!!! Funny, I always used the DBEngine(0) in the past. Oh well, thanks for all your help.
 
DBEngine set up the workspace and as you have already used DBEngine(0) for your current db you tried to re asign it to the server db. By removing it Access set up the workspace dynamically for you.
 

Users who are viewing this thread

Back
Top Bottom