mdProgrammer
Programmer
Not sure if this goes under MS Access or MS SQL...
Not sure if this should go under SQL Server, MS Access, or even VB6 (if such a forum even still exists).
Here's a brief history here -
I have a client with a 15-year-old front end program (Asset Tracking) written in VB6, contains zero documentation, and the company that wrote it, is long disfunct. This program used to use tables in MS Access until they were moved to SQL server 2000 (yes, that will be upgraded eventually, too). On a side note, I may even wind up re-writing this if VB6 is not supported in the next version of Windows (or they will have to resort to using Microsoft Virtual PC). Now, here's where the problem lies -
There is a form that used to sort asset numbers for looking at asset history (asset numbers are not unique). I'm guessing this is because the original table had an index on the asset field.
(note, I haven't used indexing much in SQL Server, so I may or may not be doing this right) The table in SQL has a clustered index on the primary key. I tried to add an index for the asset field, but the form is still showing the numbers out of order. It seems that it's sorting the clustered index first, then the asset field.
I even tried selecting the asset field (with "Unique field" + "Ignore" selected and deselected) within the clustered index and moved it above the HistoryID field, and get this error -
Server: Msg 1907, Level 16, State2
Cannot re-create index... The new index definition does not match the constraint being enforced by the existing table.
What should I do to get this to work?
Now, this is assuming that the VB6 form is even looking at the table index in the first place (which I think it is, since when I select "Sort Order (DESC)", the asset order in the form list changes.
Not sure if this should go under SQL Server, MS Access, or even VB6 (if such a forum even still exists).
Here's a brief history here -
I have a client with a 15-year-old front end program (Asset Tracking) written in VB6, contains zero documentation, and the company that wrote it, is long disfunct. This program used to use tables in MS Access until they were moved to SQL server 2000 (yes, that will be upgraded eventually, too). On a side note, I may even wind up re-writing this if VB6 is not supported in the next version of Windows (or they will have to resort to using Microsoft Virtual PC). Now, here's where the problem lies -
There is a form that used to sort asset numbers for looking at asset history (asset numbers are not unique). I'm guessing this is because the original table had an index on the asset field.
(note, I haven't used indexing much in SQL Server, so I may or may not be doing this right) The table in SQL has a clustered index on the primary key. I tried to add an index for the asset field, but the form is still showing the numbers out of order. It seems that it's sorting the clustered index first, then the asset field.
I even tried selecting the asset field (with "Unique field" + "Ignore" selected and deselected) within the clustered index and moved it above the HistoryID field, and get this error -
Server: Msg 1907, Level 16, State2
Cannot re-create index... The new index definition does not match the constraint being enforced by the existing table.
What should I do to get this to work?
Now, this is assuming that the VB6 form is even looking at the table index in the first place (which I think it is, since when I select "Sort Order (DESC)", the asset order in the form list changes.