Thursday, 2 July 2009

How to code a Ford Stereo (MkIV Mondeo)

I crashed the car BOO!

The garage fixed it YAY!

but they didn't put the code back into the stereo.


My wife (bless her cotton socks) was struggling, she says the manual is not clear on how to do this.

We know the code - this will not help if you don't know the code.

Lets say the code is 3214

To enter this into the stereo you would press the following keys

1,1,1,2,2,3,4,4,4,4

I.e. press the positional key enough times to get the position to the code number - Position 3 should show number 1 so you only press it once. Position 4 should show number 4 so you press it four times.

When the correct code is shown, press 5 to comitt it to the radio. the radio should now come on. If not then contact your garage, as you may have the wrong code.


SQL queries and Excel - refresh query definition

Scenario:

In SQL I have a table function which returns a set of data.

Because you can't access table functions directly in Access and Excel (I am working in Excel at the moment..) we also have to create a view

create view dbo.myview as select * from dbo.mytablefunction

When you query this view in Excel, you get back the expected data set.

Now I enhance the table function to add new fields to the data set.

If you run select * from dbo.mytablefunction() then the new fields are returned. If you try to query the view in Excel, the new fields are not available - Confounding mystery!

After some poking around and not finding a solution on the web, I 'stumbled' upon the solution.

When I ran the view (select * from dbo.myview), it also did not return the new fields. I had to modify the view (open it in MSSM and execute the alter view script) and then the new fields were available. now when I access the view in Excel, the new fields are there - hooray!!

It is a shame that SQL does not warn you (or give you a prompt to update dependent queries) - yet another reason not to use select * I guess.