p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: AW: Inserting a boolean in Access 2000


Message #1 by "Michael Drozdzowicz" <bandit@g...> on Fri, 27 Apr 2001 00:12:58 +0200
Why inserting boolean?
Make it boolean when it comes up on the page first.

if u cant, try other code:

instead of:
blnSingle = CBool(Request.Form("single"))

try this:
single=request.form("single")
blnSingle = CBool(single)

cu
Bandit

-----Ursprüngliche Nachricht-----
Von: David [mailto:iluvwilai@h...]
Gesendet: Donnerstag, 26. April 2001 16:06
An: Code Clinic
Betreff: [proasp_codeclinic] Inserting a boolean in Access 2000


Hello All!

I have the hardest time Inserting a boolean in Access 2000.  The datatype
in access is 'True\False' and here is the code:

blnSingle = CBool(Request.Form("single"))

strPart13 = "INSERT INTO tblLinux (MasterRecordID, formnbr, single ) "
strPart14 = "VALUES ('" & strMaster & "', " & intForm & ", '" & blnSingle
& "' )"

strInsert = strPart13 & strPart14


  Set objLinux = Server.CreateObject("ADODB.Command")
  objLinux.ActiveConnection = strConnect
  objLinux.CommandText = strInsert
  objLinux.CommandType=adCmdText
  objLinux.Execute intNoOfRecords
 Response.Write "This Insert command has affected " & _
               intNoOfRecords & " records<BR><BR>"



	Set objLinux = Nothing

I get the error:

Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/tpd/insert/linuxsig.asp, line 117


Putting in single quotes gets the same error.  Inserting without the
boolean results in a successful Insert.

Any Ideas?

Thanks in Advance!

David


  Return to Index