reference connection string in SQL statement?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: reference connection string in SQL statement?

  1. #1
    Join Date
    Dec 2005
    Posts
    1

    reference connection string in SQL statement?

    I'm trying to use a SQL string to set the recordsource of a report. I am using an Access front end and a SQL Server backend.

    I don't have any linked tables, so I need to reference the connection string right in the SQL string somehow . . . is this possible?

    If not how can I set the recordsource of a report when I don't have any linked tables? Other than using query objects . . .

    Thanks in advance . . .

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    You will need to specify the (ODBC) connection in your SQL statement. Below is an example:

    Code:
    SELECT * FROM [Orders] IN '' [ODBC;Driver={SQL Server};Server=(local);Database=Northwind;Trusted_Connection=yes]
    The above connection string uses integrated security. The link below has other examples:

    http://www.carlprothman.net/Default....erForSQLServer
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

Similar Threads

  1. Packed Data(Comp-3, etc)
    By Marcos in forum VB Classic
    Replies: 3
    Last Post: 01-25-2006, 12:18 PM
  2. App Object
    By Rob Teixeira in forum .NET
    Replies: 15
    Last Post: 05-31-2002, 04:30 PM
  3. Ado Connection
    By Sok Y. Kim in forum VB Classic
    Replies: 4
    Last Post: 10-30-2000, 12:54 AM
  4. SQL server administrative knowledge
    By Becky in forum Database
    Replies: 1
    Last Post: 07-11-2000, 04:27 PM
  5. Replies: 0
    Last Post: 06-22-2000, 08:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center