20131229

連Oracle資料庫

the error message "Class not defined ADODB"
Set Obj_DBConn = New ADODB.Connection
Set cat = New ADOX.Catalog



Obj_DBConn.ConnectionString ="Driver={Microsoft ODBC for Oracle}; " & _
                             "CONNECTSTRING=(DESCRIPTION=" & _
                             "(ADDRESS=(PROTOCOL=TCP)" & _
                             "(HOST=##test##)(PORT=##test##))" & _
                             "(CONNECT_DATA=(SERVICE_NAME=##test##))); " & _
                             "uid=test;pwd=test;"


Obj_DBConn.Open Database_Path


Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")




Set f = Nothing

Set f = fso.OpenTextFile("C:\Documents and Settings\test.txt", ForReading, True)

For i = 1 To 10000

v_Line_String = f.ReadLine


v_Output_Each_part = Split(v_Line_String,";",-1,1)

v_Col_A = v_Output_Each_part(0)
v_Col_B = v_Output_Each_part(1)
v_Col_C = v_Output_Each_part(2)



Obj_DBConn.Execute "INSERT INTO  test_me (ID_Q, NAME, ROLLNO) VALUES ('"       & v_Output_Each_part(0) & "','" & v_Output_Each_part(1) & "','" & v_Output_Each_part(2) & "')"



Next

沒有留言:

張貼留言