Private Sub openDB() Dim CN As ADODB.Connection Dim RS As ADODB.Recordset Set CN = New ADODB.Connection CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\Documents and Settings\UserName\My Documents\data.xls;" & _ "Extended Properties='Excel 8.0;HDR=YES'" Set RS = CN.Execute("select * from [シート名$] where 銘柄名 like '%日本%';") Do Until RS.EOF Debug.Print RS.Fields(0); RS.Fields(1); RS.Fields(2) RS.MoveNext Loop End Sub
0 件のコメント:
コメントを投稿