Code to connect SQL Server 7.0 to Visual Basic 6.0

I would like to know how to connect SQL Server 7.0 to Visual Basic 6.0. Can you please give me the codes?

    Requires Free Membership to View

    By submitting your registration information to SearchSQLServer.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSQLServer.com is governed by our Terms of Use. You may contact us at [email protected].

This code can be used for the connection:

Public adoconn as ADODB.Connection

Sub main()
Set adoconn = New ADODB.Connection
adoconn.ConnectionString = "Driver={SQL
Server};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=m
yPassword;"
adoconn.Open
End Sub

This was first published in December 2007

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.