<%@ LANGUAGE = VBScript.Encode %>
<% ' Except for @ commands, there should be no ASP or HTML codes above this line
' Setting LANGUAGE = VBScript.Encode enables mixing of encoded and unencoded ASP scripts
'1 Click DB Free copyright 1997-2003 David Kawliche, AccessHelp.net
'1 Click DB Free source code is protected by international
'laws and treaties. Never use, distribute, or redistribute
'any software and/or source code in violation of its licensing.
'See License.txt for Open Source License
'More info online at http://1ClickDB.com/
'Email inquiries to info@1ClickDB.com
'**Start Encode**
%>
<!--#INCLUDE FILE=FreeInit.asp-->
<%
Dim strConnectReturn, strDisConnectReturn, strSourceContext,strAC, strAU, strAP, strCM, strConnectCaption
Sub setConnectionInfo(ByVal strAction, ByVal strConnect, ByVal strUser, ByVal strPass, ByVal strCompatibility)
Select Case UCase(strAction)
Case "CONNECT"
Session("ocdCompatibility") = strCompatibility
Session("ocdSQLConnect") = strConnect
Session("ocdSQLUser") = strUser
Session("ocdSQLPass") = strPass
Response.Clear()
Response.Redirect(strConnectReturn)
Case "DISCONNECT"
Session("ocdCompatibility") = strCompatibility
Session("ocdSQLConnect") = ""
Session("ocdSQLUser") = ""
Session("ocdSQLPass") = ""
Response.Clear()
Response.Redirect(strDisconnectReturn)
End Select
End Sub
strConnectReturn = "FreeSchema.asp"
strDisConnectReturn = "FreeConnect.asp?nocache=" & server.urlencode(Cstr(now))
If ocdADOConnection <> "" Then
Response.Redirect(strConnectReturn)
End If
strAC = Session("ocdSQLConnect")
strAU = Session("ocdSQLUser")
strAP = Session("ocdSQLPass")
Select Case UCASE(Request("Action"))
Case "CONNECT"
If Request("connect") <> "" Then
ndnscSQLConnect = Request("connect")
End If
If ndnscSQLConnect <> "" Then
ndnscSQLUser = Request("user")
ndnscSQLPass = Request("pass")
ndnscCompatibility = 0
If Request("UseTreemenu") = "" Then
ndnscCompatibility = ndnscCompatibility + ocdNoFrames
End If
' If Request("noframes") <> "" Then
' ndnscCompatibility = ndnscCompatibility + ocdNoFrames
' End If
' If Request("nojavascript") <> "" Then
' ndnscCompatibility = ndnscCompatibility + ocdNoJavaScript
' End If
' If Not CBOOL((ndnscCompatibility And ocdNoCookies)) Then
Call setConnectionInfo ("Connect", ndnscSQLConnect, ndnscSQLUser, ndnscSQLPass,ndnscCompatibility)
' End If
End If
Case "DISCONNECT"
Call setConnectionInfo ("Disconnect",ndnscSQLConnect,ndnscSQLUser,ndnscSQLPass,ndnscCompatibility)
End Select
strConnectCaption = strConnectCaption & (" Connectando a Base de Dados ")
Call WriteHeader("")
Response.Write("<center>")
Response.Write(DrawDialogBox("DIALOG_START",strConnectCaption, ""))
Response.Write("<form method=""post"" action=""")
Response.Write(Request.ServerVariables("SCRIPT_NAME"))
Response.Write("""><table class=""DialogBoxRow""><tr class=""DialogBoxRow""><td valign=""top"" nowrap><span class=""FieldName"">Exemplo: Nã utilize ASPAS"": </span><br><small>Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\caminho\database\bd.mdb</td></tr></table>")
Response.Write("""<table class=""DialogBoxRow""><tr class=""DialogBoxRow""><td valign=""top"" nowrap><span class=""FieldName"">String de conexão: </span><br><small>(Acesso ao bando de dados)</small><p></td><td valign=""top""><br><textarea name=""connect"" rows=""2"" cols=""35"">")
If strAC <> "" Then
Response.Write(Server.HTMLEncode(strAC))
End If
Response.Write("</textarea></td></tr><tr class=""DialogBoxRow""><td valign=""top"" align=""left""><span class=""FieldName"">Usuário:</span></td><td valign=""bottom"" align=""left""><input type=""text"" class=""ConnectInput"" name=""user"" size=""35"" maxlength=""255"" value=""")
If Request("user") <> "" Then
Response.Write(server.htmlencode(request("user")))
Elseif Request("datasource") = "" Then
Response.Write(server.htmlencode(strAU))
End If
Response.Write("""></td></tr><tr class=""DialogBoxRow""><td align=""left"" valign=""top""><span class=""FieldName"">Password:</span></td><td align=""left"" valign=""bottom""><input class=""ConnectInput"" type=""Password"" name=""pass"" size=""35"" maxlength=""255"" value=""")
If request("pass") <> "" Then
Response.Write(server.htmlencode(Request("pass")))
Elseif request("datasource") = "" Then
Response.Write(server.htmlencode(strAP))
End If
Response.Write("""></td></tr><tr class=""DialogBoxRow""><td colspan=""2"" valign=""top""><p><input type=""hidden"" name=""ocdCSSFix""><input type=""submit"" name=""Action"" class=""submit"" value=""Connect"">")
If strAC <> "" and request("datasource") = "" Then
Response.Write("<input type=""submit"" class=""Submit"" name=""Action"" value=""Disconnect"">")
End If
Response.Write(" ")
Response.Write("<input type=""checkbox"" name=""UseTreeMenu""")
If Not (CBool(ndnscCompatibility And ocdNoFrames) or CBool(ndnscCompatibility And ocdNoJavaScript)) Then
Response.write(" checked")
End If
Response.write(">Use TreeMenu")
'Response.Write("<img src=""appHelpSmall.gif"" border=""0"" alt=""Help""> <a href=""http://1clickdb.com/content/view.aspx?_@id=53416"">Online Help</a>")
Response.Write("</td></tr></table>")
Response.Write("</form>")
Response.Write(DrawDialogBox("DIALOG_END", "", ""))
Response.Write("</center>")
%>