The table name prefix has very good reasons.
Consider:
TableA (id int identity, stringdata varchar(max))
TableB (id int identity, stringdata varchar(max))
We want to DELETE
from TableA
records that exist in both tables. Easy enough, we will just do an INNER JOIN
:
DELETE a
FROM
TableA A
INNER JOIN
TableB B
ON b.id = B.id
....and we just wiped out all of TableA
. We inadvertently compared B's ID to itself - every record matched, and every record got deleted.
If the fields had been named TableAId
and TableBId
this would be impossible (Invalid field name TableAid in TableB
).
Personally I have no issue with using the name id
in a table, but it's really a better practice to preface it with the table name (or entity name, if TableA
were people then PeopleId
would work fine too) to avoid accidentally comparing to the wrong field and blowing something up.
This also makes it very obvious where fields come from in long queries with lots of JOIN
s.
An access database is not a server, it's just a file. To access it, your server will need access to the filesystem on which it resides. Or, if you want to set up an SQL server on the same machine as the access database, it will still need access to the folder in which the file is stored.
A user logged into a VPN may not have the same drive mappings or file system permissions as a server process running on the same machine, so you will need to reflect this in the path to the file you use in the code.
Best Answer
There is a solution with DAO:
This checks, if there is a column with
Type
= 4 [dbLong
] and anAttributes
value of 17 (16 [dbAutoIncrField
] + 1 [dbFixedField
]).This worked fine for me so far.