Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQLDMO vbscript question

Status
Not open for further replies.

limester

Technical User
Dec 29, 2004
69
CA
Hi,

I have a vbscript that uses SQLDMO and an input file to perform a query on the sql database and return the results to a msgbox.

To create the connection I use:

Set objServer = ("SQLDMO.SQLServer2")

and login with the current user account:

objServer.LoginSecure = True
objServer.Connect "(local)"

the script works great when run on the server that houses the MSSQL server.

However, I would like to be able to run this from a workstation on the same network.

Is there a way to modify the script to allow this?

Thanks in advance!
 
You can use '(local)' to connect to a database when you are running the script on the server. If the database is NOT on the same computer as the vbscript, then you need to use the computer name instead.


-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Thanks! that worked!

But now I am having a problem with winxp pro clients not having the required sqldmo.dll and sqldmo.rll by default.

If I install the Backwards Compatibility msi package the proper files are loaded. But this turns my small script into something really bulky.

is there another method i can use in my script to connect to the database using vbs?

Thanks!
 
Uh... no.

If you want to use SQLDMO, then it must be installed.

Of course, you should also realize that anything you do using SQLDMO can be done with straight queries. If you can re-write your script without SQLDMO, then you can use the ADO object. If I'm not mistaken, most (if not all) recent windows operating systems include some version of ADO.



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top