|
-
Jun 5th, 2005, 03:51 PM
#1
Thread Starter
Member
Inserting into Access Yes/No Field [Resolved]
I'm trying to insert a new row into a table and one of the fields I want to insert into is a Yes/No. I've tried inserting "Yes", "True", "Y". I get datatype mismatch each time. If I take it out of the statement, it works fine, so I know that is the problem field.
Code:
activeswitch = "True"
Dim projectInsertFormat As String = "INSERT INTO project (CCN, ProjectName, Active, ActiveDate) " & _
"VALUES('{0}', '{1}', '{2}', '{3}')"
Dim projectInsert As String
projectInsert = String.Format(projectInsertFormat, _
txtccn.Text, _
txtproject.Text, _
activeswitch, _
datehold)
Active is the Yes/No Field in the DB. How should I recode this insert statement? Should the variable be string? Thanks.
Last edited by rabaile; Jun 5th, 2005 at 08:04 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|