Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    Aiuto! percorso database.

    Ciao a tutti.

    Sono nuovo ed assai inesperto: sto guardando ASP per la prima volta.
    Devo spostare la cartella datasource dentro alla cartella mdb-database (Aruba).
    Il mio manuale di GoLive 6.0 dice:
    "Per spostare la cartella datasources... controllare include/utils.runtime6.asp nella funzione GetDataSourcePath()"

    Per me è arabo! Non ho capito niente!
    Chi mi da un aiutino?

    Il file che suppongo di dover modificare fa così:


    // UTILITY FUNCTIONS
    //

    // -----------------------------------------------------------------------------
    // Return the path to the datasources folder. The only tricky part is finding
    // the config folder, which we pluck out of the include path of the current file.
    //
    // If you'd like to place the datasources outside the config folder, you can
    // change the body of this routine to return the path to the datasources. For
    // instance:
    // {
    // return "C:\\dataSourcesFolder\\";
    // }

    function GetDataSourcePath()
    {
    var dataSourcesPath = "";
    var url = String(Request.ServerVariables("URL"));
    var keyword = "DatasourcePath" + url.substring(0, url.lastIndexOf("/"));
    if (dataSourcesPath = Application(keyword)) {
    return dataSourcesPath;
    }

    var fileSystem = new ActiveXObject("Scripting.FileSystemObject");
    var pathTranslated = String(Request.ServerVariables("PATH_TRANSLATED")) ;
    var currentFile = fileSystem.OpenTextFile(pathTranslated, 1); // forReading
    var matchExpression = /\s*[<]!--\s*#INCLUDE\s+(FILE|VIRTUAL)="(.*)[\/]include[\/]utils\.runtime[0-9]+\.asp"\s*--[>]/;
    while (!currentFile.AtEndOfStream) {
    if (matchExpression.exec(currentFile.ReadLine())) {
    break;
    }
    }
    if (currentFile.AtEndOfStream) {
    return "";
    }
    if (RegExp.$1 == "FILE") {
    dataSourcesPath = Server.MapPath(".") + "/" + RegExp.$2;
    } else {
    dataSourcesPath = Server.MapPath(RegExp.$2);
    }
    dataSourcesPath += "/datasources/";
    Application(keyword) = dataSourcesPath; // cache
    return dataSourcesPath;
    }


    // -----------------------------------------------------------------------------
    // Get the connection string for a datasource.

    function GetConnectString(db)
    {
    var fileSystem = new ActiveXObject("Scripting.FileSystemObject");
    var dataSourcesPath = GetDataSourcePath();
    if (dataSourcesPath == "") {
    return;
    }
    dataSourcesPath += db;

    if (fileSystem.FileExists(dataSourcesPath + ".udl")) {
    return "File Name=" + dataSourcesPath + ".udl";
    } else if (fileSystem.FileExists(dataSourcesPath + ".dsn")) {
    return "FILEDSN=" + dataSourcesPath + ".dsn";
    } else if (fileSystem.FileExists(dataSourcesPath + ".mdb")) {
    return "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + dataSourcesPath + ".mdb";
    } else if (fileSystem.FileExists(dataSourcesPath + ".xdb")) {
    return "DSN=" + fileSystem.GetBaseName(dataSourcesPath);
    } else {
    return "";
    }
    }

    function ConnectString(db) { return GetConnectString(db); } // version 1.0 compatibility

    function GetFormValue(name)
    {
    var r = null;
    if ((r=Request(name)).Count > 0
    || (r=Request("~"+name)).Count > 0
    || (r=Request(name+".x")).Count > 0)
    return unescape(r);
    /* None of the above. */
    return "_no_form_value";
    }

    /*
    * Use internet-standard newlines to send/receive the contents of
    * text files to/from GoLive.
    */
    function canonicalizeCRLF(data) {
    return String(data).replace(/\r\n?|\n/g, "\r\n");
    }

    /*
    * Read FILENAME into an array of lines and return it.
    * Try to conform to any/all of MacOS (\r) UNIX (\n)
    * and Windows (\r\n) line-ending conventions.
    * The returned lines do not have the line terminator appended;
    * this seems to match the TextStream.ReadLine() method that
    * this function replaces.
    * NB there may be a 0-length last line, an implementation
    * artifact of String.split().
    */
    function GL_FileFromTextStream(ts) {
    var content = ts.ReadAll();
    return content.split(/\r\n?|\n/);
    }


    Grazie.

  2. #2
    Utente di HTML.it L'avatar di [trodat]
    Registrato dal
    Oct 2004
    Messaggi
    2,135
    Dentro la cartella mdb-database di aruba non è consigliato creare ulteriori sottocartelle; ma se proprio devi puoi farlo direttamente sul server tramite ftp. La nuova cartella erediterà in automatico i permessi previsti nella cartella mdb-database.
    Lo Stato dà un posto. L’impresa privata dà un lavoro. – Indro Montanelli

  3. #3
    Originariamente inviato da [trodat]
    Dentro la cartella mdb-database di aruba non è consigliato creare ulteriori sottocartelle
    Perchè le certelle create avrebbero i permessi di scrittura attivi o c'è qualche altro motivo?

    Comunque grazie dell'info.

  4. #4
    Utente di HTML.it L'avatar di [trodat]
    Registrato dal
    Oct 2004
    Messaggi
    2,135
    Perchè più cartelle inserisci e più difficile diventa il percorso per risalire al db.
    Lo Stato dà un posto. L’impresa privata dà un lavoro. – Indro Montanelli

  5. #5
    Provo a riformulare la domanda iniziale un po' più aperta.

    Devo collegare alcune pagine ASP ad un piccolo database MDB usando un hosting DNS less(come si è capito Aruba) che non consente di modificare i permessi alle nuove cartelle create.
    Il servizio fornisce una sola cartella predefinita (mdb-database) con attivati i permessi di scrittura. Quindi, anche se il mio sito prevederebbe una struttura diversa il database penso di doverlo mettere lì dentro.

    Se sposto solo il database dalla mia cartella datasources alla loro cartella mdb-database come prevedibile non funziona più nulla.
    Quali altre modifiche dovrei fare? Sono un po' disorientato.

  6. #6
    Utente di HTML.it L'avatar di [trodat]
    Registrato dal
    Oct 2004
    Messaggi
    2,135
    Devi cambiare la stringa di connessione al db nelle pagine in cui è prevista ed inserire il nuiovo percorso.
    Lo Stato dà un posto. L’impresa privata dà un lavoro. – Indro Montanelli

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 © 2025 vBulletin Solutions, Inc. All rights reserved.