Pagina 2 di 3 primaprima 1 2 3 ultimoultimo
Visualizzazione dei risultati da 11 a 20 su 27
  1. #11
    Utente di HTML.it L'avatar di kluster
    Registrato dal
    Jul 2003
    Messaggi
    1,288
    adox.catalog

    guarda questo articolo

  2. #12
    Utente bannato
    Registrato dal
    Jun 2004
    Messaggi
    1,854
    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]
    ?

  3. #13
    Utente bannato
    Registrato dal
    Jun 2004
    Messaggi
    1,854
    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
    ?

  4. #14
    Utente di HTML.it L'avatar di kluster
    Registrato dal
    Jul 2003
    Messaggi
    1,288
    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 & ";"

  5. #15
    Utente bannato
    Registrato dal
    Jun 2004
    Messaggi
    1,854
    si era solo per capirci grazie cmq!
    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
    non cè altro mi pare..?

  6. #16
    Utente di HTML.it L'avatar di kluster
    Registrato dal
    Jul 2003
    Messaggi
    1,288
    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

  7. #17
    Utente bannato
    Registrato dal
    Jun 2004
    Messaggi
    1,854
    + naturalmente la conn al db sopra

  8. #18
    Utente bannato
    Registrato dal
    Jun 2004
    Messaggi
    1,854
    wow me lo hai pure scritto
    thx!
    ma non ti fanno moderatore?
    ciaoo

  9. #19
    Utente di HTML.it L'avatar di kluster
    Registrato dal
    Jul 2003
    Messaggi
    1,288
    bastava prendere lo script dell'articolo e levare quello che non serviva

  10. #20
    Utente bannato
    Registrato dal
    Jun 2004
    Messaggi
    1,854
    ahimè non va probabilmente cè un errore anche se non capisco quale:

    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
    %>
    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:

    L'input per la query deve contenere almeno una tabella o una query.

    nella riga di query ovviamente, a cosa è dovuto?
    grazie ciao!!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.