使用ASP将复选框插入MS Access [英] Inserting checkbox into MS Access using ASP

查看:51
本文介绍了使用ASP将复选框插入MS Access的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨Mark et All,


我知道你创建了一个非常专业的文档和一个类似的问题论坛,关于使用ASP将复选框值插入到MS Access中;我对这些东西很新,已经尝试了几次但没有运气。很抱歉浪费你的时间,但如果你可以帮助我,我将不胜感激。


我有一个复选框名称为ExpeditedRequest的表单。我无法使用ASP将未经检查或已检查的值发送到MS Access。顺便说一下,表单上的所有内容都插入到MS Access OK中,没有复选框。


以下是我的信息。


Tform.asp(带有复选框的表单):


< INPUT TYPE =" Checkbox" NAME =" ExpeditedRequest" ID =" ExpeditedRequest">


MS Access数据库:


字段名称:ExpeditedRequest数据类型:是/否默认值(在常规下) :0和必需:否


AddProject.asp(此文件将从Tform.asp获取信息并发送到MS Access)。应该有更多其他字段,但我只想剪切和粘贴ExpeditedRequest的部分。

Hi Mark et All,

I understand that you created a very professional document and a similar issue forum out there regarding to Inserting the checkbox value into MS Access using ASP however; I am so new to this stuff and have tried couple times but no luck. Sorry to waste your time again, but would appreciate if you can help me out.

I have a form that has a checkbox name of ExpeditedRequest. I can''t send the unchecked or checked value to the MS Access using ASP. By the way, everything on the form is inserted into the MS Access OK without the checkbox.

Below is the information that I have.

Tform.asp (the form that has a checkbox):

<INPUT TYPE="Checkbox" NAME="ExpeditedRequest" ID="ExpeditedRequest">

MS Access Database:

Fieldname: ExpeditedRequest DataType: Yes/No Default Value (under General): 0 and Required: No

AddProject.asp (this file will take the information from the Tform.asp and send to the MS Access). There should be more other fields but I just want to cut and paste the portion for the ExpeditedRequest only.

展开 | 选择 | Wrap | 行号

推荐答案

您的代码对我来说很好。真的很快就试试这个:
Your code looks good to me. Really quickly try this:
展开 | 选择 | Wrap | 行号


嗨Jared,


谢谢你救命。我收到您的答复后花了几个小时。取得了一些进展,看起来我可能需要你的ASP专业知识。


1.我将AddProject.asp文件中的IF语句更改为以下内容。我使用了
" -1"如果Request.Form(" ExpeditedRequest")=" On",则它不起作用。


那么

strExpeditedRequest =" 1"

否则

strExpeditedRequest =" 0"

结束如果


2.我将ExpeditedRequest字段的MS Access格式更改为格式:开/关。所以这个字段现在应该是ExpeditedRequest DataType:Yes / No默认值(在General下):0和Format:On / Off。


我现在可以将条目添加到MS Access数据库确定是否选中该复选框。然而;如果复选框是CHECKED,则MS Access中的ExpeditedRequest字段仍未显示。


我是否需要修改ExpeditedRequest的SQL INSERT语句或其他内容以使其检查数据库如果复选框是CHECKED?


这真的很难,如果你可以帮助我,我将非常感激。
Hi Jared,

Thanks for your help. I spent couple hours after I received your replied. Made some progress and it looks like I might need your ASP expertise here.

1. I changed the IF statement in the AddProject.asp file to the following. I
used "-1" and it does not work.

If Request.Form("ExpeditedRequest") = "On" Then
strExpeditedRequest = "1"
Else
strExpeditedRequest = "0"
End If

2. I changed the MS Access format for the ExpeditedRequest field to Format: On/Off. So this field now should be ExpeditedRequest DataType: Yes/No Default Value (under General): 0 and Format: On/Off.

I can now add the entry to the MS Access database OK whether the checkbox is checked or not. HOWEVER; if the checkbox is CHECKED, the ExpeditedRequest field in the MS Access still show not checked.

Do I need to modify my SQL INSERT statement for the ExpeditedRequest or something to make it checked on the database if the checkbox is CHECKED?

This is really a tough one and I would very much appreciate if you can help me out here.


显示一些代码,特别是在打开记录集之后,直到完成使用db。我想你可能会把事情搞得一团糟。


Jared
show a little more of your code, specifically after you open the recordset until you are finished using the db. I think you might have things out of order.

Jared


这篇关于使用ASP将复选框插入MS Access的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆