Tuesday, December 8, 2009

ADO Connection

If you are try to connect to ADO. Here is the connection string for Excel

sXL = "c:\CtArtExample.xls"

Set Cn = New ADODB.ConnectionCn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & sXL & ";Extended Properties=Excel 8.0;Persist Security Info=False"Cn.ConnectionTimeout = 40

Cn.Open

The rest is the usual ADO recordset retrieving technique.

No comments: