473,320 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to insert data into yes/no field

I'm used to SQL Server, but for a project working at home, have to use
Access. On the ASP form, I have some text fields and some checkboxes, and
the text fields work fine. The checkboxes give me errors, though. I'm doing
this from memory, but I beleive the data said I was putting the wrong type
of data into the field.

The HTML for the checkbox is
<input type="checkbox" name="whatever" value="yes">

In Access' design view, the field is clearly a YES/NO field.

When I do a response.write, I get something like
INSERT INTO Tablename (FName,LName,Whatever) VALUES ("Joe","Dirt","yes"),
where the first two fields are text fields and the last one is the field
which is giving me problems.

Do I have to change this to "ON/OFF"? Any other reason I could be having
this trouble?
Jul 19 '05 #1
6 18212
For Access, send -1 (yes/true/affirmative/whatever) and 0
(no/nada/zippo/false)
"middletree" <mi********@htomail.com> wrote in message
news:#X**************@tk2msftngp13.phx.gbl...
I'm used to SQL Server, but for a project working at home, have to use
Access. On the ASP form, I have some text fields and some checkboxes, and
the text fields work fine. The checkboxes give me errors, though. I'm doing this from memory, but I beleive the data said I was putting the wrong type
of data into the field.

The HTML for the checkbox is
<input type="checkbox" name="whatever" value="yes">

In Access' design view, the field is clearly a YES/NO field.

When I do a response.write, I get something like
INSERT INTO Tablename (FName,LName,Whatever) VALUES ("Joe","Dirt","yes"),
where the first two fields are text fields and the last one is the field
which is giving me problems.

Do I have to change this to "ON/OFF"? Any other reason I could be having
this trouble?

Jul 19 '05 #2
Thanks. Kind of makes me wonder why Access gives you the choice of
specifying YES/NO or the other alternatives, though.
"William Morris" <se***************@hotmail.com> wrote in message
news:bo*************@ID-205671.news.uni-berlin.de...
For Access, send -1 (yes/true/affirmative/whatever) and 0
(no/nada/zippo/false)
"middletree" <mi********@htomail.com> wrote in message
news:#X**************@tk2msftngp13.phx.gbl...
I'm used to SQL Server, but for a project working at home, have to use
Access. On the ASP form, I have some text fields and some checkboxes, and the text fields work fine. The checkboxes give me errors, though. I'm

doing
this from memory, but I beleive the data said I was putting the wrong type of data into the field.

The HTML for the checkbox is
<input type="checkbox" name="whatever" value="yes">

In Access' design view, the field is clearly a YES/NO field.

When I do a response.write, I get something like
INSERT INTO Tablename (FName,LName,Whatever) VALUES ("Joe","Dirt","yes"), where the first two fields are text fields and the last one is the field
which is giving me problems.

Do I have to change this to "ON/OFF"? Any other reason I could be having this trouble?


Jul 19 '05 #3
Because Access is friendly like that. You can also use TRUE/FALSE. Using
0/1 is the way to go though, as when you upgrade to SQL Server, there will
less code to update if you have SQL queries in your ASP pages.

Ray at work

"middletree" <mi********@htomail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Thanks. Kind of makes me wonder why Access gives you the choice of
specifying YES/NO or the other alternatives, though.

Jul 19 '05 #4
Partly because Access was designed for people programming in a bubble, with
little hope of ever breaking free. :-)

Also, if it were more scalable and behaved more like a real database, sales
for SQL Server would go down considerably.

"middletree" <mi********@htomail.com> wrote in message
news:#t**************@TK2MSFTNGP12.phx.gbl...
Thanks. Kind of makes me wonder why Access gives you the choice of
specifying YES/NO or the other alternatives, though.

Jul 19 '05 #5
On Fri, 7 Nov 2003 10:51:17 -0600, "middletree"
<mi********@htomail.com> wrote:
I'm used to SQL Server, but for a project working at home, have to use
Access. On the ASP form, I have some text fields and some checkboxes, and
the text fields work fine. The checkboxes give me errors, though. I'm doing
this from memory, but I beleive the data said I was putting the wrong type
of data into the field.

The HTML for the checkbox is
<input type="checkbox" name="whatever" value="yes">

In Access' design view, the field is clearly a YES/NO field.

When I do a response.write, I get something like
INSERT INTO Tablename (FName,LName,Whatever) VALUES ("Joe","Dirt","yes"),
where the first two fields are text fields and the last one is the field
which is giving me problems.

Do I have to change this to "ON/OFF"? Any other reason I could be having
this trouble?


In SQL Server, you use 1 and 0 because the field is a "bit" type. In
Access, it is a boolean (even though they call in Yes/No and show the
words sometimes. Use boolean values...

VALUES ('Joe', 'Dirt', true)

Jul 19 '05 #6

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Partly because Access was designed for people programming in a bubble, with little hope of ever breaking free. :-)

Hey, I resemble that! Seriously, this is the only form on a non-profit
site, and paying $25 per month extra for SQL Server doesn't make sense. In
this case.

Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tavish Muldoon | last post by:
What a pain trying to insert data into a table from a stored proc. My webform asks for 16 pieces of data - which then gets written to the database. I found this easier than the crap below...
0
by: Mamatha | last post by:
Hi When i clicked a button, i want to insert data from listview in VB.NET to Excel sheet. If you know the solution either above or below is ok for me. I know how to insert from a textfile,but...
1
by: BigLebowski | last post by:
Hi all, I have to insert in a data field a value composed by a date and a time, that are stored in another table my problem is that the date is in a field (a data field) and the time in another...
1
by: reagen | last post by:
dear all, please help me that my script cannot insert data to ms acces. <%@ Page Language="vb" ContentType="text/html"%> <%@ Import NameSpace = "System.Data" %> <%@ Import NameSpace =...
0
by: danishce | last post by:
Hello, I want to insert data directly into my windows form data grid and load a combobox(userid) in the 1st column of data grid,a textbox(password) in 2nd column of datagrid. The code for insert...
1
by: ashik478 | last post by:
Hi! I have a problem. I have a table in oracle database with one field is primary key. Now I want to insert data from Datagridview with hide column which contain not null field(this field is...
2
by: tezza98 | last post by:
Hi im creating a function to insert data from a MYOB file into an Access database. what im trying to do is copy entire tables from MYOB into ACCESS. Im using a simple Access Database with so there...
0
by: Tequilaman | last post by:
Has anybody here every created a program to insert data from a csv into a webform, including a click to a 'go on' button and choosing in dropdowns according to the information in the csv? I'm...
3
by: SMusic | last post by:
Can anyone find me a solution. I want to import csv file into mysql database. I have the code to insert.But the rows that contains comma in data field is not getting inserted and is skipped.All the...
0
by: brianrpsgt1 | last post by:
I am attempting to insert data from a HTML form using a .psp script. I can not find how to link the data that is inserted into the form to the variables in the .psp script to then insert into the...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.