ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ADODB (https://www.excelbanter.com/excel-programming/297472-adodb.html)

Richard Mogy

ADODB
 
I use both Visual Basic and Visual Basic for Applications. In VB I have a
component (Microsoft ADO Control) that can activate and then dim

dim con1 as ADODB.connection

and then select data from my SQL database.

In VBA, there isn't a "Components" selection, only "References". Yet
through various posting on these sites I have seen VBA (Excel) code that
creates the same dim reference.

How do I get VBA to recognize the Microsoft ADO Control?



Bob Phillips[_6_]

ADODB
 
Dim con1 As Object
Dim oRS as Object

Set con1 = CreateObject("ADODB.Connection")
Set oRS = CreateObject("ADODB.Recordset")

etc.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Richard Mogy" wrote in message
m...
I use both Visual Basic and Visual Basic for Applications. In VB I have a
component (Microsoft ADO Control) that can activate and then dim

dim con1 as ADODB.connection

and then select data from my SQL database.

In VBA, there isn't a "Components" selection, only "References". Yet
through various posting on these sites I have seen VBA (Excel) code that
creates the same dim reference.

How do I get VBA to recognize the Microsoft ADO Control?





Richard Mogy

ADODB
 
Thank you very much for your input -- it's exactly what I needed.
"Bob Phillips" wrote in message
...
Dim con1 As Object
Dim oRS as Object

Set con1 = CreateObject("ADODB.Connection")
Set oRS = CreateObject("ADODB.Recordset")

etc.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Richard Mogy" wrote in message
m...
I use both Visual Basic and Visual Basic for Applications. In VB I have

a
component (Microsoft ADO Control) that can activate and then dim

dim con1 as ADODB.connection

and then select data from my SQL database.

In VBA, there isn't a "Components" selection, only "References". Yet
through various posting on these sites I have seen VBA (Excel) code that
creates the same dim reference.

How do I get VBA to recognize the Microsoft ADO Control?







Bob Phillips[_6_]

ADODB
 
Great, I'm glad you understood my succinct response.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Richard Mogy" wrote in message
. com...
Thank you very much for your input -- it's exactly what I needed.
"Bob Phillips" wrote in message
...
Dim con1 As Object
Dim oRS as Object

Set con1 = CreateObject("ADODB.Connection")
Set oRS = CreateObject("ADODB.Recordset")

etc.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Richard Mogy" wrote in message
m...
I use both Visual Basic and Visual Basic for Applications. In VB I

have
a
component (Microsoft ADO Control) that can activate and then dim

dim con1 as ADODB.connection

and then select data from my SQL database.

In VBA, there isn't a "Components" selection, only "References". Yet
through various posting on these sites I have seen VBA (Excel) code

that
creates the same dim reference.

How do I get VBA to recognize the Microsoft ADO Control?










All times are GMT +1. The time now is 04:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com