Professional Web Applications Themes

Error accessing database - Coldfusion Database Access

This is not working for some reason it is telling me that ds_products does not exist. here is the code... <CFQUERY NAME="products" DATASOURCE="ds_products"> SELECT ProductName FROM tblProducts </CFQUERY> <html> <head> <title></title> </head> <body> <h1>Product Listing</h1> <ul><li><CFOUTPUT QUERY="products"> #ProductName# </CFOUTPUT></li></ul> </body> </html>...

  1. #1

    Default Error accessing database

    This is not working for some reason it is telling me that ds_products does not
    exist. here is the code...
    <CFQUERY NAME="products" DATASOURCE="ds_products">
    SELECT ProductName
    FROM tblProducts
    </CFQUERY>
    <html>
    <head>
    <title></title>
    </head>
    <body>
    <h1>Product Listing</h1>
    <ul><li><CFOUTPUT QUERY="products">
    #ProductName#
    </CFOUTPUT></li></ul>

    </body>
    </html>

    krazykrisi Guest

  2. #2

    Default Re: Error accessing database

    1. make sure you have the dsn setup in windows
    2. make sure you have the dsn setup in cf administrator
    3. is ds_products the actual dns name and is capitalization identical?
    4. is ds_products actually an application or session variable referencing the
    real dsn? In which case it should be DATASOURCE="#application.ds_products# or
    "#session.ds_products#"

    hatethisnamegame Guest

  3. #3

    Default Re: Error accessing database

    what do you mean by dns? ds_products is a folder within the site folder which contains the products database.
    krazykrisi Guest

  4. #4

    Default Re: Error accessing database

    Follow these steps:
    1. Open your ColdFusion Admnistrator
    2. Click "Datasources"
    3. Do you see "ds_products" listed?
    If so, click the check box to verify the connection.
    If not, ds_products is probably a variable and you are missing the <cfset>
    command usually stored in the application.cfc/cfm (<cfset #ds_products# = >)

    This article may help you understand odbc connections. It is written for
    ColdFusion 5:

    [url]http://livedocs.macromedia.com/coldfusion/5.0/Installing_and_Configuring_ColdFus[/url]
    ion_Server/datasources8.htm

    LL@Work Guest

Similar Threads

  1. Accessing database which is not set up in Admin
    By cnizzle in forum Coldfusion Database Access
    Replies: 2
    Last Post: December 19th, 02:18 PM
  2. Accessing database
    By verns in forum Coldfusion Database Access
    Replies: 5
    Last Post: September 8th, 12:43 PM
  3. ADO error accessing - Access Database
    By Christopher Knapp in forum ASP Database
    Replies: 7
    Last Post: April 15th, 11:17 PM
  4. Accessing a database from two cities
    By Mike in forum FileMaker
    Replies: 4
    Last Post: October 9th, 01:04 PM
  5. accessing database question
    By Dwayne Epps in forum Macromedia Dreamweaver
    Replies: 1
    Last Post: July 24th, 04:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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