SQL INSERT INTO syntax

H

Haroon

hi

i am trying to insert data from bookmarks on document into database,
however, i have yes/no option in access database, but i can't get the data to
be inserted in that column.

anyone know how to overcome this problem?

cheers.
 
D

Doug Robbins - Word MVP

Yes will be -1; No will be 0

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
H

Haroon

Thanks Doug, your a star *

Doug Robbins - Word MVP said:
Yes will be -1; No will be 0

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
H

Haroon

Doug,
i have a problem, i added another field after the yes/no field, but the sql
gives error,

my sql statement ends like this:
", 0 " & strPaid & ")"

error is:
run-time error '-2147217900 (80040e14)'
syntax error (missing operator) in query expression '0' '-".

how do i fix this?
 
P

Peter Jamieson

My guess is that you now have something like

INSERT INTO mytable (cola,colb,colc)
VALUE (vala, 0 valc)

when what you need is

INSERT INTO mytable (cola,colb,colc)
VALUE (vala, 0, valc)

You would probably get that by ending your SQL statement with

", 0, " & strPaid & ")"

Peter Jamieson

http://tips.pjmsn.me.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top