Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datasource.cfc Admin API error

Status
Not open for further replies.

imstillatwork

IS-IT--Management
Sep 26, 2001
1,605
US
I don't know how many of you are using the CFMX admin api, but I'm having a problem with it.

The originaldsn argument of setOther (or setMSAccess)is giving me troubles.

I am passing a hidden form field called originalDSNName and a text field called dsnName

Your supposed to pass the original name so the setOther methos knows that you are updating and existing DSN, rather than creating a new one.

I get this error were myNewDSNName is the name of my new dsn. It does not exist on the server, so It should be renaming my existing dsn that I am editing to this name...

I can create new DSN's all day long no problem, by omiting the originaldsn argument...

any ideas?

Code:
 dsn=myNewDSNName
 
The error occurred in datasource.cfc: line 1188
Called from setdsn.cfm: line 25
Called from setdsn.cfm: line 6
Called from datasource.cfc: line 259
Called from C:\Inetpub\[URL unfurl="true"]www\swarmmedia.com\admin\site_dsn_edit.cfm:[/URL] line 79

-1 : Unable to display error's location in a CFML template.

Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
Heh, sorry Kevin. I guess no one has tried the datasource.cfc Admin to get the API error. Have you looked at the Adobe forums, or asked Ben Forta? A year or so ago, I e-mailed ben Forta and lo-and-behold he actually got back to me (albeit it took a month or so, but he did)

____________________________________
Just Imagine.
 
yeah I emailed Ben and got an out of office reply, so it will probably be awhile.

Why do I always forget about the adobe forums? ? ?

Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
that's an argument name/value sent to the CFC method. The syntax is like: mycfcobject.itsmethod(this=that,here=there,etc) which is a valid way to specify arguements to a cfc method.


Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
oh, I see what you mean.

You do this to set DSNs with the admin api

log in to the api
Code:
<cfset isLoggedIn = createObject("component","cfide.adminapi.administrator").login("adminPassword")>

start the datasource CFC
Code:
<cfset dsnObj = createObject("component","cfide.adminapi.datasource")>

Use the setOther() method to set a Mysql DSN
Code:
<cfset dsnURL = "jdbc:mysql://xxx.xxx.xxx.xxx:3306/dbName?zeroDateTimeBehavior=convertToNull">
<cfset dsnClass = "com.mysql.jdbc.Driver">
<cfset dsnDriver = "MySQL (Other)">
<cfset dsnName = "MyDSNName">
<cfset dsnUser = "PleaseDontUseRoot!">
<cfset dnsPass = "strongPassword">

<cfset dsnObj.setOther(driver=dsnDriver,name=dsnName,url=dsnURL,username=dsnUser,password=dsnPass,class=dsnClass)>

The 'dsn=myNewDSNName' in the error message I posted is an internally set variable by datasource.cfc

From everything I've read, my syntax is correct. It indeed DOES work when adding a NEW dsn. To edit an existing DSN, you're supposed to pass along the oringinal ds name, and a new ds name, this is where I get errors.

I can get around it for now by deleting and re-creating, but that's not production quality to me...




Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top