Using the Jet OLEDB:Link Provider String
You use the Jet OLEDB:Link Provider string when linking to external tables. It includes the source database type, user ID, and password. You must use a semicolon to separate each part of the connection string.Each source database type has a valid name. This is the name that must be used when accessing that type of data. These database types are found in the Windows registry under HKEY_LOCAL_MACHINE\Software\Microsoft\Jet\4.0\ISAM Formats. You must accurately specify the source database type, or you will be unable to access the external data.The user ID is used whenever a username must be specified to successfully log on to the data source. This is most common when dealing with back-end databases such as Oracle, Sybase, or Microsoft SQL Server. This part of the provider string can be required to log on the user to the system where the source data resides. The UID keyword refers to the user ID.As with the user ID, the password most often is included when dealing with back-end data. It can also be used on other database types that support passwords, such as Paradox, or when linking to an external Access table. The PWD keyword is used when specifying the password.Finally, the dataset name refers to a defined ODBC data source. The DSN keyword refers to the dataset name in the connection string. The following is an example of a Jet OLEDB Link Provider string:tbl.Properties("Jet OLEDB:Link Provider String") = "ODBC" & _
";DATABASE=Pubs" & _
";UID=Alison" & _
";PWD=MyPass" & _
";DSN=PublisherData"
In the example, the SQL Server database being accessed is Pubs, the user ID is Alison, the Password is MyPass, and the data source name is PublisherData.