Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SQLDMO getting server and database names

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

828 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