What does the writevalue function return? The way you use it you should see some numbers on the screen.

If not you can put the code below beneath each writevalue line to see what is happening.

 Code:
?@error
?@serror
sleep 2


All numbers are error codes. Here http://msdn.microsoft.com/en-us/library/ms681381(VS.85).aspx you will find a list of all error codes.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.