473,795 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,Wh atever) 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 18260
For Access, send -1 (yes/true/affirmative/whatever) and 0
(no/nada/zippo/false)
"middletree " <mi********@hto mail.com> wrote in message
news:#X******** ******@tk2msftn gp13.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,Wh atever) 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********@hto mail.com> wrote in message
news:#X******** ******@tk2msftn gp13.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,Wh atever) 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********@hto mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.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********@hto mail.com> wrote in message
news:#t******** ******@TK2MSFTN GP12.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********@hto mail.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,Wh atever) 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***@TRASHasp faq.com> wrote in message
news:e1******** ******@TK2MSFTN GP11.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
4202
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 (after the ***********). This was eaiser: get a list of all the parameters you want to pass - put them in a string:
0
10518
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 all data of textfile inserted into only into a single cell.I want to insert single line of text file for each cell. I tried to insert data into Excel sheet in many ways but
1
1802
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 (a varchar2 field). I've tried to concatenate as strings and convert with to_date but it gave me an error. How can I do? Thank u very much.
1
1844
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 = "System.Data.OleDb" %> <script runat="server"> Sub Insert_Btn (s As Object, e As EventArgs)
0
2203
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 data is: dim cmd as new oledbcommand("insert into table(userid,password) values('" & cmbcol1.text & "','" & txtcol2.text & "')",connection) dim da as new oledbdataadapter dim ds as new dataset da.selectcommand=cmd da.fill(ds) messagebox.show...
1
2705
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 autogenerated). Pls anyone help me. Thanks
2
7168
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 is no back end, the table are part of the front end i have a button to run this code Private Sub Command0_Click() Dim oRS As ADODB.Recordset Dim DSN As String
0
917
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 trying something like this, based on an existing prog. sadly the prog is in C# which I don't know. Now I try to rebuild that in visual basic and build in the new functionality. I mainly run into problems how to choose from the pulldowns and click the 'go...
3
2689
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 other rows are inserted. This is the code that i have.. @mysql_close($con); $con = mysql_connect("$hostname","$user","$pass") or die("did'nt connect to mysql"); mysql_select_db("test") or die ("no database"); $databasetable = "$file3"; $lines...
0
3357
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 MySQL Insert statement. I am familiar with PHP, where you would write $_POST(), however I can not find the equivalent in PSP. I believe that this is the my missing piece. Technically, what is occurring that that when I click the 'Submit'...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10217
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7544
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6784
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2922
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.