View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
AA2e72E AA2e72E is offline
external usenet poster
 
Posts: 400
Default Need ADO Recordset Help

In this scenario, you do not need a connection Object, just a Recordset Object:


Set RS = CreateObject("ADODB.Recordset")

strConn = "Provider=MSDASQL.1; " _
& "Persist Security Info=False; " _
& "User ID=ACCTING; " _
& "Data Source=ACCOUNTING; " _
& "Initial Catalog=S408"


strSql = "SELECT * FROM BPCSF_GPM"

RS.Open strSql,StrConn

When you've finished with RS,

RS.Close
Set RS = Nothing.