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)
Please log in to answer
Posted by:
brenthunter2005
20 years ago
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"
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"
![](/build/static/general/appdeploy_logo.png)
so that the conversation will remain readable.