Sp_OAMethod Fails With 0x800A0046
Apr 18, 2008
I recently enabled OLE Automation on a SQLSERVER 2005 database in order to be able to create files directly from the DB. When I attempt to use the sp_OAMethod to open or create a file, it fails with an error code of 0x800A0046. The sp_OACreate 'Scripting.FileSystemObject' call does not return an error and returns a valid object handle. I'm guessing the error has something to do with Windows permissions but I'm not sure what I need to do to correct it?
View 3 Replies
ADVERTISEMENT
Oct 10, 2007
Hi Guys,
SET @psFilepath = 'C: est.txt'
SET @psFilepath = '\XXXXXShareTest est.txt'
EXECUTE sp_OAMethod @FileSystem , 'OpenTextFile' , @FileHandle OUTPUT , @psFilepath , 2, 1
If I set the file path to '\XXXXXShareTest est.txt', the above statement does not create the test.txt file. But If I set the Filepath to a local drive it works.
Is it possible to create the files on a Share using sp_OAMethod.
Thanks
View 2 Replies
View Related
Jul 18, 2001
Hi!
I have a COM object with one method that I want to call from a SQL Server 7 stored procedure.
The method in the COM object looks like,
(Public Sub getXmlData(sqlStr As String, xslPath As String, sourceID As String, sendMethod As String)
When I call this method from the SP I get an error,
Source: ODSOLE Extended Procedure
Description: sp_OAMethod usage: ObjPointer int IN, MethodName varchar IN [, @returnval <any> OUT [, additional IN, OUT, or BOTH params]]
The call in the procedure looks like,
EXEC @hr = sp_OAMethod @object, 'getXmlData',
@sqlStr ='SQL statement...',
@xslPath='C:Temp',
@sourceID='Test',
@sendMethod='file'
What do I do wrong?
Best regards,
Carl
View 1 Replies
View Related
Aug 17, 2000
I am trying to call a working DLL from a stored procedure. The object is made, but when I invoke a method, I get an error message that I guess indicates that I am calling it incorrectly. But I can’t find what’s wrong:
The COM is TDMSQLUtil.dll and is registered on the server, and only has one class and one method.
Public Sub RemoveItems(ByVal ItemNumbers As String, ByRef Col1 As String, _
Col2 As String, ByRef Col3 As String, ByRef Col4 As String, ByRef Col5 As String, ByRef Col6 As String, ByRef Col7 As String, ByRef Col8 As String, ByRef Col9 As String)
I call it with:
1 ) Exec @HResult = sp_OACreate 'TDMSQLUtil.cHandleString', @Object out
(this does not return an error)
2) Exec @HResult = sp_OAMethod @Object, 'RemoveItems', @ItemNumbers, @Col1 out, @Col2 out, @Col3 out, @Col4 out, @Col5 out, @Col6 out, @Col7 out, @Col8 out, @Col9 out
The error I get is:
sp_OAMethod usage: ObjPointer int IN, MethodName varchar IN [, @returnval <any> OUT [, additional IN, OUT, or BOTH params]]
What am I missing? I followed the instructions in BOL, or at least, I tried to>
Any help greatly appreciated
Thanks,
Judith
View 3 Replies
View Related
May 8, 2003
Where can I find a description of the methods and properties that are available for sp_OAMethod? I've looked in BOL and any other source I could think of but I come up dry everytime.
Sidney Ives
Database Administrator
Sentara Healthcare
View 2 Replies
View Related
Jul 23, 2005
Hello,I was trying to user the code below to run a DTS job. The job failswhen I get to the piece of code that begins:EXEC @rc = sp_OAMethod @PackageToken,'LoadFromSQLServer', ...It looks like it tries to look for the DTS package, because it takes 45seconds to execute when the server name is correct, leading me tobelieve that it is properly finding the server. Am "MyDTSPackage" isthe name of I saved my DTS Package under save as. I enter it in thelist below using single quotes just like I enter the server name.I am wondering if it is a permissions issue. I am running the thisstored procedure from SQL Query Analyzer:EXEC usp_OATest(The Stored Procedure gets created without a problem...it is running itthat is causing issues.)The error message is the custom one that shows at theError:line.Also, master..xp_cmdshell 'DTSRun....' works fine, but I would like tobe able to use this other method.Thanks in advance for any help!RyanCREATE PROC usp_OATestASDECLARE @rc intDECLARE @PackageToken intDECLARE @GlobalVariableToken int--Load DTS PackageEXEC @rc = sp_OACreate 'DTS.Package',@PackageToken OUTPUTIF @rc <> 0 GOTO ErrorEXEC @rc = sp_OAMethod @PackageToken,'LoadFromSQLServer',NULL,'ServerName',NULL,NULL,256,NULL,NULL,NULL,'MyDTSPackage'IF @rc <> 0 GOTO Error <------ERROR DETECTED HERE--execute packageEXEC @rc = sp_OAMethod @PackageToken,'Execute'IF @rc <> 0 GOTO Error--destroy packageEXEC sp_OADestroy @PackageTokenIF @rc <> 0 GOTO ErrorGOTO DoneError:EXEC sp_OAGetErrorInfo @PackageTokenRAISERROR('Error during package preparation or execution', 16, 1)Done:RETURN(@rc)GOEXEC usp_OATest
View 1 Replies
View Related
Sep 20, 2007
I use sp_OAMethod 'WriteLine' to write some VARCHAR data into a file. The problem is, that when the VARCHAR data contains special characters like "äüö", they not not correctly written and the file, if its a xml file is invalid.
VARCHAR data is "Datei abholenDateiname prüfen"
Statements are:
SET @XMLComment = '<!-- TestCase :' + @param_TestCase + ' -->'
execute @OLEResult = sp_OAMethod @FileID, 'WriteLine', Null, @XMLComment
Output is: <!-- TestCase Datei abholenDateiname pr�->
Is there any workaround to have it read/write special characters correctly in the file?
Any help is appreciated.
Thanks.
Added later:
I found a way to do the same with bcp, but also that utility has problems with "äöü" characters.
View 1 Replies
View Related
May 11, 2007
hey all.
im new to the ASP/SQL scene, so please bare with me.
i have to send an email (with two attachments) through sql server.
the mail arrives, but the attachments are not attachments... they are ascii text in the body. im using an existing stored proc, which apparently works. so there is no reason this shouldn't work.
The file exists, the path is correct. Its obviously seeing and reading the file (otherwise there would be no data to print as ascii)
thanks all.
Also, if you know of a better place where i can post this thread, please let me know
View 6 Replies
View Related
Jun 11, 2007
I did a small package with only one ODBC connection (Merant 3.70 32-Bit Progess). This package runs well in Visual Studio and fails when runs by SQL Server Agent.
Configuration:
SQL Server Agent on a 32Bit server.
The ODBC connection configuration in available on System DSN on this server.
The user of Server Agent have full access (Admin).
Connect Manager Provider: ".Net ProvidersOdbc Data Provider"
SQL Server version: 9.0.3042
Error Message:
Executed as user: TEKCON cadmin. ...ion 9.00.3042.00 for 32-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 16:50:33 Error: 2007-06-11 16:50:33.62 Code: 0xC0047062 Source: Data Flow Task DataReader Source [1] Description: System.Data.Odbc.OdbcException: ERROR [HYC00] [MERANT][ODBC PROGRESS driver]Optional feature not implemented. ERROR [HY000] [MERANT][ODBC PROGRESS driver]msgOpen: unable to open message file: PROMSGS ERROR [IM006] [MERANT][ODBC PROGRESS driver]Driver's SQLSetConnectAttr failed. ERROR [HYC00] [MERANT][ODBC PROGRESS driver]Optional feature not implemented. ERROR [HY000] [MERANT][ODBC PROGRESS driver]msgOpen: unable to open message file: PROMSGS ERROR [IM006] [MERANT][ODBC PROGRESS driver]Driver's SQLSetConnectAttr failed. at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcCon... The package execution fa... The step failed.
I created a .bat file with this instruction and It's run well:
dtexec /f "C:Program FilesMicrosoft SQL Server90DTSPackagesIntegration Services Project estcom.dtsx"
pause
Why it's not running with SQL Server Agent???
View 7 Replies
View Related
May 8, 2008
We are trying to install the Standard Edition of SQL Server 2005. We already have SQL Express installed. Standard won't install and Express won't uninstall.
We have tried every suggestion we can find and some we made up. When we try to install Standard, we get to the bit where you choose what you want to install and the only thing available is workstation components.
There are so many cases of this on the Internat that I can't believe MS have not solved the issue. And I am stunned that they want to charge us more money to talk to us about how to fix something we just paid them an arm and a leg for!
What do I need to tell you to get some idea of where to go next with this?
View 11 Replies
View Related
May 21, 2001
Hi,
I have suddenly run into a problem. I have a DTS which was running well till few days ago. Now when ever it runs, it crashes the server, any body
have any idea why???
Thanks in Adv.
Nirmal
View 2 Replies
View Related
Feb 25, 2004
Hi all,
Sql server 7
I have created a Web assistant job which select
and displays data from a table (very small amt of data)
on to the webpage. the job is schedule to run
every 1 minute. the job is not running, in job view
history its gives the error msg
"could not open the output file" 16821 Error no.
pls suggest
Awaiting for ur reply
TIA
Adil
View 1 Replies
View Related
Mar 17, 2004
I have a DTS job that runs every hour.
it truncates destination table and copies from the source table.
it has failed with the following error in view job history
"error-214721900(80040E14);provider error 14262.(37B6)"
error source Microsoft ole db provider error
pls help in this
how can i solve this, i tried restarting the job but its failing again.
View 3 Replies
View Related
Apr 15, 2004
Good Morning,
I've been running into a small problem. There are two people that usually create local packages to be executed by the DTS. Either my boss or I. The problem that I have been running into is, there are some local packages that will not execute when I try to run them. These packages are that my boss has created. When she runs them they work fine. But when I run them they just don't run. The only way I can run the local package is if I log in into the server and run it from there.
The error that I keep getting is:
Unspecified Error
[Microsoft][ODBC Driver Manager] Data Source Name not found and no default driver specified.
What would I be able to do so that I can execute this local package from my computer?
View 7 Replies
View Related
Apr 24, 2007
Hey guys,
I'm trying to run a job that will convert a load of data but it keeps failing at the first step. If I run the scripts in each step on their own then they run fine. The error message I get is 'The process did not produce any output. Process exit code 1. The step failed'. I think this may be some kind of security problem but I cannot see where. The command I'm using for the first step is as follows:
OSQL -SCRLONSQL01 -DINPRO -Usysadm -Pcarpmaels -i"C:Program FilesCPA Inpro DatabaseScriptsdropinteg.sql" -o"C:conversionoutputdropinteg.txt" -n
Any pointers would be most helpful.
View 11 Replies
View Related
Nov 6, 2007
Hi,
I am trying to create a job to run a ssis package.
The job fails. Looking at the history log, there is no proper information on why the job failed. It just says: The job failed. The job was invoked by user ...
please note that the ssis package runs fine on it's own i.e. in the designer by pressing the run button.
Thanks
View 3 Replies
View Related
Jul 10, 2007
I have a package which works fine when i ru if from VS but when i schedule it iam getting an error on one of the data reader source. I am not able to figure it why its giving error when its working fine from VStudio
Message
Executed as user: NAdbasvc-alticor. ... 9.00.3042.00 for 32-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 11:28:25 AM Error: 2007-07-10 11:28:26.21 Code: 0xC020838F Source: Staging LKPDataReader Source [1] Description: An error occurred executing the provided SQL command. End Error Error: 2007-07-10 11:28:26.21 Code: 0xC004706B Source: Staging DTS.Pipeline Description: "component "LKPDataReader Source" (1)" failed validation and returned validation status "VS_ISBROKEN". End Error Error: 2007-07-10 11:28:26.21 Code: 0xC004700C Source: Staging DTS.Pipeline Description: One or more component failed validation. End Error Error: 2007-07-10 11:28:26.21 Code: 0xC0024107 Source: Staging Description: There were errors during task validation. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 11:28:25 AM Finished: 11:28:26 AM Elapsed: 0.906 seconds. The package execution fai... The step failed.
has anyone come across same issue, help
View 5 Replies
View Related
Apr 13, 2004
Hello,
I'm trying to get a handel on ASP.NET and I've put together a new SQL connection to display a view inside of a datagrid.
When I go to run it (before or after compile) I get the error:
------------------------------------------------------------------------------------------------------
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection
Line 57: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Line 58: Dim ds As New DataSet
Line 59: SqlDataAdapter1.Fill(ds)
Line 60:
Line 61: DataGrid1.DataSource = ds
Stack Trace:
[SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
jtio8.WebForm1.Page_Load(Object sender, EventArgs e) in c:inetpubwwwrootjtio8WebForm1.aspx.vb:59
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
--------------------------------------------------------------------------------
Here is the connection string I am using:
Me.SqlConnection1.ConnectionString = "workstation id=MyWorkstation;packet size=4096;integrated security=SSPI;data source=MyServer;" & _
"persist security info=False;initial catalog=Northwind"
-------------------------------------------------------------------------------
Now, I've created a new login to the SQL server using the ASPNET user id (as well as several others for testing), set up the premissions for each UID and I'm still getting this error.
I have also tried to setup the user info in the connection string by doing the following:
Me.SqlConnection1.ConnectionString = "user id=aspnet;password=;workstation id=MyWorkstation;packet size=4096;integrated security=SSPI;data source=MyServer;" & _
"persist security info=False;initial catalog=Northwind"
Any ideas?
Thanks,
Dale
View 2 Replies
View Related
Jan 11, 2005
Hi all;
I am getting the following error when I try to connect to my local SQL server from my ASP.NET application
Server Error in '/pelin' Application.
Cannot open database requested in login 'pelin'. Login fails. Login failed for user 'sa'.
for other users also
my connection string is in web.config file:
<appSettings>
<add key="constr" value="server=ARGE057VSDOTNET2003;UID=sa;pwd=sa;database=Test;"></add>
</appSettings>
can you help me please thanks..
View 1 Replies
View Related
Jan 27, 2006
Hello,I'm trying to create a new SQL Express database in VWD, and I get the error: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.What is this error all about? I don't understand it.Thanks.
View 1 Replies
View Related
Feb 1, 2006
I have this line of db connection code that works in vb.net but not in c#:
con = new ADODB.ConnectionClass(); //for vb.net I used ADODB.Connection() instead and it workscon.Open("Provider=SQLOLEDB;" + ConfigurationSettings.AppSettings["connectionString"]);
Error message:CS1501: No overload for method 'Open' takes '1' arguments
Searched the web but can't find the answer... Does anyone have a clue?
View 2 Replies
View Related
Jun 25, 2002
This is a proc that was working on production 7.0 server but is being tested on a 2000, what's changed?
TIA
JeffP....
View 2 Replies
View Related
Apr 23, 2001
I trying to FTP Files about 37 files each 3 GB. The FTP is just stuck. It fails half way through. I use IIS 4.0 in Clustered Network and MSSQL 7.0. IIS 4.0 does not support transfer of files more than 4 GB.Is there any other tools that I can use to FTP the dump files. Does anyone have any ideas.
View 1 Replies
View Related
Sep 17, 2001
SQL SERVER 7.0
==============
Hi All!
I have a job that has 2 steps.In the first step iam using a group by clause.The column on which I use group by, sometimes has null values.During such case the job is failing at the first step throwing a warning.
Warning: Null value eliminated from aggregate. [SQLSTATE 01003]
1)If i want to override this, is it appropriate to use set ansi_warnings off for my session?
2)If there is some other error will that be detected or will that be overridden too?
Any help appreciated!
TIA
Regards,
kinnu
View 1 Replies
View Related
Jun 7, 2000
I have a script that is generated from main frame.
This script updates about 113,000 rows.
I keep getting an error message 225, 16.
From Books on line
225 "Refrenced object (name %*.s) dropped during query optimization"
16 Too many table names in the query. The maximum allowed is %d. knowing that it updates only one table this message does not make sense.
It is on sql server 6.5.
Any help will be very much appreciated.
Thanks in advance
Al
View 1 Replies
View Related
Oct 23, 2000
When I schedule a DTS export job,I am getting this error. But if I run it with 'run immediately' option while creating the job,it runs fine! Any clue??
Thanks.
''DTSRun: Loading... DTSRun: Executing... DTSRun OnStart: Transfer SQL Server Objects DTSRun OnError: Transfer SQL Server Objects, Error = -2147221504 (80040000) Error string: Error source: Help file: Help context: 0 Error Detail Records: DTSRun OnFinish: Transfer SQL Server Objects DTSRun: Package execution complete. Process Exit Code 1. The step failed.''
View 2 Replies
View Related
Oct 18, 2000
when I create a DTS export job,it is running o.k when I select 'run immediately' option.But the same job is not running as a job.Any idea???
Thanks for any help.
View 1 Replies
View Related
Feb 24, 2000
Hi ,
While running the load cmd - 'Load database dbname1 from disk='c:empdump1.dat'
through ISQL I am getting the following error
1 transaction rolledback dbid error 7.But when I tried restoring using enterprice manager UI it is working fine.Any body knows why it is happening like this .
Thanks in advance
Jiji
View 1 Replies
View Related
Sep 2, 1999
I set up a DTS package to run every night on my SQL 7 Server.
It is supposed to write a text file of modified rows every night.
It was working fine until I changed the password for sa, now it
fails. Also in Enterprise Manager, when I try to look a the package
properties, I get a "login failed for user sa" package error.
What to do?
View 1 Replies
View Related
Mar 2, 2001
I have stored procedure that uses the xp_cmdshell procedure to use the dts run to run some dts packages. This package exports data into an Access 97 database. When I run it I get this error:
Error: -2147467259 (80004005); Provider Error: -533791822 (E02EFBB2)
Error string: Could not update; currently locked by user '(unknown)' on machine ''.
Error source: Microsoft JET Database Engine
Help file:
Help context: 5003218
If I right click on the local package and select execute it runs with no problem. Any ideas what is going on?
View 2 Replies
View Related
Nov 8, 2002
I have a DTS package set up to push data out to several sites. When I execute the package it runs perfectly. When I schedule it as a job it fails.
I checked the proxy account in the SQLAGent properties and there is a check mark there. But the job still fails.
Does anyone have any ideas?
View 8 Replies
View Related
Nov 30, 2005
Ok I had a server crash the master was bad or corrupted. I tried to rebuild the master but that failed. I had to reinstall sql and then attach the databases.
I need to know why the master all of a sudden just stopped working. Any ideas where to look or what would cause this?
Thanks.
:eek:
View 9 Replies
View Related
Jul 29, 1998
Sorry about that first post I hit the wrong button.
I have a BIG problem. One day about a week ago I came into my office and everything was working fine, except for the fact that the drive of the NT server was a little fragmented. This machine is a dedicated server and since everything was relatively ok I turned the monitor back off and left the machine alone, after starting Diskkeeper to take care of the fragmentation. Later I go to check on the machine and the following message had appeared on the screen, NT system corrupt service can not continue with an OK button. So I sighed an pressed the ok button already to figure out what service needed to be restarted, unfortunately my best laid plans were soon destroyed when again the message popped up till I had shut down every program and had to reboot.... That is when the real fun started, it never rebooted, I had shut it down properly. So now I had a central server, that had never been backed up before that needed windows NT reinstalled. So I started reinstalling NT. I recently came in to this position and the people before me had not made and backup what so ever. So I had no Emergency Disk, and the systems files, i.e. User database, stuff that would normally be on a Emergency Disk were somehow corrupt and I could no recover them. Well after getting NT up, I worked on restoring the functions of the server, file sharing and web hosting. I still have a lot of programs to reinstall as the reinstall of NT left the actual program files alone, but has rendered them unusable. Now that I`m done with the background, I have now made a copy of what was left on the drive, so I could restore the data files. When I go to reinstall SQL 6.5, it will not let me use the upgrade part. So I try to do a complete install, I`m getting desperate here! Well it starts the install no problem asks me for info and I tell it. I have tried this with a new directory and the old one with the files intact. Well as the install goes along it allows the copying of the files, and then goes to a screen where it has the little hour glass thing in the SQL window setting up the server. A few minutes later it changes the title on the screen to read Microsoft SQL Server 6.5 Setup and brings up a window with the error The SQL Server installation could not be successfully completed Setup was not able to connect to the SQL server the only button is Exit to windows NT. I`m out of ideas. HELP me please.
View 3 Replies
View Related