Dim conn As ADODB.Connection
Set Conn_Data = New ADODB.Connection
Conn_Data.ConnectionString = "Driver={Microsoft ODBC for Oracle};" &"UID=user_name;PWD=user_passsword"
Conn_Data.Open
Dim rs_Data As ADODB.Recordset
Set rs_Data = New ADODB.Recordset
rs_Data.Open "TableName", Conn_Data, adOpenDynamic, adLockOptimistic, adCmdTable
Do While Not rs_Data.EOF
txt = ""
For Each fld In rs_Data.Fields
txt = txt & Trim$(fld.Value) & ", "
Next fld
If Len(txt) > 0 Then txt = Left$(txt, Len(txt) - 2)
List1.AddItem txt
rs_Data.MoveNext
Loop
rs_Data.Close
Conn_Data.Close
No comments:
Post a Comment