Hi all,, I have the following SQL statements...one of them has an error saying :Microsoft OLE DB Provider for SQL Server error '80040e14'
Line 1: Incorrect syntax near ' AND Town='. ************Statement 1************** sCheckSQL = "SELECT * From LearnerDetails WHERE Title='" & sTitle & "' AND FName='" & sFName & "' AND LName='" & sLName & "' AND Add1='" & sAdd1 & "' AND Town='" & sTown & "' AND County='" & sCounty & "' AND PostCode='" & sPostCode & "' AND CurrentlyEmployed='" & sCurrentlyEmployed & "' AND TelPref='" & sTelPref & "' AND TelMobile='" & sTelMobile & "' AND Email='" & sEmail & "' AND SourceOfEnquiry=" & sSourceofEnquiry & " AND EnqTakenBy=" & sEnqTakenBy & " AND Status='" & sStatus & "' AND Notes='" & sNotes & "'" *******************Statement 2***********************8 strSQLDB1 = "INSERT INTO LearnerDetails (Title,FName,LName,Add1,Add2,Town,County,PostCode,CurrentlyEmployed,TelPref,TelOth,TelMobile,Email,SourceOfEnquiry,EnqTakenBy,DOB,Status) VALUES ('" & sTitle & "','" & escape(sFName) & "','" & sLName & "','" & sAdd1 & "','" & escape(sAdd2) & "','" & sTown & "','" & sCounty & "','" & sPostCode & "','" & sCurrentlyEmployed & "','" & sTelPref & "','" & escape(sTelOther) & "','" & sTelMobile & "','" & sEmail & "'," & sSourceOfEnquiry & "," & sEnqTakenBy & "," & sDOB & ",'" & "sStatus" & "')" ***************Statement 3 sLearnerSQL = "SELECT * From LearnerDetails WHERE Title='" & sTitle & "' AND FName='" & sFName & "' AND LName='" & sLName & "' AND Add1='" & sAdd1 & "' " & sAdd2 & "' AND Town='" & sTown & "' AND County='" & sCounty &"' AND PostCode='" & sPostCode & "' AND CurrentlyEmployed='" & sCurrentlyEmployed & "' AND TelPref='" & sTelPref & "' AND TelOther='" & sTelOther & "' AND TelMobile='" & sTelMobile & "' AND Email='" & sEmail & "' AND SourceOfEnquiry=" & sSourceofEnquiry & " AND EnqTakenBy=" & sEnqTakenBy & " AND DOB=" & sDOB & " AND Status='" & sStatus & "' AND Notes='" & sNotes --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php