Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1378 connectés 

  FORUM HardWare.fr
  Programmation
  ASP

  Problème de connexion Access

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Problème de connexion Access

n°1068418
kikidonc
Posté le 02-05-2005 à 09:51:38  profilanswer
 

Bonjour :hello:  
 
J'y connais que dalle en asp, et j'essaie de me connecter à une base access avec le lien DSN.
 
Ca marche bien 1 fois, mais dès que je rafraichi la page ca me fait une erreur et je suis obligé d'attendre qqs minutes pour que ca revienne  [:tt_olimou_tt]  
 
Où est-ce que j'ai bien pu oublier qqchose ? [:gratgrat]
 
Voila l'erreur :
 

Erreur de compilation Microsoft VBScript error '800a0401'
 
Fin d'instruction attendue
 
/iisHelp/common/500-100.asp, line 11
 
Dim objASPError, blnErrorWritten, strServername, strServerIP, strRemoteIP Dim strMethod, lngPos, datNow, strQueryString, strURL
--------------------------------------------------------------------------^
 
Provider error '80004005'
 
Erreur non spécifiée
 
/monsite/include/connexion.asp, line 5


Message édité par kikidonc le 02-05-2005 à 10:46:04
mood
Publicité
Posté le 02-05-2005 à 09:51:38  profilanswer
 

n°1068497
FlorentG
Unité de Masse
Posté le 02-05-2005 à 10:47:35  profilanswer
 

Y'a un Dim qui traîne au milieu de la ligne, c'est pas top :/

n°1086790
kikidonc
Posté le 17-05-2005 à 15:46:59  profilanswer
 

up, j'avais réussi a résoudre le pb ché pas comment en trifouillant les options d'iis mais c'est revenu :(
 
Pourtant le code de mon connexion.asp est basique :/
 
<%
Set Conn = Server.CreateObject("ADODB.Connection" )
Conn.Open "hedior"
%>

n°1086814
Flyman30
Posté le 17-05-2005 à 16:09:07  profilanswer
 

Nan c'est le fichier /iisHelp/common/500-100.asp qui est tout buggué  :D  
 
Utilise celui de windows 2000 ou demande moi de te l'envoyer par mail  :)
ou recopie le fichier et enregistre sous le nom : 500-100.asp le dans  windows\help\IIShelp\common  


<% @ language="VBScript" %>
<%
  Option Explicit
  Const lngMaxFormBytes = 200
 
  Dim objASPError, blnErrorWritten, strServername, strServerIP, strRemoteIP
  Dim strMethod, lngPos, datNow, strQueryString, strURL
 
  If Response.Buffer Then
    Response.Clear
    Response.Status = "500 Internal Server Error"
    Response.ContentType = "text/html"
    Response.Expires = 0
  End If
 
  Set objASPError = Server.GetLastError
%>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html dir=ltr>
<head>
<style>
a:link   {font:8pt/11pt verdana; color:FF0000}
a:visited  {font:8pt/11pt verdana; color:#4e4e4e}
</style>
<META NAME="ROBOTS" CONTENT="NOINDEX">
<title>La page ne peut pas être affichée</title>
<META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
</head>
<script>  
function Homepage(){
<!--
// in real bits, urls get returned to our script like this:
// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm  
//For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
DocURL=document.URL;
//this is where the http or https will be, as found by searching for :// but skipping the res://
protocolIndex=DocURL.indexOf("://",4);
//this finds the ending slash for the domain server  
serverIndex=DocURL.indexOf("/",protocolIndex + 3);
//for the href, we need a valid URL to the domain. We search for the # symbol to find the begining  
 //of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
 //urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
 BeginURL=DocURL.indexOf("#",1) + 1;
 urlresult=DocURL.substring(BeginURL,serverIndex);
 //for display, we need to skip after http://, and go to the next slash
 displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);
 InsertElementAnchor(urlresult, displayresult);
     }
function HtmlEncode(text)
{
    return text.replace(/&/g, '&amp').replace(/'/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}
 
function TagAttrib(name, value)
{
    return ' '+name+'="'+HtmlEncode(value)+'"';
}
 
function PrintTag(tagName, needCloseTag, attrib, inner){
    document.write( '<' + tagName + attrib + '>' + HtmlEncode(inner) );
    if (needCloseTag) document.write( '</' + tagName +'>' );
}
 
function URI(href)
{
    IEVer = window.navigator.appVersion;
    IEVer = IEVer.substr( IEVer.indexOf('MSIE') + 5, 3 );
 
    return (IEVer.charAt(1)=='.' && IEVer >= '5.5') ?
        encodeURI(href) :
        escape(href).replace(/%3A/g, ':').replace(/%3B/g, ';');
}
 
function InsertElementAnchor(href, text)
{
    PrintTag('a', true, TagAttrib('href', uri(href)), text);
}
//-->
</script>
<body bgcolor="FFFFFF">
<table width="410" cellpadding="3" cellspacing="5">
  <tr>    
    <td align="left" valign="middle" width="360">
 <h1 style="COLOR:000000; FONT: 13pt/15pt verdana"><!--Problem-->La page ne peut pas être affichée</h1>
    </td>
  </tr>
  <tr>
    <td width="400" colspan="2">
 <font style="COLOR:000000; FONT: 8pt/11pt verdana">Un problème affecte la page que vous essayez d'obtenir et elle ne peut pas être affichée.</font></td>
  </tr>
  <tr>
    <td width="400" colspan="2">
 <font style="COLOR:000000; FONT: 8pt/11pt verdana"><hr color="#C0C0C0" noshade>
    <p>Essayez les opérations suivantes :</p>
 <ul>
      <li id="instructionsText1">Cliquez sur le bouton <a href="javascript:location.reload()">Actualiser</a> ou réessayez plus tard.</li>
      <li>Ouvrez la  
      </script>
      <!--
   if (!((window.navigator.userAgent.indexOf("MSIE" ) > 0) && (window.navigator.appVersion.charAt(0) == "2" )))
   { Homepage(); }
      //-->
   </script>   page d'accueil, puis recherchez les liens vers les informations souhaitées. </li>
    </ul>
    <h2 style="font:8pt/11pt verdana; color:000000">HTTP 500,100 – Erreur interne au serveur – Erreur ASP <br> Services Internet (IIS)</h2>
 <hr color="#C0C0C0" noshade>
 <p>Informations techniques (destinées au personnel du Support technique)</p>
<ul>
<li><strong>Type d'erreur :<br>  
<% Dim bakCodepage  
on error resume next  
 bakCodepage = Session.Codepage  
 Session.Codepage = 1252  
on error goto 0  
 Response.Write Server.HTMLEncode(objASPError.Category)  
  If objASPError.ASPCode > "" Then  
   Response.Write Server.HTMLEncode(", " & objASPError.ASPCode)  
   Response.Write Server.HTMLEncode(" (0x" & Hex(objASPError.Number) & " )" ) & "<br>"
  end if
  If objASPError.ASPDescription > "" Then  
   Response.Write objASPError.ASPDescription & "<br>"
  end if
  If objASPError.ASPDescription > "" Then  
   Response.Write objASPError.ASPDescription & "<br>"
  blnErrorWritten = False
  end if
   
  ' Only show the Source if it is available and the request is from the same machine as IIS  
    If objASPError.Source > "" Then  
   strServername = LCase(Request.ServerVariables("SERVER_NAME" ))  
   strServerIP = Request.ServerVariables("LOCAL_ADDR" )  
   strRemoteIP =  Request.ServerVariables("REMOTE_ADDR" )  
  end if
  If (strServername = "localhost" Or strServerIP = strRemoteIP) And objASPError.File <> "?" Then  
   Response.Write Server.HTMLEncode(objASPError.File)
  end if
  If objASPError.Line > 0 Then  
   Response.Write ", line " & objASPError.Line
  end if
  If objASPError.Column > 0 Then  
   Response.Write ", column " & objASPError.Column  
   Response.Write "<br>"  
   Response.Write "<font style=""COLOR:000000; FONT: 8pt/11pt courier new""><b>"  
   Response.Write Server.HTMLEncode(objASPError.Source) & "<br>"  
  end if
  If objASPError.Column > 0 Then  
   Response.Write String((objASPError.Column - 1), "-" ) & "^<br>"  
   Response.Write "</b></font>"  
   blnErrorWritten = True  
  End If  
  If Not blnErrorWritten And objASPError.File <> "?" Then  
   Response.Write "<b>" & Server.HTMLEncode(  objASPError.File)
  end if
  If objASPError.Line > 0 Then  
   Response.Write Server.HTMLEncode(", line " & objASPError.Line)  
  end if
  If objASPError.Column > 0 Then  
   Response.Write ", column " & objASPError.Column  
   Response.Write "</b><br>"  
  End If %>
</li>
<p>
<li>Type de navigateur :<br> <%= Request.ServerVariables("HTTP_USER_AGENT" ) %></li></p>
<p>
<li>Page :<br>  
<% strMethod = Request.ServerVariables("REQUEST_METHOD" )
 Response.Write strMethod & " "
 If strMethod = "POST" Then  
  Response.Write Request.TotalBytes & " octets à "  
 End If
  Response.Write Request.ServerVariables("SCRIPT_NAME" )
  lngPos = InStr(Request.QueryString, "|" )
 If lngPos > 1 Then  
  Response.Write "?" & Left(Request.QueryString, (lngPos - 1))  
 End If
  Response.Write "</li>"
 If strMethod = "POST" Then  
  Response.Write "<p><li>POST Data:<br>"  
 If Request.TotalBytes > lngMaxFormBytes Then  
  Response.Write Server.HTMLEncode(Left(Request.Form, lngMaxFormBytes)) & " . . ."  
 Else  
  Response.Write Server.HTMLEncode(Request.Form)  
 End If  
  Response.Write "</li>"  
 End If
%></p>
<p>
<li>Heure :<br>  
<% datNow = Now()
  Response.Write Server.HTMLEncode(FormatDateTime(datNow, 1) & ", " & FormatDateTime(datNow, 3))  
  on error resume next  
  Session.Codepage = bakCodepage  
  on error goto 0  
%>
</li>
</p>
<p>
<li>Plus d'informations :<br>  
<%  strQueryString = "prd=iis&sbp=&pver=5.0&ID=500;100&cat=" & Server.URLEncode(objASPError.Category) & _  
"&os=&over=&hrd=&Opt1=" & Server.URLEncode(objASPError.ASPCode)  & "&Opt2=" & Server.URLEncode(objASPError.Number) & _  
"&Opt3=" & Server.URLEncode(objASPError.Description) & strURL = "http://www.microsoft.com/ContentRedirect.asp?" & _  
strQueryString %>  
<a href="<%= strURL %>">Support technique Microsoft</a>
</li>
</p>
    </font></td>
  </tr>
</table>
</body>
</html>


Message édité par Flyman30 le 17-05-2005 à 16:13:11

---------------
planuldep | Association pêche à la Sempé
n°1086834
kikidonc
Posté le 17-05-2005 à 16:17:53  profilanswer
 

Il a pas beucoups aimé le Copier/coller :/
 
Si tu peux me l'envoyer que j'essai :)
 
j'te mp mon email

n°1086837
azzz
Posté le 17-05-2005 à 16:19:39  profilanswer
 

essaie de faire ce que j'ai fais:
 
http://forum.hardware.fr/hardwaref [...] 9887-1.htm
 
sinon tu as peut-etre oublié de fermer la connection à la base?
 

Code :
  1. Set RS=Nothing
  2. Conn.Close
  3. Set Conn=Nothing

n°1086844
kikidonc
Posté le 17-05-2005 à 16:25:19  profilanswer
 

Je ferme bien la connection, mais rien y fait :(
 
Je vais regarder de plus pret comment tu as fait

n°1086908
kikidonc
Posté le 17-05-2005 à 16:57:58  profilanswer
 

Voila le nouveau msg d'erreur avec le 500-100.asp de 2000
 

HTTP 500,100 – Erreur interne au serveur – Erreur ASP  
Services Internet (IIS)
 
--------------------------------------------------------------------------------
 
Informations techniques (destinées au personnel du Support technique)
 
Type d'erreur :
Provider/test/include/connexion.asp, line 5/test/include/connexion.asp, line 5  
 
Type de navigateur :
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; iebar; .NET CLR 1.1.4322)
 
 
Page :
GET /test/index.asp

n°1086966
azzz
Posté le 17-05-2005 à 17:15:48  profilanswer
 

kikidonc a écrit :


Type d'erreur :
Provider/test/include/connexion.asp, line 5/test/include/connexion.asp, line 5  


 
y'a quoi à la ligne 5?  :??:

n°1086967
kikidonc
Posté le 17-05-2005 à 17:16:27  profilanswer
 

azzz a écrit :

y'a quoi à la ligne 5?  :??:


 
 
<%
' Création de l'objet permettant la connexion
Set Conn = Server.CreateObject("ADODB.Connection" )
' Connexion
Conn.Open "test"
%>
 
 
Et test est bien mon lien DSN

mood
Publicité
Posté le 17-05-2005 à 17:16:27  profilanswer
 

n°1086968
Flyman30
Posté le 17-05-2005 à 17:16:46  profilanswer
 

Montre voir ta page index.asp et ton fichier connexion.asp


---------------
planuldep | Association pêche à la Sempé
n°1087007
kikidonc
Posté le 17-05-2005 à 17:30:02  profilanswer
 

Mon connexion.asp c'est juste au dessus.
 
Voila la partie asp de ma page index.asp, le code html on s'en fou j'crois :ange:
 
 

<%@ LANGUAGE=VBScript%>
<!-- #include file="./include/connexion.asp"-->
 
<%
Dim Numero
Dim Contenu
Dim Rubrique
Dim NumeroDeRubrique
Rubrique = Request.QueryString("RUB" )
Sub RecupereRubrique(NumeroDeRubrique)
if NumeroDeRubrique="" then NumeroDeRubrique=1
 Set RS = Server.CreateObject("ADODB.RecordSet" )
 sql="SELECT * FROM [CONTENU] where Num=" & NumeroDeRubrique
 RS.Open sql,Conn , 3, 3
 Numero=RS("Num" )
 Contenu=RS("Contenu" )
 for a=1 to RS.RecordCount
 RS.Movenext
next
RS.Close
End Sub
RecupereRubrique Rubrique
Set RS=Nothing
Conn.Close
Set Conn=Nothing
%>
<html>
<head>
....
 


 
Ca fait 2 jours que je découvre l'asp :D

n°1087024
azzz
Posté le 17-05-2005 à 17:39:41  profilanswer
 

kikidonc a écrit :


 for a=1 to RS.RecordCount
   RS.Movenext
        next


 
y'a pas autre chose dans ta boucle for?

n°1087028
kikidonc
Posté le 17-05-2005 à 17:41:57  profilanswer
 

azzz a écrit :

y'a pas autre chose dans ta boucle for?


heu ben non :/
 
Y'a des trucs que j'peux virer &/ou ajouter ?

n°1087034
Flyman30
Posté le 17-05-2005 à 17:45:20  profilanswer
 

pourquoi :
 

./include/connexion.asp

ça devrais être

../include/connexion.asp


 
ensuite pourquoi des crochets autour du nom de la base de données et des erreur de syntaxe avec les apostrophes ??  
 

"SELECT * FROM [CONTENU] where Num=" & NumeroDeRubrique


---------------
planuldep | Association pêche à la Sempé
n°1087056
kikidonc
Posté le 17-05-2005 à 17:56:58  profilanswer
 

Pour le chemin il est bon,
Ensuite la syntaxe, je sais pas vraiment où sont mes erreur des syntaxes.
 
En fait, chaque page s'affiche correctemement, puis quand je clic sur un autre lien j'ai l'erreur, et puis je dois attendre qqs temps (1mins ptete) avant de ré-afficher une autre page.


Message édité par kikidonc le 17-05-2005 à 17:57:09

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  ASP

  Problème de connexion Access

 

Sujets relatifs
Activé / désactivé connexion réseau local[WiP PHP/CSS] 3 Mars: Problème de marge CSS
[Access 2003] Sélection multiplepetit probleme de JScrollPane
[CSS] 'overflow' et firefox 1.0.3 = problèmeProblème shell d'un débutant HELP!
problème SQL moteur de recherche[resolu] ie - probleme avec l'ascenseur vertical
Problème sur livre d'or de mon siteProblème de connexion entre SQL Server et une base mixte Access/SQL
Plus de sujets relatifs à : Problème de connexion Access


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR