How to use the new database connectivity instead of ADO and Jet
I understand there is something newer than ADO and Jet?
I'm using Office 2010.
any ideas or suggestions welcome.
Or is ADO still Ok to use? I use it now without problems and have for a LONG LONG time now.
here is an example of Access and Excel
DougP
I understand there is something newer than ADO and Jet?
I'm using Office 2010.
any ideas or suggestions welcome.
Or is ADO still Ok to use? I use it now without problems and have for a LONG LONG time now.
here is an example of Access and Excel
Code:
Excel
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
FileName = Application.ActiveWorkbook.Fullname
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=" & FileName & ";" & _
"Extended Properties=Excel 8.0;"
.CursorLocation = adUseClient
.Open
End With
SQLStringReport = "Select fieldname from table where fieldname = xxx;"
rsReport.Open SQLStringReport, cn
TotalRecs = rsReport.RecordCount
With rsReport
Do Until .EOF
' do some precessing
rsReport.movenext
loop
End with
DougP