Need VB Example: RDO ActiveX used from Excel 97 
Author Message
 Need VB Example: RDO ActiveX used from Excel 97

I am looking for an Example of an ActiveX control developed in VB 5 that
uses RDO to query a database.  I want to create such a control and then use
it from within Excel.

I know that I could do this from within Excel however the plan is to
eventually put this ActiveX object on MTS and have all the spreadsheets
call this business object.  This way we do not have to deploy excel
spreadsheets everytime there is a change (although this still may sometimes
be the case)

Enzo Maini



Fri, 30 Mar 2001 03:00:00 GMT  
 Need VB Example: RDO ActiveX used from Excel 97
Here is a function I have written that utilises ODBC, I haven't tried it
with an Excel Spreadsheet, but if ODBC is to be believed it shouldn't
matter!

From this you can then create your own component if you wish.

Regards

Chris Davis

Option Explicit

Public enWorkspace As rdoEnvironment
Public rdoDatabase As rdoConnection

Function bOpenRDODatabase(cDsn As String, cDta As String, cUserID,
cPassword As String) As Boolean
Dim cConnect As String

cConnect = "UID=" & cUserID & ";PWD=" & cPassword & ";Database=" & cDta

On Local Error Resume Next
Set enWorkspace = rdoEngine.rdoEnvironments(0)
Set rdoDatabase = enWorkspace.OpenConnection(dsName:=cDsn,
Connect:=cConnect)
On Local Error GoTo 0

If rdoDatabase.Connect = "" Then
    bOpenRDODatabase = False
Else
    bOpenRDODatabase = True
End If

End Function



Quote:
> I am looking for an Example of an ActiveX control developed in VB 5 that
> uses RDO to query a database.  I want to create such a control and then
use
> it from within Excel.

> I know that I could do this from within Excel however the plan is to
> eventually put this ActiveX object on MTS and have all the spreadsheets
> call this business object.  This way we do not have to deploy excel
> spreadsheets everytime there is a change (although this still may
sometimes
> be the case)

> Enzo Maini




Sun, 01 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Printing docs thru Word 97 using VB/DDE - an example

2. Help needed for error using visual basic and Excel 96-97

3. Using Excel 97 with Visual Studio 97 (VB5)

4. NEEDED: sample VB code for Excel 97 worksheet processing

5. Form in Excel 97, VB help needed to have one of three choices assigned to cell

6. Compatibility Problem Using MS Excel 97 VBA on Excel 2000/XP - Causes crashes

7. Determining file Version via VB(word 95, 97, Excel 95 97)

8. Automation w/WORD 97 - Simple example needed

9. Looking for Example using API for COM-Port in Access 97

10. VB5/Access 95 or 97 using RDO (Reposted)

11. Using RDO/wVB5 and Access 95 or 97

12. Problem with Excel 97 ActiveX radio buttons

 

 
Powered by phpBB® Forum Software