On Mar 17, 11:47 pm, Alan Holden <[email protected]> wrote: > You use the Datasourcecreate() function to create a DSN - without using > the admin api. > Then you can just reuse the DSN by name for the rest of your script. > > I guess I don't know what the convenience is (or the security, for that > matter) - of restating all the variables and password needed for a DB > connection - every time you want to run a query. Unless you just want it > to work like PHP does. > > I suppose I'm just taking your "serious question" logic and flipping it No, you answered my question. I didn't know of the datasourcecreate function (another awesome OpenBD only function?). The only thing that worries me is hard ding the driver name. I'm going to use datasourcecreate though.
Thanks! > > Al > > On 3/17/2012 9:06 PM, Aaron J. White wrote: > > > > > > > > > Hey guys, > > > For some reason I thought this could be done already in cfquery. I was > > hoping to make an app that didn't need a DSN or one created for it > > through the admin api. I was planning to do something like below. Of > > course the cfquery attribute collection would have all the necessary > > data for a dsn-less connection like user,pass,host,dbname, and port. > > > <cfquery attributeCollection="#application.globalDS#"> > > > </cfquery> > > > Is there any serious reason we don't have this type of functionality > > in OpenBD? In most cases I would prefer a DSN, but why should it be an > > all or nothing type thing? I think it could be useful for people on > > hosted accounts. I've used several coldfusion hosts in the past and > > creating DSNs is usually a pain. > > > Also I see some work arounds online for this type of functionality > > through cfscript or custom tags, but this is something I think should > > be incorporated in cfquery itself. I wouldn't feel comfortable using > > custom tags for queries all around my app. > > > So what do you guys think? -- online documentation: http://openbd.org/manual/ google+ hints/tips: https://plus.google.com/115990347459711259462 http://groups.google.com/group/openbd?hl=en
