Re: Allowing Multiple people
A couple of questions:
Quote:
Originally Posted by manofsteel00
whenever there are multiple users I get a "Run-time Error 339: A File is missing or is invalid".
Does this mean that you do not get this error if only one person is using it? Two? Three? Have you noticed any consistency between the number of users and the occurrance of this error?
Do you know on what line of code this error is being generated from?
Re: Allowing Multiple people
You only need one connection, so remove one of those, and use the same for both recordsets. (it may be causing the problem)
Next up, why is there no "Exit Do" after the "inAlterTable = True" line? (you currently loop when there is no need!). You should then run "newRecordSet.MoveFirst" every time.
Also, you do not need two recordsets for this - just use one with SQL that joins the tables appropriately, eg:
Code:
SELECT DISTINCT m.PICKSL, m.DFP, m.PROD, m.DESC
FROM [MAIN] m
LEFT JOIN [ALTER] a
ON (a.PICKSL = m.PICKSL AND a.DFP = m.DFP AND a.PROD = m.PROD AND a.DESC = m.DESC)
WHERE (a.TYPEOFCHANGE <> 'SELECTED')
OR (a.PICKSL Is Null)
edit: oops, this should be the SQL I think:
Code:
SELECT DISTINCT m.PICKSL, m.DFP, m.PROD, m.DESC
FROM [MAIN] m
WHERE Not Exists(
SELECT *
FROM [ALTER] a
WHERE a.PICKSL = m.PICKSL
AND a.DFP = m.DFP
AND a.PROD = m.PROD
AND a.DESC = m.DESC
)
Re: Allowing Multiple people
I only get the error when two or more people are accessing the database.
Re: Allowing Multiple people
Quote:
Originally Posted by manofsteel00
I only get the error when two or more people are accessing the database.
Did you make the changes suggested by si_the_geek?
Re: Allowing Multiple people
Made the changes, but haven't been able to test it just yet. One quick question though: Would the SQL statement be the same if I wanted to connect to a table in another database or would I need to create another connect? Thank you in advance.
Re: Allowing Multiple people
It depends on what the DBMS's for each of the databases are (Access/SQL Server/etc).
If they are both the same, there is usually a way (there are ways I know of for Access and SQL Server).
Re: Allowing Multiple people
All the databases I connect to are Access 2002, so would I need to create two connections to update data from one database to another database?
Re: Allowing Multiple people
Here's how to reference tables from other databases (with or without database passwords):
http://www.vbforums.com/showthread.php?t=382366
You can use the same syntax as shown there to join a table in one database to a table in another.
Re: Allowing Multiple people
Is there a way to check to see if a database is locked? I think my problem is that the database is locked.
Re: Allowing Multiple people
A database would only be locked if it was opened exclusively, and if such is the case then you wouldn't even be able to connect to it is someone else has opened it exclusively, base on your connectionstring you are not opening it exclusively hence it is not being locked...