ActiveX: 'ADODB.Connection' |
Option Explicit ' . ( , ) Access Dim DBFile : DBFile = ChooseFile("C:\Documents and Settings\Futen\ \samo-agent\Ag.7.1.mdb") Dim Catalog, objConn, SQuery Set objConn = CreateObject("ADODB.Connection") objConn.ConnectionString = ConnectString objConn.Open Dim RecordsAffected objConn.Execute "select * from [version]" ' objConn.Close Set objConn = Nothing ' MsgBox " ", vbInformation + vbOKOnly ' Function ChooseFile(StartName) Dim Str : Str = InputBox(" ", " ", StartName) If Len(Str) = 0 Then Wscript.Quit End If ChooseFile = Str End Function Function ConnectString() ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & DBFile & ";" End Function
http://www.sql.ru/forum/1094346/nevozmozhno-sozdanie-obekta-konteynerom-activex-adodb-connection