Solved

SQLDMO getting server and database names

Posted on 2004-08-16
2
387 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

760 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

23 Experts available now in Live!

Get 1:1 Help Now