VBScript将CSV读入数组变量

时间:2019-04-03 14:14:57

标签: oracle vbscript adodb

我编写了一个简单的VBScript,使用Oracle Provider for OLE DB通过硬编码变量({{1},strUsernamestrPassword)来查询Oracle数据库:

strDataSource

但是我正尝试从CSV文件中获取变量(On Error Resume Next Dim strSQL, strDataSource, strUsername, strPassword, CountFields Set dbData = CreateObject("ADODB.Recordset") Set dbConnection = CreateObject("ADODB.Connection") strDataSource = "MyDB" strUsername = "MyUserName" strPassword = "MyPassword" dbConnection.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=" & strDataSource & ";User ID=" & strUsername & ";Password=" & strPassword & ";" dbConnection.Open strSQL = "SELECT 1 FROM DUAL" dbData.Open strSQL, dbConnection strUsernamestrPassword)的值:

DataSource,Username,Password
TestDB,Erik,Aa123456
TestDB2,Jeff,Bb123456
TestDB3,Jane,Cc123456

到一个数组,但是没有运气。

0 个答案:

没有答案