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
156 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 49

Expert Comment

by:Ryan Chong
Comment Utility
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
Comment Utility
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
Comment Utility
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 49

Accepted Solution

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Responsive CSS Layout? 6 43
Format results with PHP 3 61
How to analyze web traffic logs 10 89
jQuery or Javascript animation question 6 56
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now