<%
    Set FS = CreateObject("Scripting.FileSystemObject")
    Set WriteFile = FS.OpenTextFile(Server.MapPath("ims_config.asp"), 2)
    WriteFile.WriteLine("<" & chr(37))
    WriteFile.WriteLine("'OneWorldStore - Configuration Script v1.00.")
    WriteFile.WriteLine("'Copyright (C) 1995-2004.")
    WriteFile.WriteLine("'http://www.oneworldstore.com")
    WriteFile.WriteLine("'")
    WriteFile.WriteLine("'This script is part of the OneWorldStore Package and should ")
    WriteFile.WriteLine("'only be modified by pointing your Web browser to the admin directory.")
    WriteFile.WriteLine("'--------------------------------------------------------------------------------")
    WriteFile.WriteLine("Dim strAdmin")
    WriteFile.WriteLine("Dim strAdminPW")
    WriteFile.WriteLine("Dim strWebSiteName")
    WriteFile.WriteLine("Dim strLicenseNumber")	
    WriteFile.WriteLine("Dim strRc4Key")
    WriteFile.WriteLine("Dim strStoreID")
    WriteFile.WriteLine("Dim strDemoMode")
    WriteFile.WriteLine("Dim strDebugMode")
    WriteFile.WriteLine("Dim strDbLocked")
    WriteFile.WriteLine("Dim strDbType")
    WriteFile.WriteLine("Dim strPWD")
    WriteFile.WriteLine("Dim strUserID")
    WriteFile.WriteLine("Dim strDatabase")
    WriteFile.WriteLine("Dim strServerName")
    WriteFile.WriteLine("Dim strCharacterSet")
    WriteFile.WriteLine("")
    WriteFile.WriteLine("strAdmin=" & chr(34) & Request.Form("Admin") & chr(34))
    WriteFile.WriteLine("strAdminPW=" & chr(34) & Request.Form("AdminPW") & chr(34))
    WriteFile.WriteLine("strWebSiteName=" & chr(34) & Request.Form("WebSiteName") & chr(34))
    WriteFile.WriteLine("strLicenseNumber=" & chr(34) & Request.Form("LicenseNumber") & chr(34))
    WriteFile.WriteLine("strRc4Key=" & chr(34) & Request.Form("Rc4Key") & chr(34))
    WriteFile.WriteLine("strStoreID=" & chr(34) & Request.Form("StoreID") & chr(34))
    WriteFile.WriteLine("strDemoMode=" & chr(34) & Request.Form("DemoMode") & chr(34))
    WriteFile.WriteLine("strDebugMode=" & chr(34) & Request.Form("DebugMode") & chr(34))
    WriteFile.WriteLine("strDbLocked=" & chr(34) & Request.Form("DbLocked") & chr(34))
    WriteFile.WriteLine("strDbType=" & chr(34) & Request.Form("DbType") & chr(34))
    WriteFile.WriteLine("strPWD=" & chr(34) & Request.Form("Password") & chr(34))
    WriteFile.WriteLine("strUserID=" & chr(34) & Request.Form("UserID") & chr(34))
    WriteFile.WriteLine("strDatabase=" & chr(34) & Request.Form("Database") & chr(34))
    WriteFile.WriteLine("strServerName=" & chr(34) & Request.Form("ServerName") & chr(34))
    WriteFile.WriteLine("strCharacterSet=" & chr(34) & Request.Form("CharacterSet") & chr(34))
    WriteFile.WriteLine("")
    WriteFile.WriteLine("'End of configuration")

    strPWD=Request.Form("Password")
    strUserID=Request.Form("UserID")
    strDatabase=Request.Form("Database")
    strServerName=Request.Form("ServerName")

    WriteFile.WriteLine("")
    WriteFile.WriteLine("'--------------------------------------------------------------------------------  ")
    WriteFile.WriteLine("'")
    WriteFile.WriteLine("'--------------------------------------------------------------------------------  ")
    WriteFile.WriteLine("")
    WriteFile.WriteLine("dim connString")
    WriteFile.WriteLine("")
    WriteFile.WriteLine("connString = Server.CreateObject(""ADODB.Connection"")")
    WriteFile.WriteLine("connString=""Provider=SQLOLEDB.1;Password=" & strPWD & ";Persist Security Info=True;User ID=" & strUserID & ";Initial Catalog=" & strDatabase & ";Data Source=" & strServerName & chr(34))	
	WriteFile.WriteLine("")
	WriteFile.WriteLine("")
    WriteFile.WriteLine("const WebSiteName =" & chr(34) & Request.Form("WebSiteName") & chr(34))
    WriteFile.WriteLine("const LicenseNumber =" & chr(34) & Request.Form("LicenseNumber") & chr(34))
    WriteFile.WriteLine("const rc4Key =" & chr(34) & Request.Form("Rc4Key") & chr(34))
    WriteFile.WriteLine("const storeID =" & chr(34) & Request.Form("StoreID") & chr(34))
    WriteFile.WriteLine("const demoMode =" & chr(34) & Request.Form("DemoMode") & chr(34))
    WriteFile.WriteLine("const debugMode =" & chr(34) & Request.Form("DebugMode") & chr(34))
    WriteFile.WriteLine("const dbLocked =" & chr(34) & Request.Form("DbLocked") & chr(34))
    WriteFile.WriteLine("const dbDbType =" & chr(34) & Request.Form("DbType") & chr(34))
    WriteFile.WriteLine("")
    WriteFile.WriteLine(chr(37) & ">")
    WriteFile.Close
    SET FS = nothing
    Response.Write "Changes saved.<br>"
    Response.Redirect "../setup/step3b.asp"
%>