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
160 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 51

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 51

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
XSL Grouping 7 42
RSS Feed Validation 2 73
Create 4 <div> below each other in php 2 70
Randomize in Owl Carousel v1.3.2 6 96
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
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…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

713 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