Getting Started with SQL Server from VBA

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wquatan
    New Member
    • Oct 2007
    • 48

    Getting Started with SQL Server from VBA

    Hi,

    What are the options to replace an Access Query (query with criteria - from a SQL-server table) by a SQL-server View or T-SQL with the possibility to pass the criteria(filter ) from VBA.

    Would be great If I could find somewhere an example of how to proceed in the SQL-server but also how to execute from VBA and use the result.

    Thx
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    You can do this in a number of ways:

    1. Build your query dynamically on your Access inserting whatever variables you need.

    2. Create a view and read the view as needed.

    3. Create a UDF that can accept parameters that can be used on your WHERE clause.

    Good Luck!!!

    ~~ CK

    Comment

    • wquatan
      New Member
      • Oct 2007
      • 48

      #3
      Just looking again into this, unfortunatly I'm getting nowhere.

      I created a TableValuedFunc tion in SQLserver, but don't know how to use these in VBA (beyond the select-syntax with parameters)

      It would be great If could find somewhere a working example MDB (sort of NorthWind) to look at how things are done in cooperation with TVF's

      Anyone ?

      Comment

      Working...