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

connect to Sql Server

Status
Not open for further replies.

sssdexter

Programmer
Oct 7, 2003
29
MY
Hi,

How i can connect my application to Sql Server database?

Thanks in advance
 
Code:
  Dim conn as ADODB.Connection
  Set conn = New ADODB.Connection
  conn.ConnectionString = "Provider=SQLOLEDB.1;" & _
                          "Persist Security Info=False;" & _
                          "User ID=blah;" & _
                          "Password=Password4Blah;" & _
                          "Initial Catalog=DatabaseName;" & _ 
                          "Data Source=ServreName"
  conn.Open

This is one way to do it. You have to have have the SQLOLEDB drivers (MDAC has them) on your machine and you have to reference the ADO library in your project.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top