Bon j'ai le code suivant :
Le Response. Write me donne :
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 <% @Language=VBSCRIPT %> <% Option Explicit %> <!--#include file = "ConnexionBaseDeDonnees.asp"--> <!--#include file = "ConnexionBaseDeDonneesGenerique.asp"--> <HTML> <% If Request("recherche") <> "" Then '---Définition des constantes---' Const adCmdTable = 2 Const adLockOptimistic = 3 '---Définition des variables---' Dim objRS Dim objRS2 Dim strSql Dim strSql2 Dim strTable Set objRS = Server.CreateObject("ADODB.Recordset") Set objRS2 = Server.CreateObject("ADODB.Recordset") strSql = "select tNomTable from tblCreationTable where fIdTable = " & Cint(Request("idtable")) objRS.Open strSql, objConn, adLockOptimistic, adCmdTable strTable = objRS(0) strSql2 = "select * from " & strTable & " where " & Request("nomchamp") & " = " & Request("recherche") Response.Write strSql2 'objRS2.Open strSql2, objConn2, , adLockOptimistic, adCmdTable' objRS.Close Set objRS = Nothing 'objRS2.Close' 'Set objRS2 = Nothing' objConn.Close Set objConn = Nothing 'objConn2.Close' 'Set objConn2 = Nothing' End If %> </HTML>
select * from Table1 where Champs1 = 1
mais dès que je remets cette ligne pas en commentaire :Et bien j'ai cette erreur :
Code : Sélectionner tout - Visualiser dans une fenêtre à part objRS2.Open strSql2, objConn2, , adLockOptimistic, adCmdTable
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][Pilote ODBC Microsoft Access] Erreur de syntaxe dans la clause FROM.
/emilie/Recherche2.asp, line 24
Partager