|
Juxtar -> SQL Code, INSERT INTO Error 80040e14 (10/22/2003 17:07:20)
|
Hi, I have a form that should insert a survey response into an access database and send an email. The email works fine, but I can't get the "INSERT INTO" code to work it gives me the following error: Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. ++++ I'm sure it's simple and just my overlooked eye. But here's the code Dim myConnString Dim myConnection Dim mySQL myConnString = Application("military_faculty_survey_DB_ConnectionString") Set myConnection = Server.CreateObject("ADODB.Connection") myConnection.Open myConnString //sql3 = "INSERT INTO testing_tbl (test_name, test_animal) VALUES ('dudette', 'cat')" //sql2 = "INSERT INTO military_faculty_survey_tbl (last_name, first_name, email, home_phone, work_phone, company_name, job_title, branch, rank, locations, status, associations) VALUES ('brady', 'Geoff', 'gpbrady@apollogrp.edu', 'hm phone', 'wk phone', 'comp name', 'job title', 'Navy', 'Captain', 'alaska', 'Active', 'boy scouts'" mySQL = "INSERT INTO military_faculty_survey_tbl " mySQL = mySQL & "(last_name, first_name, email, home_phone, work_phone, company_name, job_title, military_service, branch, rank, locations, status, associations) " mySQL = mySQL & "VALUES ('" & Request.Form("last_name") & "', '" mySQL = mySQL & Request.Form("first_name") & "', '" mySQL = mySQL & Request.Form("email") & "', '" mySQL = mySQL & Request.Form("home_phone") & "', '" mySQL = mySQL & Request.Form("work_phone") & "', '" mySQL = mySQL & Request.Form("company_name") & "', '" mySQL = mySQL & Request.Form("job_title") & "', '" mySQL = mySQL & Request.Form("military_service") & "', '" mySQL = mySQL & Request.Form("branch") & "', '" mySQL = mySQL & Request.Form("rank") & "', '" mySQL = mySQL & Request.Form("locations") & "', '" mySQL = mySQL & Request.Form("status") & "', '" mySQL = mySQL & Request.Form("associations") & "'" myConnection.Execute mySQL myConnection.Close Set myConnection = Nothing I've tried different things. The other SQL statments (in blue) are tests. The first one (sql3) works so I know my connect string is good. The other sql2, (basically hard coded mysql) has same issues. What gives? Jux
|
|
|
|