Request: example of an ODBC connection to btrieve data from Excel VBA 
Author Message
 Request: example of an ODBC connection to btrieve data from Excel VBA

Does anyone have any Excel VBA code that could demonstrate gathering
data from a Btrieve ODBC source and then returning that data into an
Excel sheet?  I don't mean using a MS query , I'd like a direct
connection.  I am almost there with my own coding but would like an
example is possible.

Thanks!

here is what I've got so far.  It gets the data I want to display in
the Immediate debug window, but I need help with the return of the
information I retrieve:

Sub OpenRecordset()

Dim wrkODBC As Workspace
Dim conPubs As Connection
Dim rstTemp As Recordset
Set wrkODBC = CreateWorkspace("", "admin", "", dbUseODBC)
Set conPubs = wrkODBC.OpenConnection("Connection1", dbDriverNoPrompt,,
"ODBC;DSN=My Data source ")
Debug.Print "Opening dynamic-type recordset from " & "an ODBC
connection..."
Set rstTemp = conPubs.OpenRecordset("SELECT mytable.mycolumn FROM
mytable mytableagain? WHERE (mytable.column Is Null) , dbOpenDynamic)

OpenRecordsetOutput rstTemp

    rstTemp.Close
    conPubs.Close
    wrkODBC.Close

End Sub

Sub OpenRecordsetOutput(rstOutput As Recordset)

    ' Enumerate the specified Recordset object.
    With rstOutput
        Do While Not .EOF
            Debug.Print , .Fields(0), .Fields(1), .Fields(2),
Fields(3)
            .MoveNext
            Sheet1.Activate
        Loop
    End With
' ThisWorkbook.Sheets.Add
Sheet1.Activate
End Sub

Thanks!



Mon, 07 May 2001 03:00:00 GMT
 Request: example of an ODBC connection to btrieve data from Excel VBA

Quote:

>Does anyone have any Excel VBA code that could demonstrate gathering
>data from a Btrieve ODBC source and then returning that data into an
>Excel sheet?  I don't mean using a MS query , I'd like a direct
>connection.  I am almost there with my own coding but would like an
>example is possible.

>Thanks!

>here is what I've got so far.  It gets the data I want to display in
>the Immediate debug window, but I need help with the return of the
>information I retrieve:

>Sub OpenRecordset()

>Dim wrkODBC As Workspace
>Dim conPubs As Connection
>Dim rstTemp As Recordset
>Set wrkODBC = CreateWorkspace("", "admin", "", dbUseODBC)
>Set conPubs = wrkODBC.OpenConnection("Connection1", dbDriverNoPrompt,,
>"ODBC;DSN=My Data source ")
>Debug.Print "Opening dynamic-type recordset from " & "an ODBC
>connection..."
>Set rstTemp = conPubs.OpenRecordset("SELECT mytable.mycolumn FROM
>mytable mytableagain? WHERE (mytable.column Is Null) , dbOpenDynamic)

>OpenRecordsetOutput rstTemp

>    rstTemp.Close
>    conPubs.Close
>    wrkODBC.Close

>End Sub

>Sub OpenRecordsetOutput(rstOutput As Recordset)

>    ' Enumerate the specified Recordset object.
>    With rstOutput
>        Do While Not .EOF
>            Debug.Print , .Fields(0), .Fields(1), .Fields(2),
>Fields(3)
>            .MoveNext
>            Sheet1.Activate
>        Loop
>    End With
>' ThisWorkbook.Sheets.Add
>Sheet1.Activate
>End Sub

>Thanks!

Joe,
        We do not have an example for you.  We have not tested on nor
do we support the VBA environment.  If we can assist on other issues,

Regards,
Jose
Pervasive Software



Fri, 11 May 2001 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Problems with ODBC connection to SQL Server from VBA (Excel 97)

2. Problems with ODBC connection to SQL Server from VBA (Excel 97)

3. Problems with ODBC connection to SQL Server from VBA (Excel 97)

4. problem with ODBC in Excel 5.0 using VBA and ODBC API calls

5. problem with ODBC in Excel 5.0 using VBA and ODBC API

6. problem with ODBC in Excel 5.0 using VBA and ODBC API calls

7. Unable to reuse ADO.Recordset connection using VBA script in Excel

8. Connecting to an SQL ODBC source from Excel VBA

9. Excel VBA ODBC Stored Procedure calls

10. Excel VBA/Macintosh/Q+E FoxPro ODBC driver

11. LDIF-file-import to Excel and prepare data for VBA-ADSI-Export

12. Excel VBA using ADO to extract data from SQL Server


 
Powered by phpBB® Forum Software