Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA to connect to SQL Server 2000

Status
Not open for further replies.

kjv1611

New member
Jul 9, 2003
10,758
US
I have queries that I manually use in Microsoft Query Analyzer at work. I would like to use an Access Database to run these instead in order to better automate the process. The only thing at this point that I think I need help with is how do I create a connection to the SQL Server database that I want, so that the SQL command will run the same from a VBA module as from Query Analyzer. I already know how to create the SQL statement, and how to run the SQL statement, just not how to connect.

Here is some additional information:
The way we login to the SQL servers is via our Windows Credentials. So, when I set up a new connection in Query Analyzer, or in Access when wanting to import tables/views into Access, I selected "Use Windows Credentials" when it asked about security information.

Is there not some generic command to use for this purpose?

Thanks for any help in this area.
 
This thread705-1245040 has an example of using the udl wizard to setup and test your connection.
 
Posted a star on the referenced thread. The udl wizard was the ticket!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top