didio
Starting Member
7 Posts |
Posted - 2001-06-04 : 09:39:53
|
Hi,I've made this stored proc, but it gives me errors and I can't find the problem,maybe somebody who is seeing what I do wrong..I get this error:0x80004005msxml3.dllUnspecified error Here is the stored proc:CREATE PROCEDURE spPostCodeChecker @NumZipCodes intASdeclare@hr int,@Object int,@SubscriberID int,@Zipcode varchar(6),@Name varchar(150),@Email varchar(150),@Business bit,@Output varchar(8000)--Create MSXML2.ServerXMLHTTP objectexec @hr = sp_OACreate 'MSXML2.ServerXMLHTTP', @Object outif @hr = 0 begin --Get records Set RowCount @NumZipCodes declare curRec cursor for SELECT SubscriberID, Zipcode, Name, Email, Business FROM vwAnnouncement WHERE Available = 0 AND LastChecked < GETDATE() - 7 ORDER BY LastChecked; --Looping trough the records open curRec fetch next from curRec into @SubscriberID, @Zipcode, @Name, @Email, @Business while @@FETCH_STATUS = 0 begin --Set properties and call send method of the object exec @hr = sp_OAMethod @Object, 'Open', 'GET', 'http://www.someurl.com', False exec @hr = sp_OAMethod @Object, 'Send' exec sp_OAGetProperty @Object, 'ResponseText', @Output out -- check if everything is oke. if @hr = 0 begin print @SubscriberID update tblAnnouncement set LastChecked = GETDATE() where current of curRec fetch next from curRec into @SubscriberID, @Zipcode, @Name, @Email, @Business end -- if not, then return error.. else begin declare @src varchar(1000), @desc varchar(1000) exec sp_OAGetErrorInfo @object, @src out, @desc out SELECT hr=CONVERT(varbinary(4),@hr), Source=@src, Description=@desc RETURN end end close curRec deallocate curRec end--Destroy MSXML2.ServerXMLHTTP objectexec sp_OADestroy @ObjectGO |
|