Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Same db, 2 different machines, different error numbers?

Status
Not open for further replies.

mikevh

Programmer
Apr 23, 2001
1,033
US
Another user has copied a db that I programmed onto her
machine. We both have the same version of Access (2000).
In a module, I'm executing a "DROP TABLE" statement.
The table I'm trying to drop may or may not exist. On my machine, if the table doesn't exist, I get error 3371, "Can't find table or constraint." On her machine, it's error 3376, "Table doesn't exist." (I may not have the exact wording there.)

It would be pretty simple to modify the code in my error
handler to account for the fact that it may be either
error number, and that's what I've done as a temporary
measure. But what would account for this?
(We both have the same references checked, no missing
references.)

I appreciate any help. Thanks.
 
Do you have the same service packs for office 2000 installed?
 
Our sysadmin says that we do ...

But can you tell me where I would find that information,
so I can double-check?
 
In Access goto Help - About Microsoft Access. It will tell you the version of Access and then it should show what service pack it is after that.
 
Yes, we do have the same service packs installed.
(I wasn't sure if this was what you were referring to
when you said "service packs for office 2000".)
 
Ok.

Check and make sure that each machine has the same reference libraries open.

In the VB editor goto Tools - References

Look at what is checked for each and make sure that they are in the same order.

 
We have the same references checked, in the same order.
 
Hummmm....

I'm not sure what else to check. Hopefully someone else will read this and have some ideas.
 
Thanks anyway, I appreciate the help.
If anyone else knows what's going on here, I'd appreciate
your input.
 
Simple solution

Put an "ON ERROR RESUME NEXT" in front of your Drop Table query.
 
MisterC,

I agree, but that still does not explain why the 2 different error numbers.

I am very curious to know what is causing it.
 
You could check to see if the table exists before dropping it. Here is a function to check if the tables exists. Substitute your name and add a paramter to pass the table name if you want to call the function.


Function ADOTables2() As String
'-- set reference to ADOX library
'- Microsoft ADO Ext. 2.6 for DDL and Security
'-- Microsoft ActiveX data objects 2.6 library also needed for ADO

Dim cg As New ADOX.Catalog
Dim tb As New ADOX.Table

Set cg.ActiveConnection = CurrentProject.Connection

For Each tb In cg.Tables
Debug.Print "table = "; tb.Name
If tb.Name = "IDTable" Then
ADOTables2 = "Found"
Set tb = Nothing
Set cg = Nothing
Exit Function
End If
Next
ADOTables2 = "NotFound"
Set cg = Nothing
Set tb = Nothing

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top