473,406 Members | 2,369 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,406 software developers and data experts.

SQLDMO

I'm playing with the SQLDMO Interop to try to create an SQL database on a
server (sql 2000/2005) without as little user interaction as possible.
Logon, password and server name is about all I need.

Which I have got to work just fine and dandy - so long as the client running
it has SQL client or server installed.

How do I determine if SQLDMO is even available before I try to make any
calls to SQLDMO functions? Do I just search for a file or registry entry?
Any other suggestions?

W
Jul 3 '06 #1
7 2384
Hello warlord,

Check for the existed sqldmo.dll ?!

wI'm playing with the SQLDMO Interop to try to create an SQL database
won a server (sql 2000/2005) without as little user interaction as
wpossible. Logon, password and server name is about all I need.
w>
wWhich I have got to work just fine and dandy - so long as the client
wrunning it has SQL client or server installed.
w>
wHow do I determine if SQLDMO is even available before I try to make
wany calls to SQLDMO functions? Do I just search for a file or
wregistry entry? Any other suggestions?
w>
wW
w>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jul 3 '06 #2
That's kinda what I figured - just wondered if there was a more elegant way.

"Michael Nemtsev" <ne*****@msn.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Hello warlord,

Check for the existed sqldmo.dll ?!

wI'm playing with the SQLDMO Interop to try to create an SQL database
won a server (sql 2000/2005) without as little user interaction as
wpossible. Logon, password and server name is about all I need.
wwWhich I have got to work just fine and dandy - so long as the client
wrunning it has SQL client or server installed.
wwHow do I determine if SQLDMO is even available before I try to make
wany calls to SQLDMO functions? Do I just search for a file or
wregistry entry? Any other suggestions?
wwW
w---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche


Jul 3 '06 #3
This isn't the way to do it, since you can have the DLL on the machine,
and it might not be registered correctly.

Moreover, you can't determine where it is installed, or if that dll is
the one that is registered on the system.

To the OP, I assume that you are distributing your interop assembly with
your app. What I would do is try and create an instance of the class, and
wrap it in a try/catch statement, catching the exception that is thrown when
a COM class instance can not be created.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Michael Nemtsev" <ne*****@msn.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Hello warlord,

Check for the existed sqldmo.dll ?!

wI'm playing with the SQLDMO Interop to try to create an SQL database
won a server (sql 2000/2005) without as little user interaction as
wpossible. Logon, password and server name is about all I need.
wwWhich I have got to work just fine and dandy - so long as the client
wrunning it has SQL client or server installed.
wwHow do I determine if SQLDMO is even available before I try to make
wany calls to SQLDMO functions? Do I just search for a file or
wregistry entry? Any other suggestions?
wwW
w---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche


Jul 3 '06 #4
warlord wrote:
I'm playing with the SQLDMO Interop to try to create an SQL database on a
server (sql 2000/2005) without as little user interaction as possible.
Logon, password and server name is about all I need.

Which I have got to work just fine and dandy - so long as the client running
it has SQL client or server installed.

How do I determine if SQLDMO is even available before I try to make any
calls to SQLDMO functions? Do I just search for a file or registry entry?
Any other suggestions?

W

Why not just use the CREATE DATABASE DbName statement instead?

Just curious.

JB
Jul 4 '06 #5
Hello Nicholas Paldino [.NET/C# MVP],

NThis isn't the way to do it, since you can have the DLL on the
Nmachine, and it might not be registered correctly.
N>
NMoreover, you can't determine where it is installed, or if that
Ndll is the one that is registered on the system.
N>
NTo the OP, I assume that you are distributing your interop
Nassembly with your app. What I would do is try and create an
Ninstance of the class, and wrap it in a try/catch statement, catching
Nthe exception that is thrown when a COM class instance can not be
Ncreated.

Yep, sure. I was more pointed to the "if SQLDMO is *even available*" phrase,
but exactly try/catch is always only the good way to check that smth exists

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jul 4 '06 #6

"John B" <jb******@yahoo.comwrote in message
news:44**********@news.iprimus.com.au...
warlord wrote:
>I'm playing with the SQLDMO Interop to try to create an SQL database on a
server (sql 2000/2005) without as little user interaction as possible.
Logon, password and server name is about all I need.

Which I have got to work just fine and dandy - so long as the client
running it has SQL client or server installed.

How do I determine if SQLDMO is even available before I try to make any
calls to SQLDMO functions? Do I just search for a file or registry
entry? Any other suggestions?

W
Why not just use the CREATE DATABASE DbName statement instead?

Just curious.

JB
I could do that but when you get into passing scripts to the server I find
you're not as in control of the process. You get into the whole success or
failure thing having to validate it got created not just that the script ran
successfully.

W
Jul 4 '06 #7

"Michael Nemtsev" <ne*****@msn.comwrote in message
news:17***************************@msnews.microsof t.com...
Hello Nicholas Paldino [.NET/C# MVP],

NThis isn't the way to do it, since you can have the DLL on the
Nmachine, and it might not be registered correctly.
NNMoreover, you can't determine where it is installed, or if that
Ndll is the one that is registered on the system.
NNTo the OP, I assume that you are distributing your interop
Nassembly with your app. What I would do is try and create an
Ninstance of the class, and wrap it in a try/catch statement, catching
Nthe exception that is thrown when a COM class instance can not be
Ncreated.

Yep, sure. I was more pointed to the "if SQLDMO is *even available*"
phrase, but exactly try/catch is always only the good way to check that
smth exists
I figured I'd try the try/catch to pick up on that but instead my little
test app didn't do anything but hang... I still got a few things to test in
it but if try/catch is the more elegant option I'll use it.

W
Jul 4 '06 #8

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

Similar topics

2
by: ewm | last post by:
Using InstallShield Developer 7.04. Does anyone know of a good way to detect if SQLDMO is installed? TIA mcpoo
1
by: Mohammed Abdel-Razzak | last post by:
Dear sirs I`ve used SQLDMO to make a backup to my database How can I use it to restore database? thanks Mohammed
3
by: T. | last post by:
I dumped VB and adopted C# for this version of Visual Studio. My problem! I am trying to reference an SQLDMO.Database object in C# like so: private SQLDMO.Database dbcurrent; private string...
1
by: C# beginner | last post by:
Hi all, I am using SQLDMO.Backup for backing up SQL server databases. I need to implement a progress bar to show the progress. I have some sample VB code that is like this: Dim WithEvents...
1
by: | last post by:
Hi all My requirement is to "on button_click, backup a SQL database using SQLDMO.Backup object and update the progress in a ProgressBar. The problem is the progress bar does not update at all...
2
by: | last post by:
Hi all, continued from yesterday's posting... I still haven't found a solution to this issue. I put a breakpoint in private void SqlBackupPercentComplete(string message, int Percent) {...
1
by: | last post by:
Hi all I am posting this to check if anyone could help me. The problem still persists. I am beginner in C#. Thanks. Subject: SQLDMO.Backup and ProgressBar - help please From: ...
0
by: Craig G | last post by:
i have a small application that uses the SQLDMO com object when i build a setup package to distribute it adds both the Interop.SQLDMO.dll assembly & sqldmo.dll File the problem is that the...
6
by: Craig G | last post by:
how the hell do i get this to register?!?!? my test pc is running XP & MDAC 2.8 but still it wont register SQLDMO.dll and is therefore preventing my application from running and i dont want...
3
by: Brian Henry | last post by:
Anyone know why this would happen... I added a reference to the SQLDMO COM object, imported it on top of my code.. then this test code fails Imports SQLDMO Module Module1 Sub Main() Dim...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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.