Connecting to Other Databases

Access can be used as a front-end to various other databases, such as SQL Server. The example that follows shows a connection string that you might use to connect to a SQL Server database called Pubs on an instance named SQLServerName using integrated Windows security:

Dim strConnection As String strConnection = "Provider=sqloledb;Data Source=SQLServerName;" & _ "Integrated Security=SSPI,-Initial Catalog=Pubs"

cnConnection.Open strConnection

0 0

Post a comment