delphi7 SQL语句之insert into问题
1个回答
展开全部
动态构山渗建的插入表表名以及字段名两边不要加单引号,
改成下面这样试试
adoquery1.sql.text
:=
'insert
into
'
+
trim(edttimerecordstable.text)
+
'
('
+
trim(edtcard_id.text)
+
','
+
trim(edtmark.text)
+
','
+
trim(edtsign_time.text)
+
','
+
trim(edtclock_id.text)
+
','
+
trim(edtreckinds.text)
+
','
+
trim(edtrecordid.text)
+
')
values
('
+
''''
+
(inttostr(strtoint(copy(list.strings[i],
1,
10))))
+
''','''
+
(copy(copy(list.strings[i],
16,
8),
1,
4)
+
'-'
+
copy
(copy(list.strings[i],
16,
8),
5,
2)
+
'-'好盯
+
copy(copy(list.strings[i],
16,
8),
7,
2))
+
''','''
+
copy(list.strings[i],
11,
5)
+
''','''
+
copy(list.strings[i],
24,
2)
+
''',10,'''友唯和
+
(copy(copy(list.strings[i],
16,
8),
1,
4)
+
'-'
+
copy(copy(list.strings[i],
16,
8),
5,
2)
+
'-'
+
copy
(copy(list.strings[i],
16,
8),
7,
2))
+
'
'
+
copy
(list.strings[i],
11,
5)
+
''')';
改成下面这样试试
adoquery1.sql.text
:=
'insert
into
'
+
trim(edttimerecordstable.text)
+
'
('
+
trim(edtcard_id.text)
+
','
+
trim(edtmark.text)
+
','
+
trim(edtsign_time.text)
+
','
+
trim(edtclock_id.text)
+
','
+
trim(edtreckinds.text)
+
','
+
trim(edtrecordid.text)
+
')
values
('
+
''''
+
(inttostr(strtoint(copy(list.strings[i],
1,
10))))
+
''','''
+
(copy(copy(list.strings[i],
16,
8),
1,
4)
+
'-'
+
copy
(copy(list.strings[i],
16,
8),
5,
2)
+
'-'好盯
+
copy(copy(list.strings[i],
16,
8),
7,
2))
+
''','''
+
copy(list.strings[i],
11,
5)
+
''','''
+
copy(list.strings[i],
24,
2)
+
''',10,'''友唯和
+
(copy(copy(list.strings[i],
16,
8),
1,
4)
+
'-'
+
copy(copy(list.strings[i],
16,
8),
5,
2)
+
'-'
+
copy
(copy(list.strings[i],
16,
8),
7,
2))
+
'
'
+
copy
(list.strings[i],
11,
5)
+
''')';
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询