Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Connect to a SQL Server DatabaseContent of Connect to a SQL Server Database.vbsMD5 Hash: 26F480958ACD239072D9A6AEB277AB4F |
||
' Description: Demonstration script that connects to a SQL Server database named Northwind on a computer named atl-sql-01.
Const adOpenStatic = 3 Const adLockOptimistic = 3 Set objConnection = CreateObject("ADODB.Connection") Set objRecordSet = CreateObject("ADODB.Recordset") objConnection.Open _ "Provider=SQLOLEDB;Data Source=atl-sql-01;" & _ "Trusted_Connection=Yes;Initial Catalog=Northwind;" & _ "User ID=fabrikam\kenmyer;Password=34DE6t4G!;" objRecordSet.Open "SELECT * FROM Customers", _ objConnection, adOpenStatic, adLockOptimistic objRecordSet.MoveFirst Wscript.Echo objRecordSet.RecordCount | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |