cls設定シート
Option Explicit ' --------------------------------------------------------------------------------------------------------------------- ' 定数 ' --------------------------------------------------------------------------------------------------------------------- Const cnstシート名 = "設定" Const cnst設定項目 = "▼設定項目" ' ********************************************************************************************************************* ' 接続文字列の取得 ' ********************************************************************************************************************* ' Public Function getConnectionString() Dim obj設定値リスト As Variant Set obj設定値リスト = タイトル名指定でリスト値のRange情報を取得(cnst設定項目, ThisWorkbook.Sheets(cnstシート名)) Dim txt接続文字列 As String ' txt接続文字列 = "Provider=OraOLEDB.Oracle;" Dim i As Long Dim obj設定値 For Each obj設定値 In obj設定値リスト txt接続文字列 = txt接続文字列 & obj設定値 & "=" & obj設定値.Offset(0, 1) & ";" Next obj設定値 getConnectionString = txt接続文字列 End Function