I’m extremely proud to announce the birth of our third child - Amelia Jane Gardiner. She was born yesterday morning at Ashford Hospital, weighing in at respectable 7lb 4oz (in the old money).
Narelle and Amelia are both doing very well.
Back before ADO.NET, we used good old ADO to do our data access in our ASP pages. To improve performance and avoid SQL injection attacks, it is good practice to use parameterised queries or stored procedures. Usually these are interchangeable but I’ve noticed today that ADO throws up the following error if you try and set up a return value parameter:
Microsoft OLE DB Provider for SQL Server error ‘80040e21’
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
For example, the following code gives that error:
Set Cmd = Server.CreateObject(“ADODB.Command”) Cmd.ActiveConnection = conn
Dim ParamReturn Set ParamReturn = Cmd.CreateParameter(“Return”, adInteger, adParamReturnValue) Cmd.Parameters.Append ParamReturn Cmd.CommandText = “INSERT INTO table (col1) VALUES (?); RETURN SCOPE_IDENTITY()” Cmd.CommandType = adCmdText
Cmd.Parameters.Append Cmd.CreateParameter(“p1”, adInteger, adParamInput, , “value”)
I haven’t found any solution, other than to use a stored procedure instead. Presumably return values aren’t supported for plain parameterised queries, though I haven’t seen that documented anywhere (yet).
This works quite well, but it only synchronises with other Thunderbird sessions. What I really wanted was to use the Contacts from GMail and synchronise with that. That way, whether I’m using Thunderbird, or just the GMail web interface, I’ll have the same details available for all the people in my contacts list. The problem is that Google hadn’t provided an API for accessing the Contacts data, but that all changed last month.
The good news is that Zindus are already working on a new extension for Thunderbird to synchronise with Google Contacts. I plan to try this out very soon.