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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logging in using WA

Status
Not open for further replies.

GerardMcL

Technical User
Aug 5, 2004
212
IE
Hi,

I am trying to connect to a SQL Server using VB6.
I have put in name of server and the initial catalog (the name of database I wish to use - this is right isnt it???)

But I am having trouble logging in.
Is there a way I can instruct it to login using my Windows authentication, without actually hardocding these details?

Thanks for the help!
 
Hi,

Try this:

objConnection.Open = "Provider=SQLOLEDB.1;Data Source=" & <servername>& "; Initial Catalog=<DataBaseName>;Trusted_Connection=Yes"

We use this for WA and we get by. Hope this helps.

Regards,
Tom
 
Also, if you see the phrase "Integrated Security=SSPI;" in your connection string, as opposed to a username and password, you're telling the SQL OLE DB provider that you're using integrated security. I don't know if you're trying to avoid that ("hardcoding these details?"); if you are, post back and let us know.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top