From: Gregory on
Hi ,
I got error message ever since Acees 97 database was converted into Access
2002. Nothing has been changed. ODBC connection is fine. Linked ODBC also
fine. DNS configurarion is okay. However, when I click on command button
named "Synchronize", it returned an error as above from Access 2002.
Synchronizing will be performed between Access data base and Web database
which is running on web server based on Oracle. Local client has Oracle
client 92.

The below code is being used since Access 97 for the command button on the
form:FRM_Synchronize.
----------------
Option Compare Database
Option Explicit
--------------------------------
Private Sub Command0_Click()
Form.SetFocus
Text1.Value = "Synchronizing... please wait ..."
Text1.SetFocus
Command0.Enabled = False
DoEvents
CurrentDb.Execute "DELETE FROM WEB_PROPERTY"
CurrentDb.Execute "INSERT INTO WEB_PROPERTY ( PROPERTY_ID, ..., ..., ,
...._NAME ) SELECT [INVENTORY - MASTER].ID, [INVENTORY - MASTER].Low, ...,
FROM [INVENTORY - MASTER];"
DoEvents
Text1.Value = "Done"
MsgBox "Done"
Command0.Enabled = True
End Sub

--------------------------

Debug always stopped at CurrentDb.Execute "DELETE FROM WEB_PROPERTY". I
found the fact that error # 3086 stands for "Web Query"

Would appreciate your help. I want to know how to make it work as it did
with Access 97.
Many thanks,


From: TC on
I assume the message is, "cannot delete FROM specified tables"?

There's nothing apparently wrong with the SQL, so it sounds like a
permissions problem. If you open that table directly, in datasheet
view, can you manually delete a record from it?

PS. This is not the cause of your problem, but, it is very inefficient
to use CurrentDb like that. Every call to CurrentDb, refreshes all the
collections (in memory). That is quite an operation. It's generally
better to cache the value in a variable, and use it from there:

dim db as database
set db = currentdb()
db.execute ...
db.execute ...
(etc.)
set db = nothing

HTH,
TC [MVP Access]

 | 
Pages: 1
Prev: Object Library!!! Download
Next: Subform issue