![]() |
OLE JET and Booleans
I seem to be having an unresolvable problem with an ASP page (darned typeless scripting engines) and JET datatypes. Don't ask why we are using JET, let's just say it has something to do with LEGACY CRAP used by hundreds of dealers scattered over the US. The MDB has two boolean fields and when trying to add new records with the INSERT INTO execute method, it dies. All works well with strings, but not with booleans. Booleans are retrieved from the WebPage with ASP using: strTaxable=request.form("Taxable") These values can be 0 and 1. Then we use : set objparam=cm.createparameter(, adBoolean, , , cbool(strTaxable)) cm.parameters.append objparam Crashes every time - no error number, just a vague error message that there is a syntax error in the JET INSERT INTO statement... However, the same code more or less works using the ODBDC drivers - which we are trying to avoid. Any ideas? Dr. Know |
Re: OLE JET and Booleans
Just a guess, but instead of using cbool(strTaxTable) try cInt(strTaxTable).
"Dr. Know" <DrKnow@electron.com> wrote in message news:8u7rt0hcmr8hctmlqljomjc9ql568fci3n@4ax.com... I seem to be having an unresolvable problem with an ASP page (darned typeless scripting engines) and JET datatypes. Don't ask why we are using JET, let's just say it has something to do with LEGACY CRAP used by hundreds of dealers scattered over the US. The MDB has two boolean fields and when trying to add new records with the INSERT INTO execute method, it dies. All works well with strings, but not with booleans. Booleans are retrieved from the WebPage with ASP using: strTaxable=request.form("Taxable") These values can be 0 and 1. Then we use : set objparam=cm.createparameter(, adBoolean, , , cbool(strTaxable)) cm.parameters.append objparam Crashes every time - no error number, just a vague error message that there is a syntax error in the JET INSERT INTO statement... However, the same code more or less works using the ODBDC drivers - which we are trying to avoid. Any ideas? Dr. Know |
Re: OLE JET and Booleans
Dr. Know wrote:
> I seem to be having an unresolvable problem with an ASP page (darned > typeless scripting engines) and JET datatypes. Don't ask why we are > using JET, let's just say it has something to do with LEGACY CRAP used > by hundreds of dealers scattered over the US. > > The MDB has two boolean fields and when trying to add new records with > the INSERT INTO execute method, it dies. > > All works well with strings, but not with booleans. > > Booleans are retrieved from the WebPage with ASP using: > > strTaxable=request.form("Taxable") > These values can be 0 and 1. > > Then we use : > > set objparam=cm.createparameter(, adBoolean, , , cbool(strTaxable)) > cm.parameters.append objparam > > Crashes every time - no error number, just a vague error message that > there is a syntax error in the JET INSERT INTO statement... > > However, the same code more or less works using the ODBDC drivers - > which we are trying to avoid. > > Any ideas? > > > Dr. Know The values for the Yes/No field in Access are either 0 or -1. Is Request.Form("taxable") a checkbox? If it is, then no value will be passed if it is unchecked. Morris |
Re: OLE JET and Booleans
Dr. Know wrote:
> I seem to be having an unresolvable problem with an ASP page (darned > typeless scripting engines) and JET datatypes. Don't ask why we are > using JET, let's just say it has something to do with LEGACY CRAP used > by hundreds of dealers scattered over the US. > > The MDB has two boolean fields and when trying to add new records with > the INSERT INTO execute method, it dies. > > All works well with strings, but not with booleans. > > Booleans are retrieved from the WebPage with ASP using: > > strTaxable=request.form("Taxable") > These values can be 0 and 1. > > Then we use : > > set objparam=cm.createparameter(, adBoolean, , , cbool(strTaxable)) > cm.parameters.append objparam There is no reason to use a Command object unless you are executing a parameterized dynamic sql statement. Could we see a little more code please? just the code used to populate and run the Command parameters and settings - we don't need to see any html. > > Crashes every time - no error number, just a vague error message that > there is a syntax error in the JET INSERT INTO statement... > > However, the same code more or less works using the ODBDC drivers - > which we are trying to avoid. > This sounds like an issue with a reserved keyword. Are you executing a parameterized dynamic sql statement? Or a saved parameter query? Check your field names against the list of reserved keywords found here: http://www.aspfaq.com/show.asp?id=2080 -- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM" |
Re: OLE JET and Booleans
Bob Barrows [MVP] said:
>This sounds like an issue with a reserved keyword. Are you executing a >parameterized dynamic sql statement? Or a saved parameter query? > >Check your field names against the list of reserved keywords found here: >http://www.aspfaq.com/show.asp?id=2080 You were right on the money! I discovered the problem some time after I posted the original plea for help. Removed fields one at a time until the bad one popped up. What a pain... Discovered the field name [Password] in the original table - which cannot be re-designed. The list you supplied the link to has taken up permanent residence in my ever growing collection of bizarre errata. This stuff is support work for an antiquated X-base accounting system which still has no GUI, and uses Telnet for communication with the outside world. The tables cannot be changed or redesigned. Personally, I'd rather see them using a comprehensive SQL solution... They've already added 3rd party online ordering systems, reporting systems, etc. It's One Big Kludge. cha-ching... Now if I could just get Provider=vfpoledb;Data Source=C:\xxx\xxxx\" to work in ASP. Works in Access and VB, but not ASP. :-| Thanks, Greg Dr. Know |
| All times are GMT. The time now is 02:26 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.