How to Create a VBScript ODBC Connection?

A VBScript ODBC connection is created by using the CreateObject function and specifying a connection string for the statement on your previous example. The ODBC Server should be installed on your machine before you can use this method.

vbscript connect mssql

By Muddy MantisMuddy Mantis on Nov 04, 2020
Const adLockBatchOptimistic = 4
Const adUseClient = 3 

Set iconnTrans = CreateObject("ADODB.Connection")

iconnTrans.open _
	"Provider=SQLOLEDB.1;Data Source = localhost\sqlexpress;Integrated Security = SSPI;Initial Catalog=dw2"

Set rsTrans = CreateObject("ADODB.Recordset")

rsTrans.CursorLocation = adUseClient
rsTrans.LockType = adLockBatchOptimistic
rsTrans.open "SELECT * FROM ir_Transactions", iconnTrans

Source: www.vbforums.com

Add Comment

0

ODBC, or Open Database Connectivity is a way of bringing scripted or non-scripted objects like databases or forms into an application using the Microsoft Access ODBC Driver.

SQL answers related to "vbscript connect mssql"

View All SQL queries

SQL queries related to "vbscript connect mssql"

Browse Other Code Languages

CodeProZone