Link to home
Start Free TrialLog in
Avatar of HKFuey
HKFueyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Access error after changing primary key data type

I changed an autonumber (int) to bigint

I now get an error on this line: -
Set Rst = Dbs.OpenRecordset(Sql, dbOpenDynaset, dbSeeChanges)

"Data type missmatch"

Does anyone know how to solve?
Avatar of ButlerTechnology
ButlerTechnology

Are you passing any variables that work with the SQL variable?  It sounds like you have a variable declaration that is INT and you are now attempting to assign a BIGINT.

It could also be the actual SQL query with joins that is causing the issue.  I would recommend taking a look at the query that is being used by the SQL variable.

Tom
Avatar of HKFuey

ASKER

Hi Tom,
The code was working until I removed the autonumber and changed int to bigint on the Key field.

I had a look at the table in access and just get lots of #Deleted, I tried changing from bigint to int then relinked the table and still got lots of #Deleted
Avatar of HKFuey

ASKER

OK I'm sorted.

I restored the database, removed the Autonumber without changing the datatype and it is now OK.
ASKER CERTIFIED SOLUTION
Avatar of ButlerTechnology
ButlerTechnology

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HKFuey

ASKER

Change back to int sorted it