Copy link to clipboard
Copied
Okay, I'm by no means a cold fusion expert. But I have been teaching myself over the last year since our website was built off of Cold Fusion. So I need help because I am trying to build a site where people can enter in their e-mail address, and name (first and last) for a sweepstakes that we have on our catalog.
I have create a table called "Sweepstakes" so on my MS SQL 2005 Web Box there is a table under the database called "dbo.sweepstakes". I have replicated basically everything that a original database that was already created to capture user's email address for catalog request and what have you. The original database to capture user's request catalogs from us is called "dbo.InfoRequest" (just a FYI) and this was the database I basically replicated in a way.
So after saying all this, I continue to receive this error message and I can not figure out why. So here is the error message that I am getting.
This is the error when trying to load the database from the "webview" basically. We have an Admin Console to the website and in their, there is a section to list the contents of a specific database. So if you requested a catalog, you put in your name, email address, etc on to the website and when you hit submit on the website it insert it into the database called "dbo.InfoRequest". So when the Spring comes and I want to get a list of people that have request a catalog, I go to our website's admin console and inside there, there is a "List Catalog Request". When you click on it, it loads a file called "ListCatalogRequest.cfm" and it displays the "dbo.InfoRequest" database on the screen in a table format basically. So I am trying to replicate that for this sweepstakes we are having on our website / catalog but without using the "dbo.InfoRequest" database. Since we are doing a drawing, I'd rather it be in it's own database for viewing a drawing. So I have copied the "ListCatalogRequest.cfm" file and renamed it to "ListSweepstakesEntrys.cfm" and changed a couple of things in the file to point to the "dbo.Sweepstakes" that I created this morning and here are the results when you bring up the "ListSweepstakesEntrys.cfm" file.
If you need the results and / or code from either "ListSweepstakesEntrys.cfm" or "IISAdminSecurity.cfm" please let me know.
THANK YOU FOR ALL YOUR HELP IN ADVANCE!
--- ListSweepstakesEntrys.cfm ---
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Invalid column name 'Sweepstakes'.
The error occurred in E:\data\webs\m_k_tweb2007\admin\iiAdminSecurity.CFM: line 298
Called from E:\data\webs\m_k_tweb2007\admin\ListSweepstakesEntrys.cfm: line 2
Called from E:\data\webs\m_k_tweb2007\admin\iiAdminSecurity.CFM: line 298
Called from E:\data\webs\m_k_tweb2007\admin\ListSweepstakesEntrys.cfm: line 2
296 : WHERE
297 : Username = '#Client.Username#'
298 : AND Password = '#Client.Password#'
299 : AND Active = 'Y'
300 : AND UserType = 'A'
SQL SELECT [Sweepstakes] AS TableAccessLevel, MinimumSecurity, IDNumber FROM AdminUsers WHERE Username = 'username' AND Password = 'password' AND Active = 'Y' AND UserType = 'A'
DATASOURCE M_k_tWeb2007
VENDORERRORCODE 207
SQLSTATE 42S22
Resources:
* Check the ColdFusion documentation to verify that you are using the correct syntax.
* Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)
Remote Address 24.XX.XX.XX
Referrer http://m_k_t.com/admin/admin.cfm
Date/Time 24-Feb-10 07:32 AM
Stack Trace
at cfiiAdminSecurity2eCFM1992009626.runPage(E:\data\webs\m_k_tweb2007\admin\iiAdminSecurity.CFM:298) at cfListSweepstakesEntrys2ecfm1853454474.runPage(E:\data\webs\m_k_tweb2007\admin\ListSweepstakesEntrys.cfm:2) at cfiiAdminSecurity2eCFM1992009626.runPage(E:\data\webs\m_k_tweb2007\admin\iiAdminSecurity.CFM:298) at cfListSweepstakesEntrys2ecfm1853454474.runPage(E:\data\webs\m_k_tweb2007\admin\ListSweepstakesEntrys.cfm:2)
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][SQLServer]Invalid column name 'Sweepstakes'.
at macromedia.jdbc.base.BaseExceptions.createException(Unknown Source)
at macromedia.jdbc.base.BaseExceptions.getException(Unknown Source)
at macromedia.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at macromedia.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at macromedia.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at macromedia.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
at macromedia.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
at macromedia.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
at macromedia.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at macromedia.jdbc.base.BaseStatement.executeInternal(Unknown Source)
at macromedia.jdbc.base.BaseStatement.execute(Unknown Source)
at coldfusion.server.j2ee.sql.JRunStatement.execute(JRunStatement.java:212)
at coldfusion.sql.Executive.executeQuery(Executive.java:753)
at coldfusion.sql.Executive.executeQuery(Executive.java:675)
at coldfusion.sql.Executive.executeQuery(Executive.java:636)
at coldfusion.sql.SqlImpl.execute(SqlImpl.java:236)
at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:500)
at cfiiAdminSecurity2eCFM1992009626.runPage(E:\data\webs\m_k_tweb2007\admin\iiAdminSecurity.CFM:298)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
at coldfusion.filter.CFVariablesScopeFilter.invoke(CFVariablesScopeFilter.java:63)
at coldfusion.tagext.lang.ModuleTag.doStartTag(ModuleTag.java:255)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:1925)
at cfListSweepstakesEntrys2ecfm1853454474.runPage(E:\data\webs\m_k_tweb2007\admin\ListSweepstakesEntrys.cfm:2)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:225)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:115)
at coldfusion.CfmServlet.service(CfmServlet.java:107)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
Copy link to clipboard
Copied
OK, this is more a SQL question than a CF question, but not to worry.
You say this:
I have create a table called "Sweepstakes"
My emphasis.
But your query is this:
SELECT [Sweepstakes] AS TableAccessLevel, MinimumSecurity, IDNumber FROM AdminUsers WHERE Username = 'username' AND Password = 'password' AND Active = 'Y' AND UserType = 'A'
The question I pose to you is: does a SELECT statement in SQL take the name of a table?
Hint: no.
Best you revise your SQL docs, I think.
--
Adam
PS: it's "ColdFusion", not "Cold Fusion". Not that it really matters 🙂
Find more inspiration, events, and resources on the new Adobe Community
Explore Now