Re: Data sources
- From: "Mouckster" <daniel.mouck@xxxxxx>
- Date: 14 Jun 2006 06:57:39 -0700
I've come across the same problem when trying to connect to a database.
The reference you need is:
Microsoft ActiveX Data Objects 2.1 Library
Dan.
Mr. Smith wrote:
Nothing ticks me off more than when you copy a complete sub/function
straight out of an office VBA help example and it doesn't work. Grrrrr!!!!
Try this:
******************
Sub SetAndReturnDataSourceName()
Dim appOffice As Office.OfficeDataSourceObject
Set appOffice = Application.OfficeDataSourceObject
With appOffice
.Open bstrConnect:="DRIVER=SQL Server;SERVER=10.15.1.66\Refresh;" & _
"AdlerM=user;PWD=Eagle1234;DATABASE=Refresh",
bstrTable:="Employees"
If .DataSource = "" Then
.DataSource = "Refresh"
MsgBox .DataSource
End If
End With
End Sub
*****************************
I've tried it in PPT, Excel, and Word. They all fail on:
** Set appOffice = Application.OfficeDataSourceObject **
Reporting "Object does not supprt this method or property."
Fine. So what reference do I need to include? Come on MVP's!!
Mr. Smith
.
- Prev by Date: Re: PowerPoint Add-in
- Next by Date: replace certain characters with other characters in a cell
- Previous by thread: Excel öffnen, aber nur wenn nicht zum Arbeiten gesperrt
- Next by thread: replace certain characters with other characters in a cell
- Index(es):
Relevant Pages
|
|