Data Source Name (DSN):
Way to refer to a specific database. You specify a DSN with a unique name
and by the ODBC driver that communicates with the physical database
(local or remote). You create a DSN using the ODBC Administrator in
Windows.
1.System DSNs work for anyone using that system. For example, no matter who logs onto the machine, system DSNs can be seen by all users, and they are stored in the Registry in the Local Machine section.
2.User DSNs work only for a specific user on a machine. So if someone other than the person who created the user DSN logs onto that machine, then the User DSN will not show up. This DSN is stored in the Registry in the Current User section.
3.File DSNs are not stored in the Registry but rather in a file. That means you can store these DSNs to disk or network and use them on any machine or any user that has access to it.
Do the following to create a DSN for your database:
For a User or System DSN
Select Start » Settings » Control Panel » Administrative Tools » Data Sources (ODBC) in Windows 2000/XP and Start » Settings » Control Panel » Data Sources (ODBC) in Windows 9x/Me
Select either the User or System DSN tab
Select Add » Microsoft Access Driver (*.mdb) » Finish
Give it a Data Source Name and a good description and choose the select button in the database field
Navigate to the location of your access database and select OK
Select OK on the ODBC Microsoft Access Setup window
You should now see your DSN in the User/System Data Source window
For a File DSN
Select Start » Settings » Control Panel » Administrative Tools » Data Sources (ODBC) in Windows 2000/XP and Start » Settings » Control Panel » Data Sources (ODBC) in Windows 9x/Me
Select the File DSN tab
Select Add » Microsoft Access Driver (*.mdb) » Next
Type the name of the DSN (the name of the file should have a dsn file extension)
Select Next » Finish
Choose the select button in the database field
Navigate to the location of your access database and select OK
Select OK on the ODBC Microsoft Access Setup window
Select OK on the ODBC Data Source Administrator window
The DSN file should now be located in the location you specified in step 4
你可以创建一个file的dsn 链接到远程的数据库,按照以上的步骤
我查的资料并没有例子,你可以试一下