p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Inserting a boolean in Access 2000


Message #1 by "David" <iluvwilai@h...> on Thu, 26 Apr 2001 16:05:48
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