p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   SQL Server 2000 (http://p2p.wrox.com/forumdisplay.php?f=20)
-   -   Generic ODBC Call Failed error (http://p2p.wrox.com/showthread.php?t=10318)

ethanw March 9th, 2004 08:53 PM

Generic ODBC Call Failed error
 
Hi,

I'm trying to import a number of fixed width text files in to a sql server database using a stored procedure, but I keep getting a generic message that says "ODBC Call Failed" without giving me any details. The other thing is that this import used to work. Until we restored our domain controller after it went down. Any ideas?

Thanks,

Ethan

defiant March 11th, 2004 06:29 AM

does the error appear inside the sp? if yes, on what line?

defiant.

ethanw March 11th, 2004 12:01 PM

I'm not sure. Is there a way to tell? The logs show that it seems to run ok until it gets to the stored procedure.

ethanw March 11th, 2004 03:25 PM

The line that seems to be giving me problems is:

EXEC @hr = sp_OACreate 'nti.CriminalData', @object OUT

joefawcett March 12th, 2004 03:56 AM

Seems a strange error message for that call. Is the progid correct and is the component installed on the server in question? Does the user connecting have rights to create the COM class?

--

Joe

ethanw March 12th, 2004 12:14 PM

The account has administrator privilages so that shouldn't be a problem, as far as the system goes. With in SQL Server itself I've given the account every permission I can find to give it, but I may have missed something. I'm pretty new to SQL server and I inherited this system so I sure I don't know the ins and outs. Is there a way to check the progid and component installation?

This the error it gives me on the query analyzer when it gets to that line if it helps:
Server: Msg 50000, Level 16, State 1, Procedure sp_ImportWADoc, Line 31
[Microsoft][ODBC SQL Server][SQL Server]NetScreen Error, Source: ODSOLE Extended Procedure Description: Invalid Class String

joefawcett March 12th, 2004 12:24 PM

If you have access to the server try this short script, save it to a file and double click. Then try the second version from your machine (if it's not the same one). This will simulate what the sp_OACreate does.
Code:

//Simple COM test, save as ProgIdTest.js on actual server and run from server
try
{
  var oObject = new ActiveXObject("nti.CriminalData");
}
catch(e)
{
  WScript.echo(e.message);
}
oObject = null;

Code:

//Simple COM test, save as ProgIdTest.js on your machine and run from there
try
{
  var oObject = new ActiveXObject("nti.CriminalData", "<server name goes here"); //Server name, not SQL server name. They maybe different
}
catch(e)
{
  WScript.echo(e.message);
}
oObject = null;

If you get 'Cannot create object' or the like the control is not registered on the server.

--

Joe

ethanw March 12th, 2004 01:05 PM

Thanks for the response I did get a message saying "Automation server can't create object". Do I need to use regsvr32.exe?

Thanks again,

Ethan

joefawcett March 12th, 2004 01:17 PM

Well it may not even be present on the machine but it's worth a try.

--

Joe

ethanw March 12th, 2004 01:55 PM

Ok, which file am I looking for?


All times are GMT -4. The time now is 08:44 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.