Solved

SQLDMO getting server and database names

Posted on 2004-08-16
2
388 Views
Last Modified: 2008-01-09
I need to make list boxes with the server and database names similar to what happens when you open query analyzer etc.  I found some code that would help me do this but the problem is that when I compile I get this error:

error LNK2001: unresolved external symbol _CLSID_SQLDMOApplication
error LNK2001: unresolved external symbol _CLSID_SQLDMOServer
error LNK2001: unresolved external symbol _IID_IWSQLDMOApplication
error LNK2001: unresolved external symbol _IID_IWSQLDMOServer
fatal error LNK1120: 4 unresolved externals

I tried going into the references for my project and adding SQLDMO but it didn't help.  I have included these files:
#include "C:\PROGRAM FILES\MICROSOFT SQL SERVER\80\TOOLS\DEVTOOLS\INCLUDE\sqldmoid.h"
#include "C:\PROGRAM FILES\MICROSOFT SQL SERVER\80\TOOLS\DEVTOOLS\INCLUDE\sqldmo.h"


I had to copy them off the cd though as I could not find them on my machine...  I have sqldmo.dll on my machine though - I guess I assumed that the stuff it would need to link to was in there?


0
Comment
Question by:bluedaisydawg
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 100 total points
ID: 11813640
You should use

#define INITGUID

before including

#include <initguid.h>
0
 
LVL 1

Author Comment

by:bluedaisydawg
ID: 11814541
that did it  - thanks!

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now