Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
majnoon
Starting Member
26 Posts |
Posted - 2003-05-28 : 05:45:36
|
| DECLARE @object intDECLARE @hr intDECLARE @property bit--varchar(255)DECLARE @return varchar(255)DECLARE @src varchar(255), @desc varchar(255)-- Create an object.EXEC @hr = sp_OACreate 'CiscoXMLImport.ImportCiscoXML', @object OUTIF @hr <> 0 BEGIN EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc Return END-- Get MINC CablesEXEC @hr = sp_OAMethod @object, 'UploadFamilyBOOT', 'C:\CiscoXML\Copy of 1137_family_boot_05192003.xml', '[2A1_WsaleFamilyBOOT]', @Property OUTIF @hr <> 0 BEGIN EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc RETURN ENDELSE BEGIN print @Property END-- Destroy the object.EXEC @hr = sp_OADestroy @objectIF @hr <> 0 BEGIN EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc Return EndThis script is calling a dll which takes an XML file puts its data into a SQL Server table, where 'C:\CiscoXML\Copy of 1137_family_boot_05192003.xml' is the path of an XML file and '[2A1_WsaleFamilyBOOT]' is the name of the table the data is going to.the CiscoXMLImport.dll has been placed in the WINNT\System32 folder and registered, how ever i keep getting the following error"sp_OAMethod usage: ObjPointer int IN, MethodName varchar IN [, @returnval <any> OUT [, additional IN, OUT, or BOTH params]]"Can anyone please helpWishing you a peaceful journey |
|
|
JCamburn
Starting Member
31 Posts |
Posted - 2003-05-30 : 19:25:40
|
From the information you gave, I assume that UploadFamilyBOOT is a method that returns a boolean. The method takes two arguments, namely an XML file path and a table name (both strings). If this is correct then,This error:quote: "sp_OAMethod usage: ObjPointer int IN, MethodName varchar IN [, @returnval <any> OUT [, additional IN, OUT, or BOTH params]]"
Tells you that the order of the parameters in this statement:quote: EXEC @hr = sp_OAMethod @object, 'UploadFamilyBOOT', 'C:\CiscoXML\Copy of 1137_family_boot_05192003.xml', '[2A1_WsaleFamilyBOOT]', @Property OUT
is incorrect. it should be:EXEC @hr = sp_OAMethod @object, 'UploadFamilyBOOT', @Property, 'C:\CiscoXML\Copy of 1137_family_boot_05192003.xml', '[2A1_WsaleFamilyBOOT]' |
 |
|
|
|
|
|
|
|