Mærkelig fejl med autonummering
Hej,Jeg har en acess database kørende hvor jeg skal indsætte nogle data i en tabel. Tabellen ser således ud:
- Type
* TypeID, Autonummering
* TypeName, Tekst max. 255 tegn
Men når jeg indsætter i min table får jeg følgende fejl:
Microsoft JET Database Engine error '80004005'
The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.
/bendix/admin/addtype.asp, line 37
Min kode ser således ud:
strSQL = "INSERT INTO"
strSQL = strSQL & " Type("
strSQL = strSQL & "TypeName"
strSQL = strSQL & ")"
strSQL = strSQL & " VALUES("
strSQL = strSQL & "'" & strName & "'"
strSQL = strSQL & ")"
objConn.Execute(strSQL)
Hvad går galt?
