Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to use ADODB in Excel 2003


I wish to run code in excel 2003 which opens an access 2003 database and
retrieves some data from it. I am running XP SP2 and have installed MDAC
2.8 SP1, but still cannot get it to work. I get "Run-time error 3706.
Provider cannot be found. It may not be properly installed."

Does anyone have any ideas?


--
alpder
------------------------------------------------------------------------
alpder's Profile: http://www.excelforum.com/member.php...o&userid=28547
View this thread: http://www.excelforum.com/showthread...hreadid=509194

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default How to use ADODB in Excel 2003

Try something like this;

Public Sub testing()
Dim cnn As ADODB.Connection
Dim rs1 As ADODB.Recordset
Dim strSQL1 As String, strConn
Dim i As Integer
i = 1
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=C:\Program Files\Microsoft Office\" _
& "OFFICE11\SAMPLES\Northwind.mdb;Persist Security Info=False"
strSQL1 = "SELECT EmployeeID, LastName, FirstName " _
& "FROM Employees; "
Set cnn = New ADODB.Connection
Set rs1 = New ADODB.Recordset
cnn.Open strConn
rs1.Open strSQL1, cnn, adOpenForwardOnly, adLockReadOnly
Do While rs1.EOF = False
Sheets("Sheet1").Range("A" & i) = rs1!EmployeeID
Sheets("Sheet1").Range("B" & i) = rs1!LastName
Sheets("Sheet1").Range("C" & i) = rs1!FirstName
i = i + 1
rs1.MoveNext
Loop
rs1.Close
cnn.Close
End Sub

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"alpder" wrote:
|
| I wish to run code in excel 2003 which opens an access 2003 database and
| retrieves some data from it. I am running XP SP2 and have installed MDAC
| 2.8 SP1, but still cannot get it to work. I get "Run-time error 3706.
| Provider cannot be found. It may not be properly installed."
|
| Does anyone have any ideas?
|
|
| --
| alpder
| ------------------------------------------------------------------------
| alpder's Profile:
http://www.excelforum.com/member.php...o&userid=28547
| View this thread: http://www.excelforum.com/showthread...hreadid=509194
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default How to use ADODB in Excel 2003

Hi alpder

Maybe this page is useful
http://www.rondebruin.nl/accessexcel.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"alpder" wrote in message
...

I wish to run code in excel 2003 which opens an access 2003 database and
retrieves some data from it. I am running XP SP2 and have installed MDAC
2.8 SP1, but still cannot get it to work. I get "Run-time error 3706.
Provider cannot be found. It may not be properly installed."

Does anyone have any ideas?


--
alpder
------------------------------------------------------------------------
alpder's Profile: http://www.excelforum.com/member.php...o&userid=28547
View this thread: http://www.excelforum.com/showthread...hreadid=509194



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
access database (adodb)from excel vba AskExcel Excel Worksheet Functions 0 July 17th 06 02:01 AM
share adodb connection in excel Marek Excel Programming 3 September 7th 04 08:56 AM
adodb.recordset with excel nate axtell Excel Programming 14 June 11th 04 01:32 PM
Virus - importing excel via adodb connection Jim M[_4_] Excel Programming 1 May 15th 04 08:09 AM
Export from Excel to Access ADODB javydreamercsw Excel Programming 2 February 19th 04 09:49 PM


All times are GMT +1. The time now is 07:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"