Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 164
  • Last Modified:

Is there anyway to get dreamweaver to stop putting the db connection in an include file when creating a recordset?

Is there anyway to get dreamweaver to stop putting the db connection in an include file when creating a recordset?

The work around is obvious:

Create the recordset then open the include file and copy the connection string and place it inside of the original document. Thats easy enough, but I just want is to be that much easier.

When you do this the recorset shows an exclamation point because DW can't find the connection any longer.
0
netadmin2004
Asked:
netadmin2004
  • 2
2 Solutions
 
Ryan ChongCommented:
You can't if you're using wizards in DW. To avoid that, you need to write the whole scripts yourself by Not using wizards
0
 
rockmansatticCommented:
THis si correct, DW cannot 'find' the connection if not located in the connections folder.  To my knowledge, there is no DW setting that can be changed.

Rockman
0
 
Havin_itCommented:
ryancys, that ain't necessarily so. Most of the Configuration folder is made up of HTML and JS files, and eminently hackable if you can understand it all.  I sure won't claim that I do, but I have dabbled. You quite often come across functions in the config scripts that aren't referenced anywhere else in that folder - they are usually like DW_someThingOrOther() - which I guess means only the binary reads them (so you can go no further) - but with trial and error some nice hacks can be pulled off.

For example, this is from Configuration/Connections/PHP_MySQL/Connection_php_mysql.js in 'old' MX:

//--------------------------------------------------------------------
// FUNCTION:
//   applyConnection
//
// DESCRIPTION:
//   Returns the code that should be inserted into the connection
//   include file.
//
// ARGUMENTS:
//   none
//
// RETURNS:
//   string - connection code
//--------------------------------------------------------------------

function applyConnection()
{
  var code = "";
 
  if (isValid())
  {  
    // build tokens array
    connParams = new Object();
    connParams.cname = dwscripts.trim(CONN_NAME_OBJ.value);
    connParams.hostname = dwscripts.trim(HOST_NAME_OBJ.value);
    connParams.username = dwscripts.trim(USERNAME_OBJ.value);
    connParams.password = PASSWORD_OBJ.value;
    connParams.databasename = dwscripts.trim(DB_NAME_OBJ.value);
    connParams.filename = "Connection_php_mysql.htm";
    connParams.type = "MYSQL";

    if (USE_HTTP)
    {
      connParams.http = "true";
      connParams.designtimeType = "MYSQL";
      connParams.designtimeString = "";
    }
    else
    {
      connParams.http = "false";
      connParams.designtimeType = "ADO";

      // var dsn = DSN_NAME_OBJ.get();
      // JALBANO: connParams.designtimeString = "\"" + buildDSNConnectionString(dsn) + "\"";
      // connParams.designtimeString = buildDSNConnectionString(dsn, connParams.username, connParams.password);
    }

    var part = new Participant(PARTICIPANT_FILE);

    code = part.getInsertString(connParams);
  }
 
  return code;
}

Now I haven't scrutinised this in depth or chased up any external function references, but this would be a good place to start. And as rockman says, actually having the GUI respond to your hacks and actually USE an inline connection script may be a different matter. But as long as you back up your Configuration folder, I think it's one of the most fun things about DW to play around in there.
0
 
Ryan ChongCommented:
What i mean is DW will create the db connection files once you're using the wizard, there is NO way you can avoid that. And once you manually amend the file, DW will not recognize what has been created using wizards. And as an experienced developer, i suggest NO to using wizard to create the connection scripts, use your own library if possible. You may ask why? Simply because you need to study what the scripts mean, doing some customization to suit your business logic (if necessary) and what most important is the wizard-created scripts are NOT full-prove working in all conditions.

cheers
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now