Solved

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

Posted on 2004-09-13
4
161 Views
Last Modified: 2013-11-18
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
Comment
Question by:netadmin2004
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 12052674
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
 
LVL 10

Expert Comment

by:rockmansattic
ID: 12056263
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
 
LVL 10

Assisted Solution

by:Havin_it
Havin_it earned 100 total points
ID: 12063077
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
 
LVL 52

Accepted Solution

by:
Ryan Chong earned 150 total points
ID: 12063518
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question