voithia me to anigma .asp se browser

Πληροφορίες σχετικές με την ASP, ASP.NET και με τις εφαρμογές που είναι γραμμένες με αυτήν.

Συντονιστές: WebDev Moderators, Super-Moderators

Απάντηση
Άβαταρ μέλους
apoel
Δημοσιεύσεις: 350
Εγγραφή: 18 Ιούλ 2005 23:46
Επικοινωνία:

voithia me to anigma .asp se browser

Δημοσίευση από apoel » 19 Αύγ 2005 06:40

pedia giati otan kano save ena file se .asp ke epita pao na to anixo me ena browser den mou to anigi? dokimasa 4 browsers

Άβαταρ μέλους
agrippas
Script Master
Δημοσιεύσεις: 494
Εγγραφή: 18 Ιούλ 2002 14:52
Τοποθεσία: Υπερπέραν
Επικοινωνία:

voithia me to anigma .asp se browser

Δημοσίευση από agrippas » 19 Αύγ 2005 06:49

Έχει απαντηθεί αλλά θα το ξαναπώ.

ASP = Active Server Pages. No server = No pages.

Μην περιμένεις δηλαδή με το που θα κάνεις doubleclick να εκτελεστεί ο asp κώδικας και να σου γυρίσει η σελίδα. Αυτά γίνονται με ειδική μέθοδο. Όπερ:

- Χρειάζεσαι τον Server. Για Windows χρειάζεσαι τον IIS που συνοδεύει το λειτουργικό.

- Ξεκινάς τον IIS και τον ρυθμίζεις κατάλληλα.

- Μετακινείς το asp αρχείο στο c:\inetpub\wwwroot και μετά γράφεις στο browser σου http://localhost/filename.asp και το βλέπεις.

Άβαταρ μέλους
apoel
Δημοσιεύσεις: 350
Εγγραφή: 18 Ιούλ 2005 23:46
Επικοινωνία:

voithia me to anigma .asp se browser

Δημοσίευση από apoel » 19 Αύγ 2005 07:07

Afta ta exo idi kani. mou emfanizi omos


The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.

--------------------------------------------------------------------------------

Please try the following:

Click the Refresh button, or try again later.

Open the localhost home page, and then look for links to the information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Active Server Pages, ASP 0141 (0x80004005)
The @ command can only be used once within the Active Server Page.
/antonis.asp, line 165


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Charter B1)

Page:
GET /antonis.asp

Time:
Thursday, August 18, 2005, 11:30:20 PM


More information:
Microsoft Support



ke otan to kano upload sto brinkster ke meta grafo tin diefthinsi pou kanonika eprepe na mou anigi tin selida mou grafi


Active Server Pages error 'ASP 0126'

Include file not found

/stmaryschool/antonis.asp, line 2

The include file 'Connections/antoniskartapanis.asp' was not found.

Άβαταρ μέλους
apoel
Δημοσιεύσεις: 350
Εγγραφή: 18 Ιούλ 2005 23:46
Επικοινωνία:

voithia me to anigma .asp se browser

Δημοσίευση από apoel » 19 Αύγ 2005 07:21

An katalava kala exi provlima i grammi 165, ti provlima omos den katalava. o code pou xrisimopiisa ine

Κώδικας: Επιλογή όλων

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/antoniskartapanis.asp" -->
<%
' *** Edit Operations&#58; declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr&#40;Request.ServerVariables&#40;"SCRIPT_NAME"&#41;&#41;
If &#40;Request.QueryString <> ""&#41; Then
  MM_editAction = MM_editAction & "?" & Server.HTMLEncode&#40;Request.QueryString&#41;
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>
<%
' *** Redirect if username exists
MM_flag="MM_insert"
If &#40;CStr&#40;Request&#40;MM_flag&#41;&#41; <> ""&#41; Then
  MM_dupKeyRedirect="help.gif"
  MM_rsKeyConnection=MM_antoniskartapanis_STRING
  MM_dupKeyUsernameValue = CStr&#40;Request.Form&#40;"UserName"&#41;&#41;
  MM_dupKeySQL="SELECT UserName FROM Table1 WHERE UserName='" & MM_dupKeyUsernameValue & "'"
  MM_adodbRecordset="ADODB.Recordset"
  set MM_rsKey=Server.CreateObject&#40;MM_adodbRecordset&#41;
  MM_rsKey.ActiveConnection=MM_rsKeyConnection
  MM_rsKey.Source=MM_dupKeySQL
  MM_rsKey.CursorType=0
  MM_rsKey.CursorLocation=2
  MM_rsKey.LockType=3
  MM_rsKey.Open
  If Not MM_rsKey.EOF Or Not MM_rsKey.BOF Then 
    ' the username was found - can not add the requested username
    MM_qsChar = "?"
    If &#40;InStr&#40;1,MM_dupKeyRedirect,"?"&#41; >= 1&#41; Then MM_qsChar = "&"
    MM_dupKeyRedirect = MM_dupKeyRedirect & MM_qsChar & "requsername=" & MM_dupKeyUsernameValue
    Response.Redirect&#40;MM_dupKeyRedirect&#41;
  End If
  MM_rsKey.Close
End If
%>
<%
' *** Insert Record&#58; set variables

If &#40;CStr&#40;Request&#40;"MM_insert"&#41;&#41; = "form1"&#41; Then

  MM_editConnection = MM_antoniskartapanis_STRING
  MM_editTable = "Table1"
  MM_editRedirectUrl = "index.htm"
  MM_fieldsStr  = "UserName|value|Password|value|Name|value|Surname|value|Email|value"
  MM_columnsStr = "UserName|',none,''|Password|',none,''|FirstName|',none,''|LastName|',none,''|Email|',none,''"

  ' create the MM_fields and MM_columns arrays
  MM_fields = Split&#40;MM_fieldsStr, "|"&#41;
  MM_columns = Split&#40;MM_columnsStr, "|"&#41;
  
  ' set the form values
  For MM_i = LBound&#40;MM_fields&#41; To UBound&#40;MM_fields&#41; Step 2
    MM_fields&#40;MM_i+1&#41; = CStr&#40;Request.Form&#40;MM_fields&#40;MM_i&#41;&#41;&#41;
  Next

  ' append the query string to the redirect URL
  If &#40;MM_editRedirectUrl <> "" And Request.QueryString <> ""&#41; Then
    If &#40;InStr&#40;1, MM_editRedirectUrl, "?", vbTextCompare&#41; = 0 And Request.QueryString <> ""&#41; Then
      MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
    Else
      MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    End If
  End If

End If
%>
<%
' *** Insert Record&#58; construct a sql insert statement and execute it

Dim MM_tableValues
Dim MM_dbValues

If &#40;CStr&#40;Request&#40;"MM_insert"&#41;&#41; <> ""&#41; Then

  ' create the sql insert statement
  MM_tableValues = ""
  MM_dbValues = ""
  For MM_i = LBound&#40;MM_fields&#41; To UBound&#40;MM_fields&#41; Step 2
    MM_formVal = MM_fields&#40;MM_i+1&#41;
    MM_typeArray = Split&#40;MM_columns&#40;MM_i+1&#41;,","&#41;
    MM_delim = MM_typeArray&#40;0&#41;
    If &#40;MM_delim = "none"&#41; Then MM_delim = ""
    MM_altVal = MM_typeArray&#40;1&#41;
    If &#40;MM_altVal = "none"&#41; Then MM_altVal = ""
    MM_emptyVal = MM_typeArray&#40;2&#41;
    If &#40;MM_emptyVal = "none"&#41; Then MM_emptyVal = ""
    If &#40;MM_formVal = ""&#41; Then
      MM_formVal = MM_emptyVal
    Else
      If &#40;MM_altVal <> ""&#41; Then
        MM_formVal = MM_altVal
      ElseIf &#40;MM_delim = "'"&#41; Then  ' escape quotes
        MM_formVal = "'" & Replace&#40;MM_formVal,"'","''"&#41; & "'"
      Else
        MM_formVal = MM_delim + MM_formVal + MM_delim
      End If
    End If
    If &#40;MM_i <> LBound&#40;MM_fields&#41;&#41; Then
      MM_tableValues = MM_tableValues & ","
      MM_dbValues = MM_dbValues & ","
    End If
    MM_tableValues = MM_tableValues & MM_columns&#40;MM_i&#41;
    MM_dbValues = MM_dbValues & MM_formVal
  Next
  MM_editQuery = "insert into " & MM_editTable & " &#40;" & MM_tableValues & "&#41; values &#40;" & MM_dbValues & "&#41;"

  If &#40;Not MM_abortEdit&#41; Then
    ' execute the insert
    Set MM_editCmd = Server.CreateObject&#40;"ADODB.Command"&#41;
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    If &#40;MM_editRedirectUrl <> ""&#41; Then
      Response.Redirect&#40;MM_editRedirectUrl&#41;
    End If
  End If

End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject&#40;"ADODB.Recordset"&#41;
Recordset1.ActiveConnection = MM_antoniskartapanis_STRING
Recordset1.Source = "SELECT Table1.*  FROM Table1;  "
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open&#40;&#41;

Recordset1_numRows = 0
%>
<%@ Page Language="VB" ContentType="text/html" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM&#58;Insert
runat="server"
CommandText='<%# "INSERT INTO Antonis &#40;Name, Surname, UserEmail, UserName, UserPassword&#41; VALUES &#40;?, ?, ?, ?, ?&#41;" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings&#40;"MM_CONNECTION_STRING_antonis"&#41; %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings&#40;"MM_CONNECTION_DATABASETYPE_antonis"&#41; %>'
Expression='<%# Request.Form&#40;"MM_insert"&#41; = "form1" %>'
CreateDataSet="false"
SuccessURL='<%# "index.htm" %>'
Debug="true"
>
  <Parameters>
    <Parameter Name="@Name" Value='<%# IIf&#40;&#40;Request.Form&#40;"Name"&#41; <> Nothing&#41;, Request.Form&#40;"Name"&#41;, ""&#41; %>' Type="WChar" />
    <Parameter Name="@Surname" Value='<%# IIf&#40;&#40;Request.Form&#40;"Surname"&#41; <> Nothing&#41;, Request.Form&#40;"Surname"&#41;, ""&#41; %>' Type="WChar" />
    <Parameter Name="@UserEmail" Value='<%# IIf&#40;&#40;Request.Form&#40;"Email"&#41; <> Nothing&#41;, Request.Form&#40;"Email"&#41;, ""&#41; %>' Type="WChar" />
    <Parameter Name="@UserName" Value='<%# IIf&#40;&#40;Request.Form&#40;"UserName"&#41; <> Nothing&#41;, Request.Form&#40;"UserName"&#41;, ""&#41; %>' Type="WChar" />
    <Parameter Name="@UserPassword" Value='<%# IIf&#40;&#40;Request.Form&#40;"Password"&#41; <> Nothing&#41;, Request.Form&#40;"Password"&#41;, ""&#41; %>' Type="WChar" />
  </Parameters>
</MM&#58;Insert>
<MM&#58;PageBind runat="server" PostBackBind="true" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http&#58;//www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj&#40;n, d&#41; &#123; //v4.01
  var p,i,x;  if&#40;!d&#41; d=document; if&#40;&#40;p=n.indexOf&#40;"?"&#41;&#41;>0&&parent.frames.length&#41; &#123;
    d=parent.frames&#91;n.substring&#40;p+1&#41;&#93;.document; n=n.substring&#40;0,p&#41;;&#125;
  if&#40;!&#40;x=d&#91;n&#93;&#41;&&d.all&#41; x=d.all&#91;n&#93;; for &#40;i=0;!x&&i<d.forms.length;i++&#41; x=d.forms&#91;i&#93;&#91;n&#93;;
  for&#40;i=0;!x&&d.layers&&i<d.layers.length;i++&#41; x=MM_findObj&#40;n,d.layers&#91;i&#93;.document&#41;;
  if&#40;!x && d.getElementById&#41; x=d.getElementById&#40;n&#41;; return x;
&#125;

function MM_validateForm&#40;&#41; &#123; //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for &#40;i=0; i<&#40;args.length-2&#41;; i+=3&#41; &#123; test=args&#91;i+2&#93;; val=MM_findObj&#40;args&#91;i&#93;&#41;;
    if &#40;val&#41; &#123; nm=val.name; if &#40;&#40;val=val.value&#41;!=""&#41; &#123;
      if &#40;test.indexOf&#40;'isEmail'&#41;!=-1&#41; &#123; p=val.indexOf&#40;'@'&#41;;
        if &#40;p<1 || p==&#40;val.length-1&#41;&#41; errors+='- '+nm+' must contain an e-mail address.\n';
      &#125; else if &#40;test!='R'&#41; &#123; num = parseFloat&#40;val&#41;;
        if &#40;isNaN&#40;val&#41;&#41; errors+='- '+nm+' must contain a number.\n';
        if &#40;test.indexOf&#40;'inRange'&#41; != -1&#41; &#123; p=test.indexOf&#40;'&#58;'&#41;;
          min=test.substring&#40;8,p&#41;; max=test.substring&#40;p+1&#41;;
          if &#40;num<min || max<num&#41; errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    &#125; &#125; &#125; else if &#40;test.charAt&#40;0&#41; == 'R'&#41; errors += '- '+nm+' is required.\n'; &#125;
  &#125; if &#40;errors&#41; alert&#40;'The following error&#40;s&#41; occurred&#58;\n'+errors&#41;;
  document.MM_returnValue = &#40;errors == ''&#41;;
&#125;
//-->
</script>
</head>

<body>
<p><strong>Registation Form</strong></p>
<form runat='server' name='form1' method='POST' action="<%=MM_editAction%>">
  <div align="left">
    <table width="90%" border="0" cellpadding="8">
      <tr style="vertical-align&#58; top">
        <td width="15%" nowrap class="LabelColor" style="text-align&#58; right"><div align="left">
            <label for="username"> User Name</label>
        </div></td>
        <td width="85%" colspan="2" class="TitleColor">&nbsp;
            <input type="text" id="username" name="UserName">
            <br>
        </td>
      </tr>
      <tr style="vertical-align&#58; top">
        <td style="text-align&#58; right" class="LabelColor"><div align="left">
            <label for="password"> Password</label>
        </div></td>
        <td colspan="2" class="TitleColor">&nbsp;
            <input type="password" id="password" name="Password">
        </td>
      </tr>
    </table>
  </div>
  <table width="90%" border="0" cellpadding="8">
    <tr style="vertical-align&#58; top">
      <td style="text-align&#58; right" class="LabelColor"><div align="left">Name</div></td>
      <td width="43%" class="TitleColor"><label for="first">First&#58; </label>
          <input type="text" id="first" name="Name">
      </td>
      <td width="46%" class="TitleColor"><label for="last">Last&#58; </label>
          <input type="text" id="last" name="Surname">
      </td>
    </tr>
    <tr style="vertical-align&#58; top">
      <td style="text-align&#58; right" class="LabelColor"><div align="left">
          <label for="email"> Email</label>
      </div></td>
      <td colspan="2" class="TitleColor">&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <input type="text" id="email" name="Email" size="50">
      </td>
    </tr>
  </table>
  <p align="left">
    <input name="Submit" type="submit" onClick="MM_validateForm&#40;'username','','R','first','','R','last','','R','email','','RisEmail','password','','R'&#41;;return document.MM_returnValue" value="Submit">
  </p>
  <input type="hidden" name="MM_insert" value="form1">
</form>
<p>&nbsp; </p>
</body>
</html>
<%
Recordset1.Close&#40;&#41;
Set Recordset1 = Nothing
%>

Άβαταρ μέλους
agrippas
Script Master
Δημοσιεύσεις: 494
Εγγραφή: 18 Ιούλ 2002 14:52
Τοποθεσία: Υπερπέραν
Επικοινωνία:

voithia me to anigma .asp se browser

Δημοσίευση από agrippas » 19 Αύγ 2005 08:25

apoel έγραψε:Error Type:
Active Server Pages, ASP 0141 (0x80004005)
The @ command can only be used once within the Active Server Page.
/antonis.asp, line 165
Ορίστε το σφάλμα. Έχεις βάλει πολλές φορές στην ίδια σελίδα το @! Και κάτι ακόμα: Τι κώδικας είναι αυτός; Δε διαβάζεται! Πύραυλο απογειώνει;

Άβαταρ μέλους
apoel
Δημοσιεύσεις: 350
Εγγραφή: 18 Ιούλ 2005 23:46
Επικοινωνία:

voithia me to anigma .asp se browser

Δημοσίευση από apoel » 19 Αύγ 2005 08:37

gia ton kodika as ine kala to dreamweaver!

Άβαταρ μέλους
apoel
Δημοσιεύσεις: 350
Εγγραφή: 18 Ιούλ 2005 23:46
Επικοινωνία:

voithia me to anigma .asp se browser

Δημοσίευση από apoel » 19 Αύγ 2005 20:07

to ekana xana apo tin arxi. tora mou to emfanizi mia xara otan to anigo apo to computer mou alla otan to perno sto internet ke pao na to do mou grafi

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/stmaryschool/register.asp, line 130




o kodikos tis gramis 130 ine


Recordset1.ActiveConnection = MM_antoniskartapanis_STRING


pou ine to lathos?

Άβαταρ μέλους
agrippas
Script Master
Δημοσιεύσεις: 494
Εγγραφή: 18 Ιούλ 2002 14:52
Τοποθεσία: Υπερπέραν
Επικοινωνία:

voithia me to anigma .asp se browser

Δημοσίευση από agrippas » 19 Αύγ 2005 20:16

Δεν είναι σωστό (ή δεν υπάρχει καθόλου) το path για τη database σου και ο driver.

http://www.google.com/search?q=asp+connection+string

Άβαταρ μέλους
apoel
Δημοσιεύσεις: 350
Εγγραφή: 18 Ιούλ 2005 23:46
Επικοινωνία:

voithia me to anigma .asp se browser

Δημοσίευση από apoel » 19 Αύγ 2005 22:29

afou ta exo perasi ola sto server!!!!!!!

Απάντηση

Επιστροφή στο “ASP, ASP.NET”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 0 επισκέπτες