(SQL Server) Setting a Maximum URL Length
The MaxUrlLen property prevents the spider from retrieving URLs that grow too long. The default value of MaxUrlLen is 300.
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
DECLARE @hr int
DECLARE @spider int
-- Use "Chilkat_9_5_0.Spider" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.Spider', @spider OUT
IF @hr <> 0
BEGIN
PRINT 'Failed to create ActiveX component'
RETURN
END
EXEC sp_OAMethod @spider, 'Initialize', NULL, 'www.chilkatsoft.com'
-- Add the 1st URL:
EXEC sp_OAMethod @spider, 'AddUnspidered', NULL, 'http://www.chilkatsoft.com/'
-- This example demonstrates setting the MaxUrlLen property
-- Do not add URLs longer than 250 characters to the "unspidered" queue:
EXEC sp_OASetProperty @spider, 'MaxUrlLen', 250
-- ..
EXEC @hr = sp_OADestroy @spider
END
GO
|