File: C:\v24\site\datapump\select_database.asp Line:<%'#931 added ##
if len(trim(getUtilities().nullfix2(session("choose_" & database & ".useDSN"))))=0 then
	session("choose_" & database & ".useDSN")="Yes"
end if

showErrorMessage session("choose_" & database & ".error"), false
session("choose_" & database & ".error")=""
%>

<table>
	<tr>
		<td valign=top class="label"><font size=+2><i><%=database%></i></font></td>
	</tr>
	<tr>
		<td valign=top class="label">##Database Type##</td>
		<td align=left valign=top>
			<%selectedVal=""%>
		    <select name=<%=database%>.database_type>
				<option <%=selectSessionVariable("choose_" & database & ".database_type","Access", selectedVal)%>>##Access##
				<option <%=selectSessionVariable("choose_" & database & ".database_type","SQLServer", selectedVal)%>>##SQL Server##
				<option <%=selectSessionVariable("choose_" & database & ".database_type","Oracle", selectedVal)%>>##Oracle##
				<option <%=selectSessionVariable("choose_" & database & ".database_type","DB2", selectedVal)%>>##DB2##
				<option <%=selectSessionVariable("choose_" & database & ".database_type","Informix", selectedVal)%>>##Informix##
				<option <%=selectSessionVariable("choose_" & database & ".database_type","Redbrick", selectedVal)%>>##Redbrick##
				<option <%=selectSessionVariable("choose_" & database & ".database_type","Excel", selectedVal)%>>##Excel##
				<option <%=selectSessionVariable("choose_" & database & ".database_type","Foxpro", selectedVal)%>>##Foxpro##
				<option <%=selectSessionVariable("choose_" & database & ".database_type","MYOB", selectedVal)%>>##MYOB##
				<option <%=selectSessionVariable("choose_" & database & ".database_type","Mysql", selectedVal)%>>##Mysql##
				<option <%=selectSessionVariable("choose_" & database & ".database_type","Interbase", selectedVal)%>>##Interbase##
				<option <%=selectSessionVariable("choose_" & database & ".database_type","Firebird", selectedVal)%>>##Firebird##
				<option <%=selectSessionVariable("choose_" & database & ".database_type","Faircom", selectedVal)%>>##FairCom/Attache##
				<option <%=selectSessionVariable("create_mapping.database_type_preset","PervasiveSQL", selectedVal)%>>##PervasiveSQL##
				<option <%=selectSessionVariable("choose_" & database & ".database_type","Other", selectedVal)%>>##Other##
			</select>
			<font color=red><%=session("choose_" & database & ".database_type.error")%></font>
		</td>
	</tr>
	<tr><td colspan=2 height=10></td></tr>
	
	<tr>
		<td class="welcomedesc" colspan=2>##Database Connection##</td>
	</tr>
	<tr>
	<%
	if isobject(odbcList) then%>
		<td valign=top><input type=radio name=<%=database%>.useDSN <%if session("choose_" & database & ".useDSN")="Yes" then response.write "CHECKED"%> value="Yes"><b>##DSN##</b></td>
		<td align=left valign=top>
			<table>
				<tr>
					<td align=right><i>##Data Source##</i></td>
					<td>
					<%
						set odbcSources=odbcList.getDataSources(SQL_FETCH_FIRST_SYSTEM)%>
						<select name=<%=database%>.dsn>
						<%
						dsnStillExists=false
						for each key in odbcSources.keys
							selectedStatus=""
							if key=session("choose_" & database & ".dsn") then
								selectedStatus="SELECTED"
								dsnStillExists=true
							end if%>
							<option <%=selectedStatus%> value="<%=key%>"><%=key%>
						<%next
						set odbcSources=nothing
						%>
						</select>
						<%if useDSN="Yes" and not dsnStillExists then%>
							<font color=red>##DSN## <i><%=session("choose_" & database & ".dsn")%></i> no longer available</font>
						<%end if%>
					</td>
				</tr>
				<tr>
					<td align=right><i>##Username##</i></td>
					<td><input type=text name=<%=database%>.database_username value="<%=session("choose_" & database & ".database_username")%>" size=14></td>
				</tr>
				<tr>
					<td align=right><i>##Password##</i></td>
					<td><input type=password name=<%=database%>.database_password value="<%=session("choose_" & database & ".database_password")%>" size=14></td>
				</tr>
			</table>
		</td>
	</tr>
	<%
	else
		session("choose_" & database & ".useDSN")="No"
	end if
	%>

	<tr>
		<td valign=top><input type=radio name=<%=database%>.useDSN  <%if session("choose_" & database & ".useDSN")="No" then response.write "CHECKED"%> value="No"><b>##DB String##</b></td>
		<td align=left valign=top><input type=text name=<%=database%>.database_string size=40 value="<%=session("choose_" & database & ".database_string")%>"><font color=red><%=session("choose_" & database & ".database_string.error")%></font>
	</tr>
	
	<tr><td colspan=2 height=10></td></tr>
	<tr>
		<td valign=top class="label">##Initial Commands##</td>
		<td align=left valign=top><input type=text size=40 name=<%=database%>.initial_command1></td>
	</tr>
	<tr>
		<td valign=top>&nbsp;</td>
		<td align=left valign=top><input type=text size=40 name=<%=database%>.initial_command2></td>
	</tr>
</table>

File: C:\v24\site\datapump\select_database_action.asp Line:<%'#931 added ##
'Store session values
session("choose_" & database & ".database_type")=request(database & ".database_type")
session("choose_" & database & ".useDSN")=request(database & ".useDSN")
session("choose_" & database & ".dsn")=request(database & ".dsn")
session("choose_" & database & ".database_username")=request(database & ".database_username")
session("choose_" & database & ".database_password")=request(database & ".database_password")
session("choose_" & database & ".database_string")=request(database & ".database_string")

'Should check database connection - redirect back if there is an error
%>
<BR><font size=+1><b>##Checking database:##</b> <i><%=database%> ...</i></font>
<%
if database="source" then
	getSourceConn(true)
else
	getDestinationConn(true)
end if
%>
<i>##OK!##</i>

<%
for i=1 to 2
	initial_command=trim(request(database & ".initial_command" & i))
	if len(initial_command)>0 then%>
		<BR><font size=+1><b>##Executing initial command:##</b> <i><%=initial_command%> ...</i></font>
		<%
		errMsg=""
		if database="source" then
			call sourceExecute(false, initial_command, errMsg)
		else
			call destinationExecute(false, initial_command, errMsg)
		end if
		if len(trim(errMsg))>0 then%>
			<font color=red><%=errMsg%></font>
			<%response.end
		else%>
			<i>##OK!##</i>
		<%end if
	end if
next%>


