가능한 중복 :
Query Syntax error삽입 문 where 절
내가 아래 명령
DoCmd.RunSQL = "insert into tblContract(
Empid,
Start1,
Finish1,
Store1,
Start2,
Finish2,
Store2)
values ('" & Me.txtEmpNo.Value & "','"
& Me.txtContSunStart1.Value & "', '"
& Me.txtContSunFinish1.Value & "','"
& Me.txtContSunStore1.Value & "','"
& Me.txtContSunStart2.Value & "', '"
& Me.txtContSunFinish2.Value & "','"
& Me.txtContSunStore2.Value & "')"
를 사용하여 삽입 값을 원하는 그러나 삽입하는 동안이 곳 값 행에 삽입해야 같은 테이블에있는 열 (testid)은 다른 테이블의 max (testid)입니다. 작동하지
이 쿼리 :
SQL은 = & Me.txtEmpNo.Value &을 " '" INSERT INTO tblContract은 (EMPID는 testid를가 Start1는 Finish1은 상점 만들기, START2, Finish2, 상점 2가) SELECT " MAX (testid를) ' "& Me.txtContSunStart1.Value &' ',' '& Me.txtContSunFinish1.Value &' ',' '& Me.txtContSunStore1.Value &' ',' '& Me.txtContSunStart2. 값 & " ',' "& Me.txtContSunFinish2.Value & '', ''& Me.txtContSunStore2.Value &" ' "& "tbltesting FROM' "
나는 이것에 대한 대안을 발견하고있다. ms 액세스에서 컴파일 오류가 발생합니다.
당신이 의미하는 바를 약간 명확하게해야합니다 ... 존재하는 행에 아무 것도 삽입 할 수 없으므로 업데이트됩니다. – Guffa
http://stackoverflow.com/questions/1119246/query-syntax-error 정확한 복제물 – gbn
스토어드 프로 시저 또는 매개 변수가있는 쿼리를보고 싶을 수도 있습니다. 특히 공개 직면 인 경우 매우 안전합니다. SQL 주입 공격. –