DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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, 11:18 AM
  2. App Object
    By Rob Teixeira in forum .NET
    Replies: 15
    Last Post: 05-31-2002, 03:30 PM
  3. Ado Connection
    By Sok Y. Kim in forum VB Classic
    Replies: 4
    Last Post: 10-29-2000, 11:54 PM
  4. SQL server administrative knowledge
    By Becky in forum Database
    Replies: 1
    Last Post: 07-11-2000, 03:27 PM
  5. Replies: 0
    Last Post: 06-22-2000, 07:30 AM

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links