/build/static/layout/Breadcrumb_cap_w.png

Microsoft SQL ODBC Problem.

Sorry for duplicated post (http://www.appdeploy.com/messageboards/fb.asp?m=1744), but I find out I would rather make it through vbscript... I need to create connection to sql server - I need to pass some informations like Name, SQL Server name etc., but I dont know where and how should I begin :( Have anyone make script for something like this before? Looking forward for your answers...

0 Comments   [ + ] Show comments

Answers (1)

Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
Set objODBC = CreateObject("ADODB.Connection")
objODBC.Open "PROVIDER=SQLOLEDB;SERVER=ServerName;UID=username;PWD=password;DATABASE=DatabaseName"

mySQL = "SELECT * FROM tablename Where criteria"

Set objRS = objODBC.Execute(mySQL)

While Not objRS.EOF
msgbox objRS("ColumnName")
objRS.MoveNext
WEnd

wscript.echo "Completed"
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ