I have been able to connect my mysql database to the coldfusion 10 administrator, using the mysql(4/5) driver. However when I attempt to preform a query in a webpage I get an error page saying:
Datasource newsletter could not be found
Here is the code snippet:
<cfquery Name="dump" datasource="newsletter" username="root" password="*******">(my password is correct)
ANy help would be appreciated.
You might be confusing the table name with the datasource name. Why don't you run the following code to verify the names of all the datasources:
<cfset adminObj = CreateObject("component","cfide.adminapi.administrator")>
<cfset adminLogin = adminObj.login("my_cfadmin_password")>
<cfset datasourceService = CreateObject("component","cfide.adminapi.datasource")>
<cfset datasources = datasourceService.getDatasources()>
<cfset datasourceList = structkeylist(datasources)>
List of datasources: <cfoutput>#datasourceList#</cfoutput>
I figured out what the issue was.
I had both Coldfusion 9 and Coldfusion 10 installed. It appears I was getting the database connected with Coldfusion 9 but then I was building and running on the coldfusion 10 server. Uninstalling coldfusion 9 and ensuring the datasource was connected to the coldfusion 10 administrator resolved the issue.
Europe, Middle East and Africa