Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default ODBC Excel add-in does not work/is not supported in Office 2007?

Greetings,
We have employed the Excel ODBC (open database connectivity) add-in in all
prior versions of Microsoft Office. We use this to pull data from SQL and
Access databases into Excel. Though I meticulously installed the add-in
after upgrading to Office 2007 Pro, and though it seems to display as
correctly installed, it does not function. I have found no useful
information on other forums including the main Microsoft knowledge base and
Office Help areas. Any info and tips would be appreciated.
Thanksl
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default ODBC Excel add-in does not work/is not supported in Office 2007?

See if this helps. Don't forget to; Tools|References and check the box for
'Microsoft ActiveX Data Objects 2.x Library'

Use the highest version that will still support your clients.


Public Sub testread()
Dim cnn As ADODB.Connection
Dim rs1 As ADODB.Recordset
Dim strSQL1 As String, strConn
Dim i As Integer
i = 1


'Use for Access (jet)
'strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=C:\Program Files\Microsoft Office\" _
& "OFFICE11\SAMPLES\Northwind.mdb;Persist Security Info=False"


'Use for SQL server (OLEDB)
strConn = "Provider=SQLOLEDB.1;" _
& "Integrated Security=SSPI;" _
& "Persist Security Info=False;" _
& "Initial Catalog=Northwind;" _
& "Data Source=PE1600"


strSQL1 = "SELECT 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!LastName
Sheets("Sheet1").Range("B" & i) = rs1!FirstName
i = i + 1
rs1.MoveNext
Loop
rs1.Close
cnn.Close
End Sub


Public Sub testwrite()
Dim cnn As ADODB.Connection
Dim rs1 As ADODB.Recordset
Dim strSQL1 As String, strConn
Dim i As Integer
i = 1


'Use for Access (jet)
'strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=C:\Program Files\Microsoft Office\" _
& "OFFICE11\SAMPLES\Northwind.mdb;Persist Security Info=False"


'Use for SQL server (OLEDB)
strConn = "Provider=SQLOLEDB.1;" _
& "Integrated Security=SSPI;" _
& "Persist Security Info=False;" _
& "Initial Catalog=Northwind;" _
& "Data Source=PE1600"


strSQL1 = "SELECT LastName, FirstName " _
& "FROM Employees; "
Set cnn = New ADODB.Connection
Set rs1 = New ADODB.Recordset
cnn.Open strConn
rs1.Open strSQL1, cnn, adOpenDynamic, adLockOptimistic
For i = 1 To 3
rs1.AddNew
rs1!LastName = Sheets("Sheet1").Range("A" & i)
rs1!FirstName = Sheets("Sheet1").Range("B" & i)
i = i + 1
rs1.Update
Next
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

"Dave" wrote:
Greetings,
We have employed the Excel ODBC (open database connectivity) add-in in all
prior versions of Microsoft Office. We use this to pull data from SQL and
Access databases into Excel. Though I meticulously installed the add-in
after upgrading to Office 2007 Pro, and though it seems to display as
correctly installed, it does not function. I have found no useful
information on other forums including the main Microsoft knowledge base
and
Office Help areas. Any info and tips would be appreciated.
Thanksl


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
How can I make my Excel invoice template work with Office 2007? jberenyi Excel Discussion (Misc queries) 1 December 30th 09 02:13 AM
Office 2007 Excel - Inserting Copied or cut rows from another work Over the Rainbow Excel Discussion (Misc queries) 1 June 16th 08 03:57 PM
Publish Chart not supported in Office 2007? james Charts and Charting in Excel 0 February 14th 07 10:38 AM
Publish Chart not supported in Office 2007? james Excel Programming 0 February 14th 07 05:04 AM
Office XP Web Components supported by Office 2003 Chris P Excel Discussion (Misc queries) 0 June 21st 05 11:35 PM


All times are GMT +1. The time now is 03:38 PM.

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

About Us

"It's about Microsoft Excel"