|
| |
|
|
Juxtar
Posts: 11 Joined: 6/25/2003 Status: offline
|
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
_____________________________
All your base are belong to us! FOOL!
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: SQL Code, INSERT INTO Error 80040e14 - 10/22/2003 18:01:59
mySQL = "INSERT INTO military_faculty_survey_tbl (last_name, first_name, email, home_phone, work_phone, company_name, job_title, military_service, branch, rank, locations, status, associations) VALUES ('::last_name::', '::first_name::', '::email::', '::home_phone::', '::work_phone::', '::company_name::', '::job_title::', '::military_service::', ':: branch::', '::rank::', '::locations::', '::status::', '::associations::') Are any of these fields numeric? If so replace that field with ::yourfield:: instead.
< Message edited by Long Island Lune -- 10/22/2003 6:02:35 PM >
_____________________________
|
|
|
|
Juxtar
Posts: 11 Joined: 6/25/2003 Status: offline
|
RE: SQL Code, INSERT INTO Error 80040e14 - 10/22/2003 18:25:46
I actually solved it. I was missing a parentases ) at the end. I only found it by taking out each line at a time. thanks for your help though.
_____________________________
All your base are belong to us! FOOL!
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: SQL Code, INSERT INTO Error 80040e14 - 10/22/2003 21:18:08
Cheers!!! Welcome to the forum.
_____________________________
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|