home *** CD-ROM | disk | FTP | other *** search
/ Internet Pratica / IPRAT_01.iso / ASP / ASPFusion_Basic_Suite / examples / asp / advdsn / act_add.asp next >
Encoding:
Text File  |  2001-09-14  |  1000 b   |  35 lines

  1. <HTML>
  2. <HEAD>
  3. <TITLE>AdvDSN Component</TITLE>
  4. </HEAD>
  5.  
  6. <BODY>
  7.  
  8. <%
  9. Dim AdvDSN, strDriver, strDSN
  10. Set AdvDSN = Server.CreateObject("AdvDSN.DSN")
  11. 'Access
  12. strDriver = "Microsoft Access Driver (*.mdb)"
  13. strDSN = "DSN=" & Request.Form("Name") & "\0Description=" & Request.Form("Description")
  14. strDSN = strDSN & "\0DBQ=" & Request.Form("File") & "\0Uid=" & Request.Form("User")
  15. strDSN = strDSN & "\0Pwd=" & Request.Form("Password") & "\0\0"
  16.  
  17. 'SQL
  18. 'strDriver = "SQL Server"
  19. 'strDSN = "DSN=testingsql\0Description=New SQL Server Data Source\0Server=(aziz)\0DATABASE=pubs\0pwd=sa\0\0"
  20.  
  21. 'Excel
  22. 'strDriver = "Microsoft Excel Driver (*.xls)"
  23. 'strDSN = "DSN=testingexcel\0Description=New Excel Data Source\0FileType=Excel\0DBQ=C:\EXCELDIR\odbc.xls\0MaxScanRows=20\0\0"
  24.  
  25. AdvDSN.Add strDriver, strDSN
  26. if (AdvDSN.IsError = 1) then
  27.     Response.Write AdvDSN.ErrorReason & "<br>"
  28. else
  29.     Response.Write "Created successfully" & "<br>"
  30. end if
  31. %>
  32. <a href="dsp_add.htm">Back</a>
  33. </BODY>
  34. </HTML>
  35.