Are you logging in with the correct username and password - also are you
simply querying a sql server database to provide data to chartFX?


Its not clear.


Kola


-----Original Message-----
From: Asim Manzur [mailto:[EMAIL PROTECTED]
Sent: 18 June 2004 16:52
To: CF-Talk
Subject: Re: CHARTFX & ColdFusion MX


the following code i tried and it throw me the error

<!--- Set the connection variables --->
<cfset serverIP = "192.168.1.11">
<cfset dbName = "infiniti_adbuilder">
<cfset username = "_infiniti_">
<cfset password = "infiniti123">
<cfset sqlString = "select region, id, Buildprovince from dealers">
<!--- Create the connection to the server ---> <!---<cfset
ConnectString="Provider=MSDASQL;DSN=infiniti;UID=_infiniti_;PWD=infiniti
123;">--->

<cfset ConnectString="Provider='SQLOLEDB';Server='#serverIP#';Initial
Catalog='#dbName#'"> <cfobject type="COM" name="ConnectionObject"
class="ADODB.Connection" action="" <cfset discard =
ConnectionObject.Open(ConnectString,"#username#","#password#",0)>
<!--- Run the query --->
<cfset myResultSet = ConnectionObject.Execute("#sqlString#",0,8)>
<!--- Get the column names --->
<cfset Columns = "">
<cfloop collection="#myResultSet.Fields#" item="thisField">
  <cfset Columns = listappend(Columns, thisField.name)> </cfloop>
<!--- Populate a newly made query with Columns ---> <cfset MyRecords =
querynew(Columns)>
<!--- Go to the first row of the recordset ---> <cfset
myResultSet.movefirst()>
<!--- And populate the recordset... ---> <cftry>
  <cfloop from="1" to="250000" index="i">
    <cfif NOT myResultSet.EOF>
      <cfset queryaddrow(MyRecords, 1)>
    </cfif>
    <cfloop collection="#myResultSet.Fields#" item="this">
      <cfset querysetcell(MyRecords, trim(this.name), this.value, i)>
    </cfloop>
    <cfset myResultSet.movenext()>
  </cfloop>
  <cfcatch></cfcatch>
</cftry>

<!--- Output the data --->

<table border="1">
  <!--- output the columns --->
  <tr> <cfoutput>
      <cfloop index="thisColumn" list="#MyRecords.columnList#" >
        <th>#thisColumn#</th>
      </cfloop>
    </cfoutput> </tr>
  <!--- output the rows --->
  <cfoutput query="MyRecords">
    <tr>
      <cfloop list="#MyRecords.columnlist#" index="this">
        <td>#evaluate(this)#</td>
      </cfloop>
    </tr>
  </cfoutput>
</table>
<!--- Close the ODBC connection (like you do in asp)---> <cfset
ConnectionObject.Close()>

the error I got is

An exception occurred when executing a Com method.  
The cause of this exception was that: AutomationException: 0x80004005 -
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied. in 'Microsoft OLE DB Provider for SQL Server'.  
  
The error occurred in C:\Inetpub\wwwroot\dev\test2.cfm: line 12

10 :  <cfset
ConnectString="Provider='SQLOLEDB';Server='#serverIP#';Initial
Catalog='#dbName#'">
11 : <cfobject type="COM" name="ConnectionObject"
class="ADODB.Connection" action=""> 12 : <cfset discard =
ConnectionObject.Open(ConnectString,"#username#","#password#",0)>
13 : <!--- Run the query --->
14 : <cfset myResultSet = ConnectionObject.Execute("#sqlString#",0,8)>

thanks
asim
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to