IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ASP Discussion :

pb de "


Sujet :

ASP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Mai 2004
    Messages
    88
    Détails du profil
    Informations forums :
    Inscription : Mai 2004
    Messages : 88
    Par défaut pb de "
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    strSql3 = "select tNomChamps, tTypeChamps from tblCreationChamps where fIdTable = " & arrTables(iIndex)			
    			objRS3.Open strSql3, objConn, adLockOptimistic, adCmdTable
    J'ai une erreur sur ces lignes, l erreur est :
    Type d'erreur :
    Erreur d'exécution Microsoft VBScript (0x800A01A8)
    Objet requis: ''

  2. #2
    Membre confirmé
    Inscrit en
    Septembre 2003
    Messages
    32
    Détails du profil
    Informations forums :
    Inscription : Septembre 2003
    Messages : 32
    Par défaut
    Fais voir un

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    response.write(arrTables(iIndex))
    Et dis nous ce que ça affiche.

  3. #3
    Membre confirmé
    Inscrit en
    Mai 2004
    Messages
    88
    Détails du profil
    Informations forums :
    Inscription : Mai 2004
    Messages : 88
    Par défaut
    ça affiche 11, c'est un identifiant d'une table en fait !

  4. #4
    Inactif
    Inscrit en
    Juillet 2002
    Messages
    315
    Détails du profil
    Informations forums :
    Inscription : Juillet 2002
    Messages : 315
    Par défaut
    il doit te manquer quelque chose avant ça
    relis ton code et vérifie que tous tes guillemets, quotes, parenthèses, instructions sont fermés

  5. #5
    Membre confirmé
    Inscrit en
    Septembre 2003
    Messages
    32
    Détails du profil
    Informations forums :
    Inscription : Septembre 2003
    Messages : 32
    Par défaut
    Tu a créé l'objet connection avec un
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Server.CreateObject("ADODB.Connection")
    :

  6. #6
    Membre confirmé
    Inscrit en
    Mai 2004
    Messages
    88
    Détails du profil
    Informations forums :
    Inscription : Mai 2004
    Messages : 88
    Par défaut
    Oui j'ai créé l'objet connexion.
    ALors j'ai mis tout mon code en commentaire et j'ai ajouté ligne à ligne. Si je vais jusqu'à la ligne
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    strSql3 = "select tNomChamps, tTypeChamps from tblCreationChamps where fIdTable = " & arrTables(iIndex)
    il n'y a pas d'erreur mais qd je rajoute cette ligne :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    objRS3.Open strSql3, objConn, adLockOptimistic, adCmdTable
    ça me met une erreur, celle du dessus !

  7. #7
    Membre confirmé
    Inscrit en
    Septembre 2003
    Messages
    32
    Détails du profil
    Informations forums :
    Inscription : Septembre 2003
    Messages : 32
    Par défaut
    Non c'est sur, mais peut etre qu'une des variables que tu utilise est mal déclarée/initialisée. (et donc dans le code avant)

  8. #8
    Membre confirmé
    Inscrit en
    Mai 2004
    Messages
    88
    Détails du profil
    Informations forums :
    Inscription : Mai 2004
    Messages : 88
    Par défaut
    Franchement je vois pas Voici tt mon code jusqu'à la ligne concernée, le reste je l'ai mis en commentaire !!
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    <% @Language=VBSCRIPT %>
    <% Option Explicit %>
    <!--#include file = "ConnexionBaseDeDonnees.asp"-->
     
    <HTML>
    <%If Request("autretable")="Yes" Then%>
    	<BODY BgColor="#CCCCFF" Text="#0033FF" Link="#00A0FF" VLink="#00C0FF">
    		<FONT Face="Verdana" Size="4">	
    			<FORM METHOD=POST ACTION="EntreesFormulaire2.asp">
    				Nom de la table : 
    				<INPUT TYPE=TEXT NAME=nomtable size="20">
    				<P>
    				<INPUT TYPE=HIDDEN NAME=idapplication VALUE=<%=Cint(Request("idapplication"))%>>
    				<INPUT TYPE=SUBMIT VALUE="Valider">		
    			</FORM>	
    		</FONT>
    	</BODY>
    <%Else
     
    	'---Définition des constantes---'
    	Const adCmdTable = 2
    	Const adLockOptimistic = 3
    	Dim objRS
    	Dim strSql
    	Dim objRS2
    	Dim strSql2
    	Dim iCurseur
    	Dim iIndex
    	Dim iNbLignes
    	Dim iNbLignes2
    	Dim arrTables
    	Dim arrChamps
     
    	iIndex=0
     
    	'---Création de deux instances d'objet Recordset---'
    	Set objRS = Server.CreateObject("ADODB.Recordset")
    	Set objRS2 = Server.CreateObject("ADODB.Recordset")
    	strSql = "select fIdTable, tNomTable from tblCreationTable where fIdApplication = " & Cint(Request("idapplication"))
    	objRS.Open strSql, objConn, adLockOptimistic, adCmdTable
    	strSql2 = "select count(*) from tblCreationTable where fIdApplication = " & Cint(Request("idapplication"))
    	objRS2.Open strSql2, objConn, adLockOptimistic, adCmdTable
     
    	If objRS2(0) <> "" Then
    		iNbLignes = Cint(objRS2(0))-1
    		Redim arrTables(iNbLignes)
    		Dim strSql3
    		Dim objRS3
    		Dim strSql4
    		Dim objRS4
     
    		objRS.MoveFirst
    		While not objRS.EOF
    			arrTables(iIndex) = objRS.Fields("fIdTable").Value
    			Response.Write arrTables(iIndex)
    			strSql3 = "select tNomChamps, tTypeChamps from tblCreationChamps where fIdTable = " & arrTables(iIndex)			
    			objRS3.Open strSql3, objConn, adLockOptimistic, adCmdTable
    			'strSql4 = "select count(*) from tblCreationChamps where fIdTable = " & arrTables(iIndex)'
    			'objRS4.Open strSql4, objConn, adLockOptimistic, adCmdTable'
    			'If objRS4(0) <> "" Then'
    				'iNbLignes2 = Cint(objRS4(0))-1'
    				'Redim arrChamps(iNbLignes2)'
    				'objRS3.MoveFirst'
    				'iIndex = 0'
    				'objRS3.MoveFirst'
    				'While not objRS3.EOF'
    					'arrChamps(iIndex) = objRS3.Fields("tNomChamps").Value'
     
    					'objRS3.MoveNext'
    					'iIndex = iIndex +1'
    				'Wend'
    				'Dim strSql5'
    				'Dim objConn2'
    				'Set objConn2 = Server.CreateObject("ADODB.Connection")'
    				'objConn2.Open "base_generique"'
    				'strSql5 = "create table" & objRS.Fields("fIdTable").Value & "(" & arrChamps(0) & "Primary Key)"'
    				'objConn2.Execute strSql5'	
    			'End If
    			objRS.MoveNext
    			iIndex = iIndex + 1
    		Wend
    	End If
    End If%>
    </HTML>

  9. #9
    Membre Expert Avatar de franculo_caoulene
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    2 880
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 2 880
    Par défaut
    Salut,

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    '---Création de deux instances d'objet Recordset---' 
       Set objRS = Server.CreateObject("ADODB.Recordset") 
       Set objRS2 = Server.CreateObject("ADODB.Recordset")
    Et objRS3 et objRS4? Où sont-ils?
    Si tu mets en commentaire le objRS3 je t'annonce que tu auras la même erreur avec objRS4.

  10. #10
    Membre confirmé
    Inscrit en
    Mai 2004
    Messages
    88
    Détails du profil
    Informations forums :
    Inscription : Mai 2004
    Messages : 88
    Par défaut
    là je fais ça :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    <% @Language=VBSCRIPT %>
    <% Option Explicit %>
    <!--#include file = "ConnexionBaseDeDonnees.asp"-->
     
    <HTML>
    <%If Request("autretable")="Yes" Then%>
    	<BODY BgColor="#CCCCFF" Text="#0033FF" Link="#00A0FF" VLink="#00C0FF">
    		<FONT Face="Verdana" Size="4">	
    			<FORM METHOD=POST ACTION="EntreesFormulaire2.asp">
    				Nom de la table : 
    				<INPUT TYPE=TEXT NAME=nomtable size="20">
    				<P>
    				<INPUT TYPE=HIDDEN NAME=idapplication VALUE=<%=Cint(Request("idapplication"))%>>
    				<INPUT TYPE=SUBMIT VALUE="Valider">		
    			</FORM>	
    		</FONT>
    	</BODY>
    <%Else
     
    	'---Définition des constantes---'
    	Const adCmdTable = 2
    	Const adLockOptimistic = 3
    	Dim objRS
    	Dim strSql
    	Dim objRS2
    	Dim strSql2
    	Dim iCurseur
    	Dim iIndex
    	Dim iNbLignes
    	Dim iNbLignes2
    	Dim arrTables
    	Dim arrChamps
     
    	iIndex=0
     
    	'---Création de deux instances d'objet Recordset---'
    	Set objRS = Server.CreateObject("ADODB.Recordset")
    	Set objRS2 = Server.CreateObject("ADODB.Recordset")
    	strSql = "select fIdTable, tNomTable from tblCreationTable where fIdApplication = " & Cint(Request("idapplication"))
    	objRS.Open strSql, objConn, adLockOptimistic, adCmdTable
    	strSql2 = "select count(*) from tblCreationTable where fIdApplication = " & Cint(Request("idapplication"))
    	objRS2.Open strSql2, objConn, adLockOptimistic, adCmdTable
     
    	If objRS2(0) <> "" Then
    		iNbLignes = Cint(objRS2(0))-1
    		Redim arrTables(iNbLignes)
    		Dim strSql3
    		Dim objRS3
    		Dim strSql4
    		Dim objRS4
     
    		objRS.MoveFirst
    		While not objRS.EOF
    			arrTables(iIndex) = objRS.Fields("fIdTable").Value
    			Response.Write arrTables(iIndex)
    			strSql3 = "select tNomChamps, tTypeChamps from tblCreationChamps where fIdTable = " & arrTables(iIndex)			
    			objRS3.Open strSql3, objConn, adLockOptimistic, adCmdTable
    			strSql4 = "select count(*) from tblCreationChamps where fIdTable = " & arrTables(iIndex)
    			objRS4.Open strSql4, objConn, adLockOptimistic, adCmdTable
    			'If objRS4(0) <> "" Then'
    				'iNbLignes2 = Cint(objRS4(0))-1'
    				'Redim arrChamps(iNbLignes2)'
    				'objRS3.MoveFirst'
    				'iIndex = 0'
    				'objRS3.MoveFirst'
    				'While not objRS3.EOF'
    					'arrChamps(iIndex) = objRS3.Fields("tNomChamps").Value'
     
    					'objRS3.MoveNext'
    					'iIndex = iIndex +1'
    				'Wend'
    				'Dim strSql5'
    				'Dim objConn2'
    				'Set objConn2 = Server.CreateObject("ADODB.Connection")'
    				'objConn2.Open "base_generique"'
    				'strSql5 = "create table" & objRS.Fields("fIdTable").Value & "(" & arrChamps(0) & "Primary Key)"'
    				'objConn2.Execute strSql5'	
    			'End If
    			objRS.MoveNext
    			iIndex = iIndex + 1
    		Wend
    	End If
     
    	'---Elimination des objets ADO---'
    	objRS.Close
    	Set objRS = Nothing
    	objRS2.Close
    	Set objRS2 = Nothing
    	objRS3.Close
    	Set objRS3 = Nothing
    	objRS4.Close
    	Set objRS4 = Nothing
    End If
    objConn.Close
    Set objConn = Nothing
    %>
     
    </HTML>
    Et j'ai toujours cette erreur...

  11. #11
    Membre confirmé Avatar de M1000
    Homme Profil pro
    Chef de projet NTIC
    Inscrit en
    Novembre 2003
    Messages
    201
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Chef de projet NTIC
    Secteur : Santé

    Informations forums :
    Inscription : Novembre 2003
    Messages : 201
    Par défaut
    Citation Envoyé par franculo_caoulene
    Salut,
    Et objRS3 et objRS4? Où sont-ils?
    Si tu mets en commentaire le objRS3 je t'annonce que tu auras la même erreur avec objRS4.
    >> +1

    Tu initialise bien le Record Set de RS et RS2 mais tu ne le fais pas pour 3 et 4 alors esais en mettant ceci:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    Set objRS = Server.CreateObject("ADODB.Recordset") 
    Set objRS2 = Server.CreateObject("ADODB.Recordset") 
    Set objRS3 = Server.CreateObject("ADODB.Recordset") 
    Set objRS4 = Server.CreateObject("ADODB.Recordset")
    Normalement tes RS3 et 4 devrait alors mieux passer test et dis nous ce qui se passe ...

  12. #12
    Membre confirmé
    Inscrit en
    Mai 2004
    Messages
    88
    Détails du profil
    Informations forums :
    Inscription : Mai 2004
    Messages : 88
    Par défaut
    Oh la la al boulette !! Excusez moi...

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Quote dans une requete...
    Par Isildur dans le forum Langage SQL
    Réponses: 6
    Dernier message: 20/06/2006, 10h57
  2. [xsl]simuler le mecanisme OO de "liaison dynamique"
    Par philemon_siclone dans le forum XSL/XSLT/XPATH
    Réponses: 10
    Dernier message: 19/12/2003, 11h34
  3. Problème de quote
    Par kennini dans le forum ASP
    Réponses: 4
    Dernier message: 20/11/2003, 09h40
  4. VARCHAR contenant une quote '
    Par tonyskn dans le forum Langage SQL
    Réponses: 2
    Dernier message: 29/05/2003, 19h21
  5. Quotes dans TFilenameEdit (RXLib)
    Par AnnSo dans le forum Composants VCL
    Réponses: 3
    Dernier message: 23/01/2003, 20h26

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo