This article will help you to create a System Data Source Name (DSN) for Microsoft SQL Server on your local machine.
Open Control Panel window, you will see different icons as shown in Pic 1.
Double click on ODBC Data Source Administrator icon.
Pic 1. Select System DSN tab, and click Add. Pic 2. Pic 3. Enter the name you like to use for DSN and then choose SQL Server to which you want to connect. If SQL Server is located on the same machine you can choose Local. If Server is not located on the same machine then you need to enter the IP Address or domain name to connect to that Server. Enter the domain name or IP Address and Click Next. Pic 4. Pic 5. At last step you will have the option to test your Connection. After a System DSN has been created you can use it within any ASP page located on the same computer.
After a System DSN is created you can open connection to that database in an ASP page with this simple code. <% Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open "DSN=MyDSN;UID=Admin;PWD=Test" %> Access database Microsoft SQL Server If you are connecting to an Access database and your Access database don't need UserID and Password to connect then your code. | ||||
No comments:
Post a Comment