Query Analysis Sqlultimate.asp--part C
<title>BuildSQL</title>
<!--#include file= "datatypelib.asp"-->
<script language= "JavaScript1.2" type= "Text/javascript" >
<!--
function AddField (field) {
Strfield = Document.sqlForm.strSQL.value;
Strfield = Strfield + "[" + Field + "]";
if (Confirm ("Add" + Field + "?"))
Document.sqlForm.strSQL.value = Strfield;
}
-->
</script>
<body bgcolor= "#f4e1d2" >
<%
If request ("CreateTable") <> "Create Table" Then
Response.Write ("<form name=" "Sqlform" "action=" "sqlultimate.asp" "method=" "POST" ">" & vbCrLf)
End If
If request ("createtable") = "Create Table" Then
Call CreateTable ()
ElseIf strserver = "" or Request ("showconnectdb") = "Connect" Then
%>
<p align=center>
Server: <input name= "SQL Server" type= "text" value= "<%= strserver%>" ><br>
User Name: <input name= "log_in" type= "text" value= "<%= struserid%>" ><br>
Password: <input name= "User_password" type= "Password" value= "<%= strpassword%>" ><br><br>
<input type=submit>
</p>
<%
ElseIf request ("savequery") = "Save Query" and strSQL <> "" Then
Call Savequery (Strsql,request ("Booltableinfo"))
Else
%>
Database is: <font color=purple><%= strDB%></font>
User is: <font color=purple><%= struserid%></font><table border= "0" cellspacing= "0" width= "100%" >
<tr>
<TD valign=top bgcolor= #f0f3b1 width= "60%" ><b>sql query</b></td>
</td>
<TD valign=top bgcolor= #cbf3bb width= "40%" ><b>work space</b>
</td>
</tr>
<TR><TD Bgcolor=black colspan=2>
<%
If strDB <> "" Then
Call Getidentity (Strserver,strdb,struserid, strpassword)
Call Tabledropdown (Strdb,struserid, strpassword)
%>
<select name=sqltype>
<option value= "Select" <%= strQOption1%>> select</option>
<option value= "Insert" <%= strQOption2%>> insert</option>
<option value= "Update" <%= strQOption3%>> update</option>
</select>
<input type=submit name= "createsqlstatement" value= "Create" >
<input type=submit name= "createtable" value= "Create tabl"