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
158 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
  • 2
4 Comments
 
LVL 50

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 50

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
character entities and entity references in XML 17 122
use of cookies and regulations 1 87
Select distinct 25 100
Where do I learn ES6? 3 68
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

773 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