home *** CD-ROM | disk | FTP | other *** search
/ Internet Pratica / IPRAT_01.iso / ASP / ASPFusion_Basic_Suite / examples / cf / advdsn / act_configure.cfm < prev    next >
Encoding:
ColdFusion Markup Language  |  2001-09-14  |  989 b   |  30 lines

  1. <HTML>
  2. <HEAD>
  3. <TITLE>AdvDSN Component</TITLE>
  4. </HEAD>
  5.  
  6. <BODY>
  7. <cfobject class="AdvDSN.DSN" action="CREATE" name="AdvDSN">
  8. <cfset strDriver = "Microsoft Access Driver (*.mdb)">
  9. <cfset strDSN = "DSN=" & #Form.Name# & "\0Description=" & #Form.Description#>
  10. <cfset strDSN = strDSN & "\0DBQ=" & #Form.File# & "\0User=" & #Form.User#>
  11. <cfset strDSN = strDSN & "\0Pwd=" & #Form.Password# & "\0\0">
  12. <!--
  13. 'SQL
  14. 'strDriver = "SQL Server"
  15. 'strDSN = "DSN=testingsql\0Description=New SQL Server Data Source\0Server=(local)\0DATABASE=pubs\0\0"
  16.  
  17. 'Excel
  18. 'strDriver = "Microsoft Excel Driver (*.xls)"
  19. 'strDSN = "DSN=testingexcel\0Description=New Excel Data Source\0FileType=Excel\0DBQ=C:\EXCELDIR\odbc.xls\0MaxScanRows=20\0\0"
  20. -->
  21. <cfset temp = AdvDSN.Configure(strDriver, strDSN)>
  22. <cfif AdvDSN.IsError Eq 1>
  23.     <cfoutput>#AdvDSN.ErrorReason#</cfoutput> <br>
  24. <cfelse>
  25.     <cfoutput>Configured successfully</cfoutput> <br>
  26. </cfif>
  27. <a href="dsp_configure.htm">Back</a>
  28. </BODY>
  29. </HTML>
  30.