connecting to dsn on server

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default connecting to dsn on server

    I have a website on a shared server at CrystalTech.

    They say: Your data source verified. The connection string you should
    use in your code is "dsn=dbname;uid=username;pwd=mypwd;network=dbxxxxx x"

    I tried the following

    <cfset Request.MainDSN = "exactly as above">

    But neither this, nor above without dsn=, works.

    How then should the code be written in cfapplication?

    Doug
    doug777 Guest

  2. Similar Questions and Discussions

    1. Connecting to SQL server
      Are settings configured wrong? Of course both possible reasons given are both true, that is the web services is up and running and the ODBC DSN...
    2. Connecting SQL Server with DW using ASP.NET VB
      Hello All, I'm trying to connect SQL Server with DW using ASP.NET VB using several connection strings and getting different error messages. The...
    3. Connecting SQL Server to DW
      Hello I'm I have a project that is due shortly and I have been trying for about a week to connect SQL Server with DW with no success. I have read...
    4. Connecting to SQL Server from ASP.NET
      Hi, Hi I have SQL Server Instances running on same machine. How do i connect to the "SecondInstance" of SQL Server on a machine from ASP.NET? ...
    5. Web Server connecting to Informix Server
      I am running an OLTP system with Informix 7.3 IDS on HPUX. We are considering writing some web interfaces to connect to the database. At first we...
  3. #2

    Default Re: connecting to dsn on server

    Sorry, last line should say:

    How then should the code be written in application.cfm?

    Doug
    doug777 Guest

  4. #3

    Default Re: connecting to dsn on server

    doug777 wrote:
    > I have a website on a shared server at CrystalTech.
    >
    > They say: Your data source verified. The connection string you should
    > use in your code is "dsn=dbname;uid=username;pwd=mypwd;network=dbxxxxx x"
    >
    > I tried the following
    >
    > <cfset Request.MainDSN = "exactly as above">
    >
    > But neither this, nor above without dsn=, works.
    >
    > How then should the code be written in cfapplication?
    That looks like the code you'd use to connect in ASP, not in CF. In CF
    you would set the DSN, user name, and password as separate variables.
    (You don't need network at all.)

    <cfset Application.DSN = "your_datasource_name" />
    <cfset Application.dbUser = "your_database_username" />
    <cfset Application.dbPassword = "your_database_password" />

    Then when you run a query:
    <cfquery name="whatever" datasource="#Application.DSN#"
    username="#Application.dbUser#" password="#Application.dbPassword#">
    etc. ...

    Hope that helps,
    Matt

    --
    Matt Woodward
    Team Macromedia - ColdFusion
    mpwoodward *TMM* Guest

  5. #4

    Default Re: connecting to dsn on server

    Thanks so much for that. I don't think I would ever have guessed that
    that was the way to do it.

    May I ask you another question ...

    I originally developed the site all in the main directory.

    When I moved all the .cfm files into a sub-directory, cffiles, DW
    changed the code in my login security on every page (no other links were
    changed) from:

    MM_failureURL="failpage.cfm?etc

    to:

    MM_failureURL="../failpage.cfm?etc

    although all cfm pages are in this new directory.

    Is this right or should it be changed back to the original?

    Doug
    doug777 Guest

  6. #5

    Default Re: connecting to dsn on server

    doug777 wrote:
    > Thanks so much for that. I don't think I would ever have guessed that
    > that was the way to do it.
    >
    > May I ask you another question ...
    >
    > I originally developed the site all in the main directory.
    >
    > When I moved all the .cfm files into a sub-directory, cffiles, DW
    > changed the code in my login security on every page (no other links were
    > changed) from:
    >
    > MM_failureURL="failpage.cfm?etc
    >
    > to:
    >
    > MM_failureURL="../failpage.cfm?etc
    >
    > although all cfm pages are in this new directory.
    >
    > Is this right or should it be changed back to the original?
    >
    > Doug
    Yes, if you moved them to a subdirectory then the "../" means "go up a
    directory from where you are to find this page." That should be correct.

    Matt

    --
    Matt Woodward
    Team Macromedia - ColdFusion
    mpwoodward *TMM* Guest

  7. #6

    Default Re: connecting to dsn on server

    Sorry, but I still don't understand why it should want to go up a
    directory, when failpage.cfm is in the same directory as all the other
    ..cfm files.

    Doug

    mpwoodward *TMM* wrote:
    > doug777 wrote:
    >
    >> Thanks so much for that. I don't think I would ever have guessed that
    >> that was the way to do it.
    >>
    >> May I ask you another question ...
    >>
    >> I originally developed the site all in the main directory.
    >>
    >> When I moved all the .cfm files into a sub-directory, cffiles, DW
    >> changed the code in my login security on every page (no other links
    >> were changed) from:
    >>
    >> MM_failureURL="failpage.cfm?etc
    >>
    >> to:
    >>
    >> MM_failureURL="../failpage.cfm?etc
    >>
    >> although all cfm pages are in this new directory.
    >>
    >> Is this right or should it be changed back to the original?
    >>
    >> Doug
    >
    >
    > Yes, if you moved them to a subdirectory then the "../" means "go up a
    > directory from where you are to find this page." That should be correct.
    >
    > Matt
    >
    doug777 Guest

  8. #7

    Default Re: connecting to dsn on server

    doug777 wrote:
    > Sorry, but I still don't understand why it should want to go up a
    > directory, when failpage.cfm is in the same directory as all the other
    > .cfm files.
    Sorry, I didn't realize that failpage was in the same directory. If
    that's the case then no, it shouldn't be mapped that way. If it can't
    find the file then that's probably why. I have no clue how the
    Dreamweaver stuff works so I'm not familiar with the details of what it
    does for login stuff.

    Matt

    --
    Matt Woodward
    Team Macromedia - ColdFusion
    mpwoodward *TMM* Guest

  9. #8

    Default Re: connecting to dsn on server

    Your help much appreciated. Thanks very much.

    Doug
    doug777 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139