pseudo code:
conn.begintrans
do until....
rs.seek VAR, 1
if rs.eof then
conn.execute "insert into table filed1=''" & myvar & "'''
end if
loop
conn.commistrans
prob!!!! the insert statement dont update the filed!
note:
- i have the a primary key without duplicate in filed1
- the until ....loop is refered to read line by line a txt file
- is a seek ado
in this case have error "not possible to insert a duplicate value ...ecc"
peraph the insert statement is effective only when the code go in commitrans?
seek and update
-
- Administrator
- Posts: 78625
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: seek and update
The syntax for INSERT INTO with literal values is
INSERT INTO tablename (field1, field2, ...) VALUES (value1, value2, ...)
So change the line
to
INSERT INTO tablename (field1, field2, ...) VALUES (value1, value2, ...)
So change the line
Code: Select all
conn.execute "insert into table filed1=''" & myvar & "'''
Code: Select all
conn.Execute "INSERT INTO table (filed1) VALUES ('" & myvar & "')"
Best wishes,
Hans
Hans