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> |
Partager