adox.catalog
guarda questo articolo
adox.catalog
guarda questo articolo
quindi dovrebbe essere una cosa del tipo
[/CODE]
Set objADOX = Server.CreateObject("ADOX.Catalog")
objADOX.ActiveConnection = objConn
For Each whatever in objADOX.Tables
If Tabella.Type = "TABLE" Then
connessione = "provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db1.mdb")
Set Cn = Server.CreateObject("ADODB.Connection")
Cn.open connessione
SQLTrasfert = "SELECT * INTO [NOME_DA_DARE_ALLA_TABELLA_DB_2] IN '" & Server.MapPath("db2.mdb") & "' FROM [TABELLA_DB_1];"
Connection.execute(SQLTrasfert )
next[/CODE]
?
sbagliai il tag![]()
quindi dovrebbe essere una cosa del tipo
?codice:Set objADOX = Server.CreateObject("ADOX.Catalog") objADOX.ActiveConnection = objConn For Each whatever in objADOX.Tables If Tabella.Type = "TABLE" Then connessione = "provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db1.mdb") Set Cn = Server.CreateObject("ADODB.Connection") Cn.open connessione SQLTrasfert = "SELECT * INTO [NOME_DA_DARE_ALLA_TABELLA_DB_2] IN '" & Server.MapPath("db2.mdb") & "' FROM [TABELLA_DB_1];" Connection.execute(SQLTrasfert ) next
hai troppa fretta leggiti tutto l'articolo
se fai
for each whatever in objADOX.Tables
devi cambiare tutti i riferimenti da table a whatever
ed inoltre la select diventa
SQLTrasfert = "SELECT * INTO " & whatever.name & " IN '" & Server.MapPath("db2.mdb") & "' FROM " & whatever.name & ";"
si era solo per capircigrazie cmq!
non cè altro mi pare..?codice:Set objADOX = Server.CreateObject("ADOX.Catalog") objADOX.ActiveConnection = objConn For Each whatever in objADOX.Tables If whatever.Type = "TABLE" Then connessione = "provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db1.mdb") Set Cn = Server.CreateObject("ADODB.Connection") Cn.open connessione SQLTrasfert = "SELECT * INTO whatever.name IN '" & Server.MapPath("db2.mdb") & "' FROM whatever.name;" Connection.execute(SQLTrasfert ) next
codice:Set objADOX = Server.CreateObject("ADOX.Catalog") connessione = "provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db1.mdb") Set objConn = Server.CreateObject("ADODB.Connection") objConn .open connessione objADOX.ActiveConnection = objConn For Each whatever in objADOX.Tables If whatever.Type = "TABLE" Then SQLTrasfert = "SELECT * INTO " & whatever.name & "IN '" & Server.MapPath("db2.mdb") & "' FROM " & whatever.name & ";" objConn.execute(SQLTrasfert ) next Set ObjAdox = nothing ObjConn.Close Set objConn = nothing
+ naturalmente la conn al db sopra![]()
wow me lo hai pure scritto![]()
thx!
ma non ti fanno moderatore?![]()
ciaoo![]()
bastava prendere lo script dell'articolo e levare quello che non serviva![]()
ahimè non vaprobabilmente cè un errore anche se non capisco quale:
volevo testarlo percui h creato due semplici db di una tabella ciascuno chiamati db1 e db2 nella stessa cartella e ho lanciato il file, mi dice:codice:<% Set objADOX = Server.CreateObject("ADOX.Catalog") connessione = "provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db1.mdb") Set objConn = Server.CreateObject("ADODB.Connection") objConn.open = connessione objADOX.ActiveConnection = objConn For Each whatever in objADOX.Tables If whatever.Type = "TABLE" Then SQLTrasfert = "SELECT * INTO " & whatever.name & "IN '" & Server.MapPath("db2.mdb") & "' FROM " & whatever.name & ";" objConn.execute(SQLTrasfert ) end if next Set ObjAdox = nothing ObjConn.Close Set objConn = nothing %>
L'input per la query deve contenere almeno una tabella o una query.
nella riga di query ovviamente, a cosa è dovuto?
grazie ciao!!