Results 1 to 3 of 3

Thread: Connecting to SQL Server

  1. #1

    Thread Starter
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 2000
    Location
    In my sphere of influence
    Posts
    621

    Unhappy

    Dear All

    I have never used SQL server and need to connect to it and create reports from SQL strings using DAO as it is an old system.

    Can anyone provide any code samples of connecting and creating recordsets.

    I presume once the connection is established the code is the same as using DAO on an access database, but I am not sure.

    Thanks
    Gary Lowe
    VB6 (Enterprise) SP5
    ADO 2.6
    SQL Server 7 SP3

    OK I know my spelling and grammer is crap so don't quote me on it!

    To err is human to take the P! is only natural !!

    Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip


  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Hi Gary

    The connection string that you are looking for is as follows

    Code:
    ConnectionString = "driver=[SQL Server];uid=admin;server=myserver;database=people"


    as for your second question, yes it is mostly the same, apart from some SQL bit's

    Hope this helps

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    The only time I've used DAO to get to SQL server is when I've had an Access database with joined tables. The "preferred" method of aceessing a SQL server database is ADO, otherwise RDO or ODBC.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width