Read query SQL through VB call 
Author Message
 Read query SQL through VB call

Is it possible to read the actual MS Access2000 query string from a VB6.0
application or how do you call MS Access2000 modules from VB6.0

Thanks,
Larry Bye



Sat, 03 May 2003 03:00:00 GMT  
 Read query SQL through VB call
Larry,

SQL strings can be read using either DAO or ADO.  e.g.:

Public Function GetSqlDAO(ByVal dbTarget As DAO.Database, ByVal strQueryName
As String) As String

    GetSqlDAO = dbTarget.QueryDefs(strQueryName).SQL

End Function

Public Function GetSqlADO(ByVal cnnTarget As ADODB.Connection, ByVal
strQueryName As String) As String

    Dim catTarget As ADOX.Catalog

    Set catTarget = New ADOX.Catalog
    With catTarget
        Set .ActiveConnection = cnnTarget
        GetSqlADO = .Procedures(strQueryName).Command.CommandText
    End With

    Set catTarget = Nothing

End Function

HTH,
Nicole


Quote:
> Is it possible to read the actual MS Access2000 query string from a VB6.0
> application or how do you call MS Access2000 modules from VB6.0

> Thanks,
> Larry Bye




Sun, 04 May 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. how can I build 2 queries in 1 query(VB SQL query)

2. Query calling query - how do you do this in VB

3. Query calling query - how do you do this in VB

4. VB Query vs SQL Query Analyzer Speed?

5. Sql statement calling 2 access97 queries in asp page

6. Calling functions in SQL queries

7. SQL procedure call from VB with PL/SQL table (with two fields) as agrument

8. Converting returned of a select query to read/write from read-only

9. Query call query in VB6

10. Calling a query from a query

11. CALLING UP A QUERY OR RUNNING A QUERY FROM VB6

12. Query calling query

 

 
Powered by phpBB® Forum Software