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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

undefined variable

Status
Not open for further replies.

trsnet

Programmer
Mar 29, 2006
1
US
I'm receiving an error that is driving me insane.
Here's the details. I have a cold fusion/SQL form that when the user clicks the submit button three things happen:
1. The information is entered into an Access database
2. An email is automatically sent to me
3. The user is taken to a "thanks" page

The first two things work great!
But the thanks page s giving me this error (below - I left out my username/password info...it is in my query though)!

Can anyone help? I have a feeling I'm missing some basic syntax.


Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '1233 Moon St'.

The error occurred in D:\INETPUB\peer-projects\surveys\thanks.cfm: line 82

80 : <cfquery name="Qs">
81 : INSERT INTO SSG (Fname, Lname, dob, P1Fname, P1Lname, P2Fname, P2Lname, Address1, City1, Hphone1, Cphone1, Email1, Address2, City2, Hphone2, Cphone2, Email2, HIprovider, State1, Zip1, State2, Zip2, A1, A2, A3, A4, A5, A6, A7, A8, A9)
82 : VALUES (#Fname#, #Lname#, #dob#, #P1Fname#, #P1Lname#, #P2Fname#, #P2Lname#, #Address1#, #City1#, #Hphone1#, #Cphone1#, #Email1#, #Address2#, #City2#, #Hphone2#, #Cphone2#, #Email2#, #HIprovider#, #State1#, #Zip1#, #State2#, #Zip2#, #A1#, #A2#, #A3#, #A4#, #A5#, #A6#, #A7#, #A8#, #A9#);
83 : </cfquery>
84 :

SQL INSERT INTO SSG (Fname, Lname, dob, P1Fname, P1Lname, P2Fname, P2Lname, Address1, City1, Hphone1, Cphone1, Email1, Address2, City2, Hphone2, Cphone2, Email2, HIprovider, State1, Zip1, State2, Zip2, A1, A2, A3, A4, A5, A6, A7, A8, A9) VALUES (Morkaabbsa, Orkaaa, 12/13/1998, Zork, Ork, Orka, Ork, 1233 Moon St, Dedham, 781-245-9322, 781-234-2321, ork@ork.com, , , , , , Blue Shield, MA, 02345, , , home school with two other students, no therapy, typical peers and playdates, sometimes., when they don''t pick on him they are good, not good in front of crowds, deep breaths, become an extrovert, not yet);
DATASOURCE peerprj
VENDORERRORCODE -3100
SQLSTATE 42000
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.8.0.1) Gecko/20060111 Firefox/1.5.0.1
Remote Address 24.60.161.3
Referrer Date/Time 29-Mar-06 07:28 PM
Stack Trace
at cfthanks2ecfm1667414614.runPage(D:\INETPUB\peer-projects\surveys\thanks.cfm:82) at cfthanks2ecfm1667414614.runPage(D:\INETPUB\peer-projects\surveys\thanks.cfm:82)

java.sql.SQLException: [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '1233 Moon St'.
at macromedia.sequelink.ssp.Diagnostic.toSQLException(Unknown Source)
at macromedia.sequelink.ssp.Chain.cnvDiagnostics(Unknown Source)
at macromedia.sequelink.ssp.Chain.decodeDiagnostic(Unknown Source)
at macromedia.sequelink.ssp.Chain.decodeBody(Unknown Source)
at macromedia.sequelink.ssp.Chain.decode(Unknown Source)
at macromedia.sequelink.ssp.Chain.send(Unknown Source)
at macromedia.sequelink.ctxt.stmt.StatementContext.execDirect(Unknown Source)
at macromedia.jdbc.sequelink.SequeLinkImplStatement.execute(Unknown Source)
at macromedia.jdbc.slbase.BaseStatement.commonExecute(Unknown Source)
at macromedia.jdbc.slbase.BaseStatement.executeInternal(Unknown Source)
at macromedia.jdbc.slbase.BaseStatement.execute(Unknown Source)
at coldfusion.server.j2ee.sql.JRunStatement.execute(JRunStatement.java:212)
at coldfusion.sql.Executive.executeQuery(Executive.java:719)
at coldfusion.sql.Executive.executeQuery(Executive.java:652)
at coldfusion.sql.Executive.executeQuery(Executive.java:613)
at coldfusion.sql.SqlImpl.execute(SqlImpl.java:236)
at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:499)
at cfthanks2ecfm1667414614.runPage(D:\INETPUB\peer-projects\surveys\thanks.cfm:82)
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:209)
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.FilterChain.doFilter(FilterChain.java:86)
at com.seefusion.Filter.doFilter(Filter.java:40)
at com.seefusion.SeeFusion.doFilter(SeeFusion.java:1160)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
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)
 
You have to add delimiters around your text and date values in the insert statement like:
Code:
VALUES ('#Fname#', '#Lname#', ###dob###, '#P1Fname#', '#P1Lname#', '#P2Fname#',...);

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top