473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Running a DLL in the Query Analyzer

Jim

Hi,

I have a DLL that I want to run from the Query Analyzer. I tried the
following:

USE master;
EXEC sp_addextendedproc BLAH, '\\Other-Server\Path\To\Blah\Blah.dll'

and I get the error:

ODBC: Msg 0, Level 16, State 1
Cannot load the DLL \\Other-Server\Path\To\Blah\Blah.dll, or one of
the DLLs it references. Reason: 126(The specified module could not be
found.).

The DLL was written in Cobol. The "Other-Server" in the Path above is
the server that Cobol (and the DLL) is located on.

I looked at the dependencies for the DLL and it includes (not
surprisingly) Cobol Dll's. It should find those on the other server.

What can I do?

Thanks!


Nov 23 '07 #1
5 1934

One other thing....

The DLL can be called from Visual Basic. That was installed some time
ago and works great.
On Nov 23, 9:15 am, Jim <jsh...@datamann.comwrote:
Hi,

I have a DLL that I want to run from the Query Analyzer. I tried the
following:

USE master;
EXEC sp_addextendedproc BLAH, '\\Other-Server\Path\To\Blah\Blah.dll'

and I get the error:

ODBC: Msg 0, Level 16, State 1
Cannot load the DLL \\Other-Server\Path\To\Blah\Blah.dll, or one of
the DLLs it references. Reason: 126(The specified module could not be
found.).

The DLL was written in Cobol. The "Other-Server" in the Path above is
the server that Cobol (and the DLL) is located on.

I looked at the dependencies for the DLL and it includes (not
surprisingly) Cobol Dll's. It should find those on the other server.

What can I do?

Thanks!
Nov 23 '07 #2
The DLL was written in Cobol. The "Other-Server" in the Path above is
the server that Cobol (and the DLL) is located on.
Not just any DLL can run as a SQL Server extended stored procedure.
Extended stored procedures are usually written in C/C++, although I've heard
that some have been written using Delphi. See Creating Extended Stored
Procedures in the Books Online for details.

Separately, COM DLLs can be invoked using sp_OA* procs.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Jim" <js****@datamann.comwrote in message
news:8d**********************************@g21g2000 hsh.googlegroups.com...
>
Hi,

I have a DLL that I want to run from the Query Analyzer. I tried the
following:

USE master;
EXEC sp_addextendedproc BLAH, '\\Other-Server\Path\To\Blah\Blah.dll'

and I get the error:

ODBC: Msg 0, Level 16, State 1
Cannot load the DLL \\Other-Server\Path\To\Blah\Blah.dll, or one of
the DLLs it references. Reason: 126(The specified module could not be
found.).

The DLL was written in Cobol. The "Other-Server" in the Path above is
the server that Cobol (and the DLL) is located on.

I looked at the dependencies for the DLL and it includes (not
surprisingly) Cobol Dll's. It should find those on the other server.

What can I do?

Thanks!

Nov 24 '07 #3

Since I can call it from a VB program, do you know if I can create a
new DLL using the VB program and use that to access the needed DLL?
If not... If I can call my needed DLL from a C/C++ program, can I
create a new DLL that I could call to get at my needed DLL?

The DLL that I need to call, was bought from a different company, so I
don't have access to the code.

Thanks alot!

Jim
On Nov 24, 9:52 am, "Dan Guzman" <guzma...@nospam-
online.sbcglobal.netwrote:
The DLL was written in Cobol. The "Other-Server" in the Path above is
the server that Cobol (and the DLL) is located on.

Not just any DLL can run as a SQL Server extended stored procedure.
Extended stored procedures are usually written in C/C++, although I've heard
that some have been written using Delphi. See Creating Extended Stored
Procedures in the Books Online for details.

Separately, COM DLLs can be invoked using sp_OA* procs.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Jim" <jsh...@datamann.comwrote in message

news:8d**********************************@g21g2000 hsh.googlegroups.com...


Hi,
I have a DLL that I want to run from the Query Analyzer. I tried the
following:
USE master;
EXEC sp_addextendedproc BLAH, '\\Other-Server\Path\To\Blah\Blah.dll'
and I get the error:
ODBC: Msg 0, Level 16, State 1
Cannot load the DLL \\Other-Server\Path\To\Blah\Blah.dll, or one of
the DLLs it references. Reason: 126(The specified module could not be
found.).
The DLL was written in Cobol. The "Other-Server" in the Path above is
the server that Cobol (and the DLL) is located on.
I looked at the dependencies for the DLL and it includes (not
surprisingly) Cobol Dll's. It should find those on the other server.
What can I do?
Thanks!- Hide quoted text -

- Show quoted text -
Nov 26 '07 #4
(ji******@gmail.com) writes:
Since I can call it from a VB program, do you know if I can create a
new DLL using the VB program and use that to access the needed DLL?
If not... If I can call my needed DLL from a C/C++ program, can I
create a new DLL that I could call to get at my needed DLL?

The DLL that I need to call, was bought from a different company, so I
don't have access to the code.
Yes, you could write one or more extended stored procedures to access
the DLL. Or implement COM methods.

On SQL 2005, you could to a COM-interop and call it from CLR.

Whatever, it's a bit of work, and and if you have errors in your
code that causes access violation, you could crash SQL Server.

To get information about writing extended stored procedures, please
see in Books Online for details. If you have never done it before,
expect at least 50 hours of development.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Nov 26 '07 #5

Thanks for the pointers!

Jim

On Nov 26, 5:35 pm, Erland Sommarskog <esq...@sommarskog.sewrote:
(jimsh...@gmail.com) writes:
Since I can call it from a VB program, do you know if I can create a
new DLL using the VB program and use that to access the needed DLL?
If not... If I can call my needed DLL from a C/C++ program, can I
create a new DLL that I could call to get at my needed DLL?
The DLL that I need to call, was bought from a different company, so I
don't have access to the code.

Yes, you could write one or more extended stored procedures to access
the DLL. Or implement COM methods.

On SQL 2005, you could to a COM-interop and call it from CLR.

Whatever, it's a bit of work, and and if you have errors in your
code that causes access violation, you could crash SQL Server.

To get information about writing extended stored procedures, please
see in Books Online for details. If you have never done it before,
expect at least 50 hours of development.

--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Nov 27 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: kackson | last post by:
Hi. I've been using SQL server 2000's query analyzer and the enterprise manager without problems for quite some time (2 months). And all of a sudden one week ago, when I started the query analyzer...
2
by: Poster | last post by:
After creating an IN clause from a bunch of character strings created by a Word macro, Query Analyzer complains about a syntax error. The macro takes a column full of character strings and wraps...
1
by: Not4u | last post by:
Hello I have a SQL 2000 server, the server setting is default language : French and all Collation names in French If i launch the 'Query Analyzer' from the SQL Entreprise Manager on my...
3
by: JM | last post by:
Good day. I was able to connect to a database server using SQL Server Enterprise Manager. The Server name specified on the tree is JOMARGON(Windows NT). But no server was detected using either...
3
by: Matt | last post by:
If I open Enterprise Manager through a saved MSC file, the Tools > SQL Query Analyzer option is greyed out (unavailable). If I open Enterprise Manager from the Programs menu, Query Analyzer is...
4
by: laurenq uantrell | last post by:
I am trying to determine which of three stored procedure designs are fastest in the Query Analyzer: One query is a straight SELECT query with all desired rows and a dozen (tblName.RowName =...
1
by: justinjoylife | last post by:
Hi - I'm completely new to Microsoft Query Analyzer and I need to learn it for work to do data mining as a Product Manager. Does anyone have any recommendations on how to learn this and where?...
6
by: johntarr | last post by:
I hope I am not asking about something that has been done before, but I have searched and cannot find an answer. What I am trying to do is to run a query, and then perform some logic on the...
1
by: chudson007 | last post by:
Hi All, What are the pros and cons between using Enterprise Manager or Query Analyzer for my queries. Currently I use Enterprise Manager because I prefer the interface and only use Query...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.