473,320 Members | 1,965 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,320 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 2367
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.