I found this link for differences in CSS in IE 6, 7, and 8:
http://www.smashingmagazine.com/2009/10/14/css-differences-in-internet-explorer-\
6-7-and-8/
I did get caught finding IE 6 & Firefox worked but IE 7 was weird until I did
some stuff. IE 7 doesn't appear to enlarge panels if needed when using .Net
(worked fine in IE 6). Does anyone know if there are other "gotchas" with .Net?
Is there a comparison of different behaviors when using ASP or Javascript? The
company has a standard (IE 6) but is already pushing out the newer versions so
I'd like to be better prepared.
> That may somehow bypass the reserved issue ...
Completely bypasses it. The reserved issue is for the SQL statement syntax,
not the field names themselves.
Regards, Dave S
----- Original Message -----
From: "Mark E" <meckeard2000@...>
To: <active-server-pages@yahoogroups.com>
Sent: Thursday, November 12, 2009 11:46 PM
Subject: Re: [ASP] Bizarre error '80004005'
That makes sense now. A select * doesn't provide the field names. If I
recall correctly, the DB has to look up the * and convert it to the field
names in your table. That may somehow bypass the reserved issue but not when
you explicitly state the field name that's a reserved word.
Odd but we know that sort of this happens.
Glad you got it fixed.
Mark
--- On Thu, 11/12/09, David Smart <smartware.consulting@...> wrote:
From: David Smart <smartware.consulting@...>
Subject: Re: [ASP] Bizarre error '80004005'
To: active-server-pages@yahoogroups.com
Date: Thursday, November 12, 2009, 5:50 AM
> It still doesn't really explain how a "SELECT *" works, which must be
> pulling up a 'Size' field, whereas "SELECT Size" fails... but who am I to
> question a now-deprecated driver!
No, that's not going to present a problem. The problem is with your use of
the Size keyword in your SQL. The actual returning of the Size field (as
part of the Select *) won't confuse the driver.
This page http://www.petefrei tag.com/tools/ sql_reserved_ words_checker/
can
be used to check whether a word is reserved in several database brands
(although not Access, unfortunately) . "Size" shows as reserved in quite a
few brands, including ISO SQL.
This page http://office. microsoft. com/en-us/ access/hp0103224 91033.aspx
gives
you the Access reserved words.
Regards, Dave S
----- Original Message -----
From: "Graeme" <gnwilson2001@ yahoo.com>
To: <active-server- pages@yahoogroup s.com>
Sent: Thursday, November 12, 2009 8:13 PM
Subject: Re: [ASP] Bizarre error '80004005'
> Thanks Dave, and a thank you to everyone who made suggestions.
>
> The annoying thing for me (aside from the 4-5 hours wasted) was that this
> is legacy code that has been running for 6+ years (and in fact is based on
> code I wrote back in 1999 or so...). I simply moved a few things around
> (in this case turned the building of product sizes into a function), and
> changed to the JET database driver instead of the older Access DB driver.
>
> The solution was in have that field name 'Size' is obviously a reserved
> word in the newer JET driver (I say newer with a bit of a laugh, as I read
> that it is also deprecated now...), whereas it worked fine for many years
> using the Access DB driver. Such is life. And the other day I read through
> a list of reserved words for Access, on a Microsoft website, and I never
> spotted 'Size' as a reserved word...
>
> Anyway, I've renamed this field (which will mean updating several 'live'
> databases out there), and things are running again.
>
> It still doesn't really explain how a "SELECT *" works, which must be
> pulling up a 'Size' field, whereas "SELECT Size" fails... but who am I to
> question a now-deprecated driver!
>
> Thanks again to everyone who made suggestions.
>
> Kind Regards,
> Graeme
>
> --- In active-server- pages@yahoogroup s.com, "David Smart"
> <smartware.consulti ng@...> wrote:
>>
>> > ... If I "SELECT *" it works, but it I try to selected a named field.
>> > e.g. "SELECT Code FROM..." then it immediately bombs,
>> > so therefore not related to the "WHERE" clause.
>>
>> I don't think I've ever seen a situation where Select * works but a
>> Select
>> with named fields does not. It really does sound as though your SQL
>> syntax
>> is getting confused when you start specifying fields.
>>
>> Do look carefully at the generated SQL - particularly for missing spaces.
>>
>> However, also try other combinations of field names. Your example was
>> "SELECT Code". Now "Code" is one of those words that is just as likely
>> to
>> be considered a key word. It might be that the DB interface - which DB
>> by
>> the way? - is objecting to a particular word being used as a field name.
>>
>> Ones that leap to my eye as possible keywords are "Size" and particularly
>> "Code". Try doing a select for fields with less "key wordish" names to
>> see
>> if they can be selected OK.
>>
>> (In fact, "Code" and "Size" aren't particularly good column names anyway,
>> IMHO. You should be more specific in column naming, e.g. CatalogueCode,
>> ContainerSize, or whatever.)
>>
>> Regards, Dave S
>>
>> PS This "false keyword" situation is not uncommon and is an instance in
>> which you'll get success though the DB's SQL window and failure from ASP,
>> etc. It should become the first thing to check once you find that your
>> SQL
>> works fine when submitted in the immediate window, but not via ASP.
>>
>> ----- Original Message -----
>> From: "Graeme" <gnwilson2001@ ...>
>> To: <active-server- pages@yahoogroup s.com>
>> Sent: Wednesday, November 11, 2009 6:01 AM
>> Subject: Re: [ASP] Bizarre error '80004005'
>>
>>
>> > Thanks for all the suggestions. Unfortunately it isn't related to any
>> > of
>> > the parts you guys have suggested. If I "SELECT *" it works, but it I
>> > try
>> > to selected a named field. e.g. "SELECT Code FROM..." then it
>> > immediately
>> > bombs, so therefore not related to the "WHERE" clause.
>> >
>> > I spent 4 hours last night trying every combination to get through,
>> > trying
>> > different values for cursor types etc, and nothing. The only 'fix' was
>> > the
>> > SELECT *, which doesn't really do what I want.
>> >
>> > The only other option I found related to '80004005' is to do with
>> > permissions of the file/directory, so I may contact my host to double
>> > check these things, but on a read only statement I can't see that a
>> > problem should/could occur... then again, this is Microsoft ;)
>> >
>> > I will probably try re-writing some of my code to try something else...
>> > I
>> > don't know what right now!
>> >
>> > Cheers,
>> > Graeme
>> >
>> > --- In active-server- pages@yahoogroup s.com, "VisioMVP" <VisioMVP@>
>> > wrote:
>> >>
>> >> Try stepping through the code and see what the value for strSQL is
>> >> when
>> >> you
>> >> are about to run the objRecordset. Open statement.
>> >>
>> >>
>> >>
>> >> John. Visio MVP
>> >>
>> >>
>> >>
>> >> From: active-server- pages@yahoogroup s.com
>> >> [mailto:active-server- pages@yahoogroup s.com] On Behalf Of Graeme
>> >> Sent: November-10- 09 4:46 AM
>> >> To: active-server- pages@yahoogroup s.com
>> >> Subject: [ASP] Bizarre error '80004005'
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> Hi all,
>> >>
>> >> Well, this error has really got me stumped. There is no additional
>> >> information other than: error '80004005' (not even the ever 'useful'
>> >> Unspecified Error)
>> >>
>> >> The piece of code causing the problem is:
>> >>
>> >> Function BuildSize(strPCode, curPrice)
>> >>
>> >> Set objRecordset = Server.CreateObject ("ADODB.Recordse t")
>> >>
>> >> strSQL = "SELECT ProductID, Size, Code, SortCode, Quantity,
>> >> ExtendedDelivery, POA"
>> >> strSQL = strSQL & " FROM tblProducts"
>> >> strSQL = strSQL & " WHERE Online = True AND Code='" & CStr(strPCode) &
>> >> "'
>> >> AND Price=" & CStr(curPrice)
>> >> strSQL = strSQL & " ORDER BY Size;"
>> >>
>> >> objRecordset. Open strSQL, DB_ConnectionString , adOpenForwardOnly,
>> >> adLockReadOnly, adCmdText
>> >>
>> >> ...
>> >>
>> >> End Function
>> >>
>> >> It dies on the "objRecordset. Open" part. The weirdest thing to me is
>> >> that
>> >> if
>> >> I replace the strSQL = "SELECT * FROM tblProducts; " then the error
>> >> disappears (of course it doesn't really provide a solution as to why
>> >> there
>> >> is the error.
>> >>
>> >> Adding ".tblProducts" to the SELECT fields (e.g.
>> >> tblProducts. ProductID)
>> >> doesn't solve the problem.
>> >>
>> >> objRecordset has been used previously, but even if I "Set objRecordset
>> >> =
>> >> Nothing" first, no go. Even if I make a new variable ("Dim
>> >> objRecordset" )
>> >> within this Function, no go. It appears that I'm missing something in
>> >> the
>> >> SQL string, but as I can cut and paste it into an MS Access DB query
>> >> and
>> >> it
>> >> works correctly, I can't see what can possibly be causing the problem!
>> >>
>> >> Any suggestions would be greatly appreciated. This code is adapted
>> >> from
>> >> something I've had online for 6+ years, just updating to
>> >> "Microsoft.Jet. OLEDB.4.0" (which part of the code had been
>> >> overhauled,
>> >> part
>> >> hadn't) ... and so getting a strange error like this is rather
>> >> annoying.
>> >>
>> >> Also, if I cut the code out of the Function, and paste it into the
>> >> main
>> >> code, I get the same error, as does passing hard coded 'variables' for
>> >> strPCode AND curPrice (e.g. replacing them with what the function was
>> >> passing them, e.g. Code='ABC' AND Price=10
>> >>
>> >> Any help would be very much appreciated!
>> >>
>> >> Cheers,
>> >> Graeme
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> [Non-text portions of this message have been removed]
>> >>
>> >
>> >
>> >
>> >
>> > ------------ --------- --------- ------
>> >
>> > ------------ --------- --------- --------- --------- --------- -
>> > Home : http://groups. yahoo.com/ group/active- server-pages
>> > ------------ --------- --------- --------- --------- --------- -
>> > Post : active-server- pages@yahoogroup s.com
>> > Subscribe : active-server- pages-subscribe@ yahoogroups. com
>> > Unsubscribe: active-server- pages-unsubscrib e@yahoogroups. com
>> > ------------ --------- --------- --------- --------- --------- -Yahoo!
>> > Groups Links
>> >
>> >
>> >
>>
>>
>> ------------ --------- --------- --------- --------- --------- -
>>
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 8.5.425 / Virus Database: 270.14.58/2493 - Release Date:
>> 11/09/09
>> 19:40:00
>>
>
>
>
>
> ------------ --------- --------- ------
>
> ------------ --------- --------- --------- --------- --------- -
> Home : http://groups. yahoo.com/ group/active- server-pages
> ------------ --------- --------- --------- --------- --------- -
> Post : active-server- pages@yahoogroup s.com
> Subscribe : active-server- pages-subscribe@ yahoogroups. com
> Unsubscribe: active-server- pages-unsubscrib e@yahoogroups. com
> ------------ --------- --------- --------- --------- --------- -Yahoo!
> Groups Links
>
>
>
------------ --------- --------- --------- --------- --------- -
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.425 / Virus Database: 270.14.61/2497 - Release Date: 11/11/09
19:41:00
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[Non-text portions of this message have been removed]
------------------------------------
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : active-server-pages@yahoogroups.com
Subscribe : active-server-pages-subscribe@yahoogroups.com
Unsubscribe: active-server-pages-unsubscribe@yahoogroups.com
---------------------------------------------------------------------Yahoo!
Groups Links
--------------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.425 / Virus Database: 270.14.61/2497 - Release Date: 11/11/09
19:41:00
That makes sense now. A select * doesn't provide the field names. If I
recall correctly, the DB has to look up the * and convert it to the field names
in your table. That may somehow bypass the reserved issue but not when you
explicitly state the field name that's a reserved word.
Odd but we know that sort of this happens.
Glad you got it fixed.
Mark
--- On Thu, 11/12/09, David Smart <smartware.consulting@...> wrote:
From: David Smart <smartware.consulting@...>
Subject: Re: [ASP] Bizarre error '80004005'
To: active-server-pages@yahoogroups.com
Date: Thursday, November 12, 2009, 5:50 AM
> It still doesn't really explain how a "SELECT *" works, which must be
> pulling up a 'Size' field, whereas "SELECT Size" fails... but who am I to
> question a now-deprecated driver!
No, that's not going to present a problem. The problem is with your use of
the Size keyword in your SQL. The actual returning of the Size field (as
part of the Select *) won't confuse the driver.
This page http://www.petefrei tag.com/tools/ sql_reserved_ words_checker/ can
be used to check whether a word is reserved in several database brands
(although not Access, unfortunately) . "Size" shows as reserved in quite a
few brands, including ISO SQL.
This page http://office. microsoft. com/en-us/ access/hp0103224 91033.aspx gives
you the Access reserved words.
Regards, Dave S
----- Original Message -----
From: "Graeme" <gnwilson2001@ yahoo.com>
To: <active-server- pages@yahoogroup s.com>
Sent: Thursday, November 12, 2009 8:13 PM
Subject: Re: [ASP] Bizarre error '80004005'
> Thanks Dave, and a thank you to everyone who made suggestions.
>
> The annoying thing for me (aside from the 4-5 hours wasted) was that this
> is legacy code that has been running for 6+ years (and in fact is based on
> code I wrote back in 1999 or so...). I simply moved a few things around
> (in this case turned the building of product sizes into a function), and
> changed to the JET database driver instead of the older Access DB driver.
>
> The solution was in have that field name 'Size' is obviously a reserved
> word in the newer JET driver (I say newer with a bit of a laugh, as I read
> that it is also deprecated now...), whereas it worked fine for many years
> using the Access DB driver. Such is life. And the other day I read through
> a list of reserved words for Access, on a Microsoft website, and I never
> spotted 'Size' as a reserved word...
>
> Anyway, I've renamed this field (which will mean updating several 'live'
> databases out there), and things are running again.
>
> It still doesn't really explain how a "SELECT *" works, which must be
> pulling up a 'Size' field, whereas "SELECT Size" fails... but who am I to
> question a now-deprecated driver!
>
> Thanks again to everyone who made suggestions.
>
> Kind Regards,
> Graeme
>
> --- In active-server- pages@yahoogroup s.com, "David Smart"
> <smartware.consulti ng@...> wrote:
>>
>> > ... If I "SELECT *" it works, but it I try to selected a named field.
>> > e.g. "SELECT Code FROM..." then it immediately bombs,
>> > so therefore not related to the "WHERE" clause.
>>
>> I don't think I've ever seen a situation where Select * works but a
>> Select
>> with named fields does not. It really does sound as though your SQL
>> syntax
>> is getting confused when you start specifying fields.
>>
>> Do look carefully at the generated SQL - particularly for missing spaces.
>>
>> However, also try other combinations of field names. Your example was
>> "SELECT Code". Now "Code" is one of those words that is just as likely
>> to
>> be considered a key word. It might be that the DB interface - which DB
>> by
>> the way? - is objecting to a particular word being used as a field name.
>>
>> Ones that leap to my eye as possible keywords are "Size" and particularly
>> "Code". Try doing a select for fields with less "key wordish" names to
>> see
>> if they can be selected OK.
>>
>> (In fact, "Code" and "Size" aren't particularly good column names anyway,
>> IMHO. You should be more specific in column naming, e.g. CatalogueCode,
>> ContainerSize, or whatever.)
>>
>> Regards, Dave S
>>
>> PS This "false keyword" situation is not uncommon and is an instance in
>> which you'll get success though the DB's SQL window and failure from ASP,
>> etc. It should become the first thing to check once you find that your
>> SQL
>> works fine when submitted in the immediate window, but not via ASP.
>>
>> ----- Original Message -----
>> From: "Graeme" <gnwilson2001@ ...>
>> To: <active-server- pages@yahoogroup s.com>
>> Sent: Wednesday, November 11, 2009 6:01 AM
>> Subject: Re: [ASP] Bizarre error '80004005'
>>
>>
>> > Thanks for all the suggestions. Unfortunately it isn't related to any
>> > of
>> > the parts you guys have suggested. If I "SELECT *" it works, but it I
>> > try
>> > to selected a named field. e.g. "SELECT Code FROM..." then it
>> > immediately
>> > bombs, so therefore not related to the "WHERE" clause.
>> >
>> > I spent 4 hours last night trying every combination to get through,
>> > trying
>> > different values for cursor types etc, and nothing. The only 'fix' was
>> > the
>> > SELECT *, which doesn't really do what I want.
>> >
>> > The only other option I found related to '80004005' is to do with
>> > permissions of the file/directory, so I may contact my host to double
>> > check these things, but on a read only statement I can't see that a
>> > problem should/could occur... then again, this is Microsoft ;)
>> >
>> > I will probably try re-writing some of my code to try something else...
>> > I
>> > don't know what right now!
>> >
>> > Cheers,
>> > Graeme
>> >
>> > --- In active-server- pages@yahoogroup s.com, "VisioMVP" <VisioMVP@>
>> > wrote:
>> >>
>> >> Try stepping through the code and see what the value for strSQL is
>> >> when
>> >> you
>> >> are about to run the objRecordset. Open statement.
>> >>
>> >>
>> >>
>> >> John. Visio MVP
>> >>
>> >>
>> >>
>> >> From: active-server- pages@yahoogroup s.com
>> >> [mailto:active-server- pages@yahoogroup s.com] On Behalf Of Graeme
>> >> Sent: November-10- 09 4:46 AM
>> >> To: active-server- pages@yahoogroup s.com
>> >> Subject: [ASP] Bizarre error '80004005'
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> Hi all,
>> >>
>> >> Well, this error has really got me stumped. There is no additional
>> >> information other than: error '80004005' (not even the ever 'useful'
>> >> Unspecified Error)
>> >>
>> >> The piece of code causing the problem is:
>> >>
>> >> Function BuildSize(strPCode, curPrice)
>> >>
>> >> Set objRecordset = Server.CreateObject ("ADODB.Recordse t")
>> >>
>> >> strSQL = "SELECT ProductID, Size, Code, SortCode, Quantity,
>> >> ExtendedDelivery, POA"
>> >> strSQL = strSQL & " FROM tblProducts"
>> >> strSQL = strSQL & " WHERE Online = True AND Code='" & CStr(strPCode) &
>> >> "'
>> >> AND Price=" & CStr(curPrice)
>> >> strSQL = strSQL & " ORDER BY Size;"
>> >>
>> >> objRecordset. Open strSQL, DB_ConnectionString , adOpenForwardOnly,
>> >> adLockReadOnly, adCmdText
>> >>
>> >> ...
>> >>
>> >> End Function
>> >>
>> >> It dies on the "objRecordset. Open" part. The weirdest thing to me is
>> >> that
>> >> if
>> >> I replace the strSQL = "SELECT * FROM tblProducts; " then the error
>> >> disappears (of course it doesn't really provide a solution as to why
>> >> there
>> >> is the error.
>> >>
>> >> Adding ".tblProducts" to the SELECT fields (e.g.
>> >> tblProducts. ProductID)
>> >> doesn't solve the problem.
>> >>
>> >> objRecordset has been used previously, but even if I "Set objRecordset
>> >> =
>> >> Nothing" first, no go. Even if I make a new variable ("Dim
>> >> objRecordset" )
>> >> within this Function, no go. It appears that I'm missing something in
>> >> the
>> >> SQL string, but as I can cut and paste it into an MS Access DB query
>> >> and
>> >> it
>> >> works correctly, I can't see what can possibly be causing the problem!
>> >>
>> >> Any suggestions would be greatly appreciated. This code is adapted
>> >> from
>> >> something I've had online for 6+ years, just updating to
>> >> "Microsoft.Jet. OLEDB.4.0" (which part of the code had been overhauled,
>> >> part
>> >> hadn't) ... and so getting a strange error like this is rather
>> >> annoying.
>> >>
>> >> Also, if I cut the code out of the Function, and paste it into the
>> >> main
>> >> code, I get the same error, as does passing hard coded 'variables' for
>> >> strPCode AND curPrice (e.g. replacing them with what the function was
>> >> passing them, e.g. Code='ABC' AND Price=10
>> >>
>> >> Any help would be very much appreciated!
>> >>
>> >> Cheers,
>> >> Graeme
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> [Non-text portions of this message have been removed]
>> >>
>> >
>> >
>> >
>> >
>> > ------------ --------- --------- ------
>> >
>> > ------------ --------- --------- --------- --------- --------- -
>> > Home : http://groups. yahoo.com/ group/active- server-pages
>> > ------------ --------- --------- --------- --------- --------- -
>> > Post : active-server- pages@yahoogroup s.com
>> > Subscribe : active-server- pages-subscribe@ yahoogroups. com
>> > Unsubscribe: active-server- pages-unsubscrib e@yahoogroups. com
>> > ------------ --------- --------- --------- --------- --------- -Yahoo!
>> > Groups Links
>> >
>> >
>> >
>>
>>
>> ------------ --------- --------- --------- --------- --------- -
>>
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 8.5.425 / Virus Database: 270.14.58/2493 - Release Date:
>> 11/09/09
>> 19:40:00
>>
>
>
>
>
> ------------ --------- --------- ------
>
> ------------ --------- --------- --------- --------- --------- -
> Home : http://groups. yahoo.com/ group/active- server-pages
> ------------ --------- --------- --------- --------- --------- -
> Post : active-server- pages@yahoogroup s.com
> Subscribe : active-server- pages-subscribe@ yahoogroups. com
> Unsubscribe: active-server- pages-unsubscrib e@yahoogroups. com
> ------------ --------- --------- --------- --------- --------- -Yahoo!
> Groups Links
>
>
>
------------ --------- --------- --------- --------- --------- -
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.425 / Virus Database: 270.14.61/2497 - Release Date: 11/11/09
19:41:00
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[Non-text portions of this message have been removed]
Nope – same ol’ IE7 in this case.
-----Original Message-----
From: active-server-pages@yahoogroups.com
[mailto:active-server-pages@yahoogroups.com] On Behalf Of mark wills
Sent: Thursday, November 12, 2009 1:00 PM
To: active-server-pages@yahoogroups.com
Subject: Re: [ASP] JS undefined request.form
Have the client broswers changed? (New browser, or new version of a browser?)
MArk
>
>From: Moshe Tapnack <elists@...>
>To: active-server-pages@yahoogroups.com
>Sent: Thu, 12 November, 2009 11:40:49
>Subject: [ASP] JS undefined request.form
>
> >
>
>
>
>
> >
>>
>
>Hi folks
>
>>Nice to see some activity here again :-)
>
>>Talking about legacy systems, I have had a system up and running for a few
years, I inherited it from someone. They have a form submitting on a
ASP/Javascript page.
>
>>The form looks like this:
>
>>------------ --------- --------- --------- --------- --------- -
>
>><form method="post" action="registratio n.asp" name="form" id="form">
>
>><table width="410" border="0" align="center" cellpadding= "4" cellspacing=
"0">
>
>><tr class="texto_ nota">
>
>><td>
>
>><div align="right" >Last name:</div>
>
>></td>
>
>><td>
>
>><input type="text" name="lastname" size="60">
>
>></td>
>
>></tr>
>
>><tr class="texto_ nota">
>
>><td>
>
>><div align="right" >First name:</div>
>
>></td>
>
>><td>
>
>><input type="text" name="firstname" size="60">
>
>></td>
>
>></tr></table>
>
>><p>
>
>><input type="submit" id="Submit" name="Submit" value="Submit" >
>
>></p>
>
>></form>
>
>>------------ --------- --------- --------- -------
>
>>And then the ASP:
>
>>if (String(Request( "Submit") ) != "undefined") {
>
>>..bla..
>
>>}
>
>>Now, it always used to do the “bla”, but now suddenly, no matter what, its
taken the value of “submit” as undefined, and thus the “bla” is not
being done. I have tried adding in specifically “.item” and .”form” in
the request line, but nothing seems to work.
>
>>Any ideas?
>
>>Thanks!
>
>>Moshe
>
>>[Non-text portions of this message have been removed]
>
>
>
[Non-text portions of this message have been removed]
------------------------------------
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : active-server-pages@yahoogroups.com
Subscribe : active-server-pages-subscribe@yahoogroups.com
Unsubscribe: active-server-pages-unsubscribe@yahoogroups.com
---------------------------------------------------------------------Yahoo!
Groups Links
Have the client broswers changed? (New browser, or new version of a browser?)
MArk
>
>From: Moshe Tapnack <elists@...>
>To: active-server-pages@yahoogroups.com
>Sent: Thu, 12 November, 2009 11:40:49
>Subject: [ASP] JS undefined request.form
>
> >
>
>
>
>
> >
>>
>
>Hi folks
>
>>Nice to see some activity here again :-)
>
>>Talking about legacy systems, I have had a system up and running for a few
years, I inherited it from someone. They have a form submitting on a
ASP/Javascript page.
>
>>The form looks like this:
>
>>------------ --------- --------- --------- --------- --------- -
>
>><form method="post" action="registratio n.asp" name="form" id="form">
>
>><table width="410" border="0" align="center" cellpadding= "4" cellspacing=
"0">
>
>><tr class="texto_ nota">
>
>><td>
>
>><div align="right" >Last name:</div>
>
>></td>
>
>><td>
>
>><input type="text" name="lastname" size="60">
>
>></td>
>
>></tr>
>
>><tr class="texto_ nota">
>
>><td>
>
>><div align="right" >First name:</div>
>
>></td>
>
>><td>
>
>><input type="text" name="firstname" size="60">
>
>></td>
>
>></tr></table>
>
>><p>
>
>><input type="submit" id="Submit" name="Submit" value="Submit" >
>
>></p>
>
>></form>
>
>>------------ --------- --------- --------- -------
>
>>And then the ASP:
>
>>if (String(Request( "Submit") ) != "undefined") {
>
>>..bla..
>
>>}
>
>>Now, it always used to do the “bla”, but now suddenly, no matter what, its
taken the value of “submit” as undefined, and thus the “bla” is not
being done. I have tried adding in specifically “.item” and .”form” in
the request line, but nothing seems to work.
>
>>Any ideas?
>
>>Thanks!
>
>>Moshe
>
>>[Non-text portions of this message have been removed]
>
>
>
[Non-text portions of this message have been removed]
> It still doesn't really explain how a "SELECT *" works, which must be
> pulling up a 'Size' field, whereas "SELECT Size" fails... but who am I to
> question a now-deprecated driver!
No, that's not going to present a problem. The problem is with your use of
the Size keyword in your SQL. The actual returning of the Size field (as
part of the Select *) won't confuse the driver.
This page http://www.petefreitag.com/tools/sql_reserved_words_checker/ can
be used to check whether a word is reserved in several database brands
(although not Access, unfortunately). "Size" shows as reserved in quite a
few brands, including ISO SQL.
This page http://office.microsoft.com/en-us/access/hp010322491033.aspx gives
you the Access reserved words.
Regards, Dave S
----- Original Message -----
From: "Graeme" <gnwilson2001@...>
To: <active-server-pages@yahoogroups.com>
Sent: Thursday, November 12, 2009 8:13 PM
Subject: Re: [ASP] Bizarre error '80004005'
> Thanks Dave, and a thank you to everyone who made suggestions.
>
> The annoying thing for me (aside from the 4-5 hours wasted) was that this
> is legacy code that has been running for 6+ years (and in fact is based on
> code I wrote back in 1999 or so...). I simply moved a few things around
> (in this case turned the building of product sizes into a function), and
> changed to the JET database driver instead of the older Access DB driver.
>
> The solution was in have that field name 'Size' is obviously a reserved
> word in the newer JET driver (I say newer with a bit of a laugh, as I read
> that it is also deprecated now...), whereas it worked fine for many years
> using the Access DB driver. Such is life. And the other day I read through
> a list of reserved words for Access, on a Microsoft website, and I never
> spotted 'Size' as a reserved word...
>
> Anyway, I've renamed this field (which will mean updating several 'live'
> databases out there), and things are running again.
>
> It still doesn't really explain how a "SELECT *" works, which must be
> pulling up a 'Size' field, whereas "SELECT Size" fails... but who am I to
> question a now-deprecated driver!
>
> Thanks again to everyone who made suggestions.
>
> Kind Regards,
> Graeme
>
> --- In active-server-pages@yahoogroups.com, "David Smart"
> <smartware.consulting@...> wrote:
>>
>> > ... If I "SELECT *" it works, but it I try to selected a named field.
>> > e.g. "SELECT Code FROM..." then it immediately bombs,
>> > so therefore not related to the "WHERE" clause.
>>
>> I don't think I've ever seen a situation where Select * works but a
>> Select
>> with named fields does not. It really does sound as though your SQL
>> syntax
>> is getting confused when you start specifying fields.
>>
>> Do look carefully at the generated SQL - particularly for missing spaces.
>>
>> However, also try other combinations of field names. Your example was
>> "SELECT Code". Now "Code" is one of those words that is just as likely
>> to
>> be considered a key word. It might be that the DB interface - which DB
>> by
>> the way? - is objecting to a particular word being used as a field name.
>>
>> Ones that leap to my eye as possible keywords are "Size" and particularly
>> "Code". Try doing a select for fields with less "key wordish" names to
>> see
>> if they can be selected OK.
>>
>> (In fact, "Code" and "Size" aren't particularly good column names anyway,
>> IMHO. You should be more specific in column naming, e.g. CatalogueCode,
>> ContainerSize, or whatever.)
>>
>> Regards, Dave S
>>
>> PS This "false keyword" situation is not uncommon and is an instance in
>> which you'll get success though the DB's SQL window and failure from ASP,
>> etc. It should become the first thing to check once you find that your
>> SQL
>> works fine when submitted in the immediate window, but not via ASP.
>>
>> ----- Original Message -----
>> From: "Graeme" <gnwilson2001@...>
>> To: <active-server-pages@yahoogroups.com>
>> Sent: Wednesday, November 11, 2009 6:01 AM
>> Subject: Re: [ASP] Bizarre error '80004005'
>>
>>
>> > Thanks for all the suggestions. Unfortunately it isn't related to any
>> > of
>> > the parts you guys have suggested. If I "SELECT *" it works, but it I
>> > try
>> > to selected a named field. e.g. "SELECT Code FROM..." then it
>> > immediately
>> > bombs, so therefore not related to the "WHERE" clause.
>> >
>> > I spent 4 hours last night trying every combination to get through,
>> > trying
>> > different values for cursor types etc, and nothing. The only 'fix' was
>> > the
>> > SELECT *, which doesn't really do what I want.
>> >
>> > The only other option I found related to '80004005' is to do with
>> > permissions of the file/directory, so I may contact my host to double
>> > check these things, but on a read only statement I can't see that a
>> > problem should/could occur... then again, this is Microsoft ;)
>> >
>> > I will probably try re-writing some of my code to try something else...
>> > I
>> > don't know what right now!
>> >
>> > Cheers,
>> > Graeme
>> >
>> > --- In active-server-pages@yahoogroups.com, "VisioMVP" <VisioMVP@>
>> > wrote:
>> >>
>> >> Try stepping through the code and see what the value for strSQL is
>> >> when
>> >> you
>> >> are about to run the objRecordset.Open statement.
>> >>
>> >>
>> >>
>> >> John. Visio MVP
>> >>
>> >>
>> >>
>> >> From: active-server-pages@yahoogroups.com
>> >> [mailto:active-server-pages@yahoogroups.com] On Behalf Of Graeme
>> >> Sent: November-10-09 4:46 AM
>> >> To: active-server-pages@yahoogroups.com
>> >> Subject: [ASP] Bizarre error '80004005'
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> Hi all,
>> >>
>> >> Well, this error has really got me stumped. There is no additional
>> >> information other than: error '80004005' (not even the ever 'useful'
>> >> Unspecified Error)
>> >>
>> >> The piece of code causing the problem is:
>> >>
>> >> Function BuildSize(strPCode, curPrice)
>> >>
>> >> Set objRecordset = Server.CreateObject("ADODB.Recordset")
>> >>
>> >> strSQL = "SELECT ProductID, Size, Code, SortCode, Quantity,
>> >> ExtendedDelivery, POA"
>> >> strSQL = strSQL & " FROM tblProducts"
>> >> strSQL = strSQL & " WHERE Online = True AND Code='" & CStr(strPCode) &
>> >> "'
>> >> AND Price=" & CStr(curPrice)
>> >> strSQL = strSQL & " ORDER BY Size;"
>> >>
>> >> objRecordset.Open strSQL, DB_ConnectionString, adOpenForwardOnly,
>> >> adLockReadOnly, adCmdText
>> >>
>> >> ...
>> >>
>> >> End Function
>> >>
>> >> It dies on the "objRecordset.Open" part. The weirdest thing to me is
>> >> that
>> >> if
>> >> I replace the strSQL = "SELECT * FROM tblProducts;" then the error
>> >> disappears (of course it doesn't really provide a solution as to why
>> >> there
>> >> is the error.
>> >>
>> >> Adding ".tblProducts" to the SELECT fields (e.g.
>> >> tblProducts.ProductID)
>> >> doesn't solve the problem.
>> >>
>> >> objRecordset has been used previously, but even if I "Set objRecordset
>> >> =
>> >> Nothing" first, no go. Even if I make a new variable ("Dim
>> >> objRecordset")
>> >> within this Function, no go. It appears that I'm missing something in
>> >> the
>> >> SQL string, but as I can cut and paste it into an MS Access DB query
>> >> and
>> >> it
>> >> works correctly, I can't see what can possibly be causing the problem!
>> >>
>> >> Any suggestions would be greatly appreciated. This code is adapted
>> >> from
>> >> something I've had online for 6+ years, just updating to
>> >> "Microsoft.Jet.OLEDB.4.0" (which part of the code had been overhauled,
>> >> part
>> >> hadn't) ... and so getting a strange error like this is rather
>> >> annoying.
>> >>
>> >> Also, if I cut the code out of the Function, and paste it into the
>> >> main
>> >> code, I get the same error, as does passing hard coded 'variables' for
>> >> strPCode AND curPrice (e.g. replacing them with what the function was
>> >> passing them, e.g. Code='ABC' AND Price=10
>> >>
>> >> Any help would be very much appreciated!
>> >>
>> >> Cheers,
>> >> Graeme
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> [Non-text portions of this message have been removed]
>> >>
>> >
>> >
>> >
>> >
>> > ------------------------------------
>> >
>> > ---------------------------------------------------------------------
>> > Home : http://groups.yahoo.com/group/active-server-pages
>> > ---------------------------------------------------------------------
>> > Post : active-server-pages@yahoogroups.com
>> > Subscribe : active-server-pages-subscribe@yahoogroups.com
>> > Unsubscribe: active-server-pages-unsubscribe@yahoogroups.com
>> > ---------------------------------------------------------------------Yahoo!
>> > Groups Links
>> >
>> >
>> >
>>
>>
>>
--------------------------------------------------------------------------------
>>
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 8.5.425 / Virus Database: 270.14.58/2493 - Release Date:
>> 11/09/09
>> 19:40:00
>>
>
>
>
>
> ------------------------------------
>
> ---------------------------------------------------------------------
> Home : http://groups.yahoo.com/group/active-server-pages
> ---------------------------------------------------------------------
> Post : active-server-pages@yahoogroups.com
> Subscribe : active-server-pages-subscribe@yahoogroups.com
> Unsubscribe: active-server-pages-unsubscribe@yahoogroups.com
> ---------------------------------------------------------------------Yahoo!
> Groups Links
>
>
>
--------------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.425 / Virus Database: 270.14.61/2497 - Release Date: 11/11/09
19:41:00
Hi folks
Nice to see some activity here again :-)
Talking about legacy systems, I have had a system up and running for a few
years, I inherited it from someone. They have a form submitting on a
ASP/Javascript page.
The form looks like this:
--------------------------------------------------------------------------
<form method="post" action="registration.asp" name="form" id="form">
<table width="410" border="0" align="center" cellpadding="4" cellspacing="0">
<tr class="texto_nota">
<td>
<div align="right">Last name:</div>
</td>
<td>
<input type="text" name="lastname" size="60">
</td>
</tr>
<tr class="texto_nota">
<td>
<div align="right">First name:</div>
</td>
<td>
<input type="text" name="firstname" size="60">
</td>
</tr></table>
<p>
<input type="submit" id="Submit" name="Submit" value="Submit">
</p>
</form>
----------------------------------------------
And then the ASP:
if (String(Request("Submit")) != "undefined"){
..bla..
}
Now, it always used to do the “bla”, but now suddenly, no matter what, its
taken the value of “submit” as undefined, and thus the “bla” is not
being done. I have tried adding in specifically “.item” and .”form” in
the request line, but nothing seems to work.
Any ideas?
Thanks!
Moshe
[Non-text portions of this message have been removed]
Thanks Dave, and a thank you to everyone who made suggestions.
The annoying thing for me (aside from the 4-5 hours wasted) was that this is
legacy code that has been running for 6+ years (and in fact is based on code I
wrote back in 1999 or so...). I simply moved a few things around (in this case
turned the building of product sizes into a function), and changed to the JET
database driver instead of the older Access DB driver.
The solution was in have that field name 'Size' is obviously a reserved word in
the newer JET driver (I say newer with a bit of a laugh, as I read that it is
also deprecated now...), whereas it worked fine for many years using the Access
DB driver. Such is life. And the other day I read through a list of reserved
words for Access, on a Microsoft website, and I never spotted 'Size' as a
reserved word...
Anyway, I've renamed this field (which will mean updating several 'live'
databases out there), and things are running again.
It still doesn't really explain how a "SELECT *" works, which must be pulling up
a 'Size' field, whereas "SELECT Size" fails... but who am I to question a
now-deprecated driver!
Thanks again to everyone who made suggestions.
Kind Regards,
Graeme
--- In active-server-pages@yahoogroups.com, "David Smart"
<smartware.consulting@...> wrote:
>
> > ... If I "SELECT *" it works, but it I try to selected a named field.
> > e.g. "SELECT Code FROM..." then it immediately bombs,
> > so therefore not related to the "WHERE" clause.
>
> I don't think I've ever seen a situation where Select * works but a Select
> with named fields does not. It really does sound as though your SQL syntax
> is getting confused when you start specifying fields.
>
> Do look carefully at the generated SQL - particularly for missing spaces.
>
> However, also try other combinations of field names. Your example was
> "SELECT Code". Now "Code" is one of those words that is just as likely to
> be considered a key word. It might be that the DB interface - which DB by
> the way? - is objecting to a particular word being used as a field name.
>
> Ones that leap to my eye as possible keywords are "Size" and particularly
> "Code". Try doing a select for fields with less "key wordish" names to see
> if they can be selected OK.
>
> (In fact, "Code" and "Size" aren't particularly good column names anyway,
> IMHO. You should be more specific in column naming, e.g. CatalogueCode,
> ContainerSize, or whatever.)
>
> Regards, Dave S
>
> PS This "false keyword" situation is not uncommon and is an instance in
> which you'll get success though the DB's SQL window and failure from ASP,
> etc. It should become the first thing to check once you find that your SQL
> works fine when submitted in the immediate window, but not via ASP.
>
> ----- Original Message -----
> From: "Graeme" <gnwilson2001@...>
> To: <active-server-pages@yahoogroups.com>
> Sent: Wednesday, November 11, 2009 6:01 AM
> Subject: Re: [ASP] Bizarre error '80004005'
>
>
> > Thanks for all the suggestions. Unfortunately it isn't related to any of
> > the parts you guys have suggested. If I "SELECT *" it works, but it I try
> > to selected a named field. e.g. "SELECT Code FROM..." then it immediately
> > bombs, so therefore not related to the "WHERE" clause.
> >
> > I spent 4 hours last night trying every combination to get through, trying
> > different values for cursor types etc, and nothing. The only 'fix' was the
> > SELECT *, which doesn't really do what I want.
> >
> > The only other option I found related to '80004005' is to do with
> > permissions of the file/directory, so I may contact my host to double
> > check these things, but on a read only statement I can't see that a
> > problem should/could occur... then again, this is Microsoft ;)
> >
> > I will probably try re-writing some of my code to try something else... I
> > don't know what right now!
> >
> > Cheers,
> > Graeme
> >
> > --- In active-server-pages@yahoogroups.com, "VisioMVP" <VisioMVP@>
> > wrote:
> >>
> >> Try stepping through the code and see what the value for strSQL is when
> >> you
> >> are about to run the objRecordset.Open statement.
> >>
> >>
> >>
> >> John. Visio MVP
> >>
> >>
> >>
> >> From: active-server-pages@yahoogroups.com
> >> [mailto:active-server-pages@yahoogroups.com] On Behalf Of Graeme
> >> Sent: November-10-09 4:46 AM
> >> To: active-server-pages@yahoogroups.com
> >> Subject: [ASP] Bizarre error '80004005'
> >>
> >>
> >>
> >>
> >>
> >> Hi all,
> >>
> >> Well, this error has really got me stumped. There is no additional
> >> information other than: error '80004005' (not even the ever 'useful'
> >> Unspecified Error)
> >>
> >> The piece of code causing the problem is:
> >>
> >> Function BuildSize(strPCode, curPrice)
> >>
> >> Set objRecordset = Server.CreateObject("ADODB.Recordset")
> >>
> >> strSQL = "SELECT ProductID, Size, Code, SortCode, Quantity,
> >> ExtendedDelivery, POA"
> >> strSQL = strSQL & " FROM tblProducts"
> >> strSQL = strSQL & " WHERE Online = True AND Code='" & CStr(strPCode) & "'
> >> AND Price=" & CStr(curPrice)
> >> strSQL = strSQL & " ORDER BY Size;"
> >>
> >> objRecordset.Open strSQL, DB_ConnectionString, adOpenForwardOnly,
> >> adLockReadOnly, adCmdText
> >>
> >> ...
> >>
> >> End Function
> >>
> >> It dies on the "objRecordset.Open" part. The weirdest thing to me is that
> >> if
> >> I replace the strSQL = "SELECT * FROM tblProducts;" then the error
> >> disappears (of course it doesn't really provide a solution as to why
> >> there
> >> is the error.
> >>
> >> Adding ".tblProducts" to the SELECT fields (e.g. tblProducts.ProductID)
> >> doesn't solve the problem.
> >>
> >> objRecordset has been used previously, but even if I "Set objRecordset =
> >> Nothing" first, no go. Even if I make a new variable ("Dim objRecordset")
> >> within this Function, no go. It appears that I'm missing something in the
> >> SQL string, but as I can cut and paste it into an MS Access DB query and
> >> it
> >> works correctly, I can't see what can possibly be causing the problem!
> >>
> >> Any suggestions would be greatly appreciated. This code is adapted from
> >> something I've had online for 6+ years, just updating to
> >> "Microsoft.Jet.OLEDB.4.0" (which part of the code had been overhauled,
> >> part
> >> hadn't) ... and so getting a strange error like this is rather annoying.
> >>
> >> Also, if I cut the code out of the Function, and paste it into the main
> >> code, I get the same error, as does passing hard coded 'variables' for
> >> strPCode AND curPrice (e.g. replacing them with what the function was
> >> passing them, e.g. Code='ABC' AND Price=10
> >>
> >> Any help would be very much appreciated!
> >>
> >> Cheers,
> >> Graeme
> >>
> >>
> >>
> >>
> >>
> >> [Non-text portions of this message have been removed]
> >>
> >
> >
> >
> >
> > ------------------------------------
> >
> > ---------------------------------------------------------------------
> > Home : http://groups.yahoo.com/group/active-server-pages
> > ---------------------------------------------------------------------
> > Post : active-server-pages@yahoogroups.com
> > Subscribe : active-server-pages-subscribe@yahoogroups.com
> > Unsubscribe: active-server-pages-unsubscribe@yahoogroups.com
> > ---------------------------------------------------------------------Yahoo!
> > Groups Links
> >
> >
> >
>
>
>
--------------------------------------------------------------------------------
>
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.425 / Virus Database: 270.14.58/2493 - Release Date: 11/09/09
> 19:40:00
>
> ... If I "SELECT *" it works, but it I try to selected a named field.
> e.g. "SELECT Code FROM..." then it immediately bombs,
> so therefore not related to the "WHERE" clause.
I don't think I've ever seen a situation where Select * works but a Select
with named fields does not. It really does sound as though your SQL syntax
is getting confused when you start specifying fields.
Do look carefully at the generated SQL - particularly for missing spaces.
However, also try other combinations of field names. Your example was
"SELECT Code". Now "Code" is one of those words that is just as likely to
be considered a key word. It might be that the DB interface - which DB by
the way? - is objecting to a particular word being used as a field name.
Ones that leap to my eye as possible keywords are "Size" and particularly
"Code". Try doing a select for fields with less "key wordish" names to see
if they can be selected OK.
(In fact, "Code" and "Size" aren't particularly good column names anyway,
IMHO. You should be more specific in column naming, e.g. CatalogueCode,
ContainerSize, or whatever.)
Regards, Dave S
PS This "false keyword" situation is not uncommon and is an instance in
which you'll get success though the DB's SQL window and failure from ASP,
etc. It should become the first thing to check once you find that your SQL
works fine when submitted in the immediate window, but not via ASP.
----- Original Message -----
From: "Graeme" <gnwilson2001@...>
To: <active-server-pages@yahoogroups.com>
Sent: Wednesday, November 11, 2009 6:01 AM
Subject: Re: [ASP] Bizarre error '80004005'
> Thanks for all the suggestions. Unfortunately it isn't related to any of
> the parts you guys have suggested. If I "SELECT *" it works, but it I try
> to selected a named field. e.g. "SELECT Code FROM..." then it immediately
> bombs, so therefore not related to the "WHERE" clause.
>
> I spent 4 hours last night trying every combination to get through, trying
> different values for cursor types etc, and nothing. The only 'fix' was the
> SELECT *, which doesn't really do what I want.
>
> The only other option I found related to '80004005' is to do with
> permissions of the file/directory, so I may contact my host to double
> check these things, but on a read only statement I can't see that a
> problem should/could occur... then again, this is Microsoft ;)
>
> I will probably try re-writing some of my code to try something else... I
> don't know what right now!
>
> Cheers,
> Graeme
>
> --- In active-server-pages@yahoogroups.com, "VisioMVP" <VisioMVP@...>
> wrote:
>>
>> Try stepping through the code and see what the value for strSQL is when
>> you
>> are about to run the objRecordset.Open statement.
>>
>>
>>
>> John. Visio MVP
>>
>>
>>
>> From: active-server-pages@yahoogroups.com
>> [mailto:active-server-pages@yahoogroups.com] On Behalf Of Graeme
>> Sent: November-10-09 4:46 AM
>> To: active-server-pages@yahoogroups.com
>> Subject: [ASP] Bizarre error '80004005'
>>
>>
>>
>>
>>
>> Hi all,
>>
>> Well, this error has really got me stumped. There is no additional
>> information other than: error '80004005' (not even the ever 'useful'
>> Unspecified Error)
>>
>> The piece of code causing the problem is:
>>
>> Function BuildSize(strPCode, curPrice)
>>
>> Set objRecordset = Server.CreateObject("ADODB.Recordset")
>>
>> strSQL = "SELECT ProductID, Size, Code, SortCode, Quantity,
>> ExtendedDelivery, POA"
>> strSQL = strSQL & " FROM tblProducts"
>> strSQL = strSQL & " WHERE Online = True AND Code='" & CStr(strPCode) & "'
>> AND Price=" & CStr(curPrice)
>> strSQL = strSQL & " ORDER BY Size;"
>>
>> objRecordset.Open strSQL, DB_ConnectionString, adOpenForwardOnly,
>> adLockReadOnly, adCmdText
>>
>> ...
>>
>> End Function
>>
>> It dies on the "objRecordset.Open" part. The weirdest thing to me is that
>> if
>> I replace the strSQL = "SELECT * FROM tblProducts;" then the error
>> disappears (of course it doesn't really provide a solution as to why
>> there
>> is the error.
>>
>> Adding ".tblProducts" to the SELECT fields (e.g. tblProducts.ProductID)
>> doesn't solve the problem.
>>
>> objRecordset has been used previously, but even if I "Set objRecordset =
>> Nothing" first, no go. Even if I make a new variable ("Dim objRecordset")
>> within this Function, no go. It appears that I'm missing something in the
>> SQL string, but as I can cut and paste it into an MS Access DB query and
>> it
>> works correctly, I can't see what can possibly be causing the problem!
>>
>> Any suggestions would be greatly appreciated. This code is adapted from
>> something I've had online for 6+ years, just updating to
>> "Microsoft.Jet.OLEDB.4.0" (which part of the code had been overhauled,
>> part
>> hadn't) ... and so getting a strange error like this is rather annoying.
>>
>> Also, if I cut the code out of the Function, and paste it into the main
>> code, I get the same error, as does passing hard coded 'variables' for
>> strPCode AND curPrice (e.g. replacing them with what the function was
>> passing them, e.g. Code='ABC' AND Price=10
>>
>> Any help would be very much appreciated!
>>
>> Cheers,
>> Graeme
>>
>>
>>
>>
>>
>> [Non-text portions of this message have been removed]
>>
>
>
>
>
> ------------------------------------
>
> ---------------------------------------------------------------------
> Home : http://groups.yahoo.com/group/active-server-pages
> ---------------------------------------------------------------------
> Post : active-server-pages@yahoogroups.com
> Subscribe : active-server-pages-subscribe@yahoogroups.com
> Unsubscribe: active-server-pages-unsubscribe@yahoogroups.com
> ---------------------------------------------------------------------Yahoo!
> Groups Links
>
>
>
--------------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.425 / Virus Database: 270.14.58/2493 - Release Date: 11/09/09
19:40:00
1) Put a print statement into your code before the Open statement and
display the resultant SQL statement so that there can be no question about
what you're asking the DB engine to do.
2) Copy/paste the SQL statement that gets printed into your DB engine's SQL
window and execute it there to see if it works.
3) Comment out (do not delete) the print statement once everything's
working.
Chances are you'll see something at (1). If not, then the SQL window in the
DB might give you more error info.
If it works in the DB's SQL window, but not in your code, then you might
have a permissions problem.
If all else fails, post the exact SQL statement here (using copy/paste from
the print statement) when you ask again.
Get in the habit of ALWAYS putting the print statement in before using a
generated SQL statement, and then comment it out once you no longer need it.
(By "print statement", I'm referring to something that will put your SQL
onto your resultant screen and/or into a "view source". I use a call to a
small subroutine that lives in my common code module. My "putLine" (in
JScript) looks like this
function putLine (text)
{
putLF (text + "<br>");
}
where ....
function putLF (text)
{
put (text + "\n");
}
function put (text)
{
Response.write (text);
}
This function set causes a Response.write of the text with both a <br> and
an ASCII return appended to it. The <br> is to end the line when it
actually makes it to the screen; the ASCII return is to end it neatly in a
"view source".)
Regards, Dave S
----- Original Message -----
From: "Graeme" <gnwilson2001@...>
To: <active-server-pages@yahoogroups.com>
Sent: Tuesday, November 10, 2009 8:46 PM
Subject: [ASP] Bizarre error '80004005'
> Hi all,
>
> Well, this error has really got me stumped. There is no additional
> information other than: error '80004005' (not even the ever 'useful'
> Unspecified Error)
>
> The piece of code causing the problem is:
>
> Function BuildSize(strPCode, curPrice)
>
> Set objRecordset = Server.CreateObject("ADODB.Recordset")
>
> strSQL = "SELECT ProductID, Size, Code, SortCode, Quantity,
> ExtendedDelivery, POA"
> strSQL = strSQL & " FROM tblProducts"
> strSQL = strSQL & " WHERE Online = True AND Code='" & CStr(strPCode) & "'
> AND Price=" & CStr(curPrice)
> strSQL = strSQL & " ORDER BY Size;"
>
> objRecordset.Open strSQL, DB_ConnectionString, adOpenForwardOnly,
> adLockReadOnly, adCmdText
>
> ...
>
> End Function
>
> It dies on the "objRecordset.Open" part. The weirdest thing to me is that
> if I replace the strSQL = "SELECT * FROM tblProducts;" then the error
> disappears (of course it doesn't really provide a solution as to why there
> is the error.
>
> Adding ".tblProducts" to the SELECT fields (e.g. tblProducts.ProductID)
> doesn't solve the problem.
>
> objRecordset has been used previously, but even if I "Set objRecordset =
> Nothing" first, no go. Even if I make a new variable ("Dim objRecordset")
> within this Function, no go. It appears that I'm missing something in the
> SQL string, but as I can cut and paste it into an MS Access DB query and
> it works correctly, I can't see what can possibly be causing the problem!
>
> Any suggestions would be greatly appreciated. This code is adapted from
> something I've had online for 6+ years, just updating to
> "Microsoft.Jet.OLEDB.4.0" (which part of the code had been overhauled,
> part hadn't) ... and so getting a strange error like this is rather
> annoying.
>
> Also, if I cut the code out of the Function, and paste it into the main
> code, I get the same error, as does passing hard coded 'variables' for
> strPCode AND curPrice (e.g. replacing them with what the function was
> passing them, e.g. Code='ABC' AND Price=10
>
> Any help would be very much appreciated!
>
> Cheers,
> Graeme
>
>
>
> ------------------------------------
>
> ---------------------------------------------------------------------
> Home : http://groups.yahoo.com/group/active-server-pages
> ---------------------------------------------------------------------
> Post : active-server-pages@yahoogroups.com
> Subscribe : active-server-pages-subscribe@yahoogroups.com
> Unsubscribe: active-server-pages-unsubscribe@yahoogroups.com
> ---------------------------------------------------------------------Yahoo!
> Groups Links
>
>
>
--------------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.425 / Virus Database: 270.14.58/2493 - Release Date: 11/09/09
19:40:00
So your saying this works:
select * from tblProducts
... but this doesn't?
Select ProductID, size from tblProducts?
You've completely eliminated the where clause from all examples?
I know permissions on the DB could be an issue but I thought being able to do a
"select *" eliminated that from the equation.
Mark
--- On Tue, 11/10/09, Graeme <gnwilson2001@...> wrote:
From: Graeme <gnwilson2001@...>
Subject: Re: [ASP] Bizarre error '80004005'
To: active-server-pages@yahoogroups.com
Date: Tuesday, November 10, 2009, 2:01 PM
Thanks for all the suggestions. Unfortunately it isn't related to any of the
parts you guys have suggested. If I "SELECT *" it works, but it I try to
selected a named field. e.g. "SELECT Code FROM..." then it immediately bombs, so
therefore not related to the "WHERE" clause.
I spent 4 hours last night trying every combination to get through, trying
different values for cursor types etc, and nothing. The only 'fix' was the
SELECT *, which doesn't really do what I want.
The only other option I found related to '80004005' is to do with permissions of
the file/directory, so I may contact my host to double check these things, but
on a read only statement I can't see that a problem should/could occur... then
again, this is Microsoft ;)
I will probably try re-writing some of my code to try something else... I don't
know what right now!
Cheers,
Graeme
--- In active-server- pages@yahoogroup s.com, "VisioMVP" <VisioMVP@.. .> wrote:
>
> Try stepping through the code and see what the value for strSQL is when you
> are about to run the objRecordset. Open statement.
>
>
>
> John. Visio MVP
>
>
>
> From: active-server- pages@yahoogroup s.com
> [mailto:active-server- pages@yahoogroup s.com] On Behalf Of Graeme
> Sent: November-10- 09 4:46 AM
> To: active-server- pages@yahoogroup s.com
> Subject: [ASP] Bizarre error '80004005'
>
>
>
>
>
> Hi all,
>
> Well, this error has really got me stumped. There is no additional
> information other than: error '80004005' (not even the ever 'useful'
> Unspecified Error)
>
> The piece of code causing the problem is:
>
> Function BuildSize(strPCode, curPrice)
>
> Set objRecordset = Server.CreateObject ("ADODB.Recordse t")
>
> strSQL = "SELECT ProductID, Size, Code, SortCode, Quantity,
> ExtendedDelivery, POA"
> strSQL = strSQL & " FROM tblProducts"
> strSQL = strSQL & " WHERE Online = True AND Code='" & CStr(strPCode) & "'
> AND Price=" & CStr(curPrice)
> strSQL = strSQL & " ORDER BY Size;"
>
> objRecordset. Open strSQL, DB_ConnectionString , adOpenForwardOnly,
> adLockReadOnly, adCmdText
>
> ...
>
> End Function
>
> It dies on the "objRecordset. Open" part. The weirdest thing to me is that if
> I replace the strSQL = "SELECT * FROM tblProducts; " then the error
> disappears (of course it doesn't really provide a solution as to why there
> is the error.
>
> Adding ".tblProducts" to the SELECT fields (e.g. tblProducts. ProductID)
> doesn't solve the problem.
>
> objRecordset has been used previously, but even if I "Set objRecordset =
> Nothing" first, no go. Even if I make a new variable ("Dim objRecordset" )
> within this Function, no go. It appears that I'm missing something in the
> SQL string, but as I can cut and paste it into an MS Access DB query and it
> works correctly, I can't see what can possibly be causing the problem!
>
> Any suggestions would be greatly appreciated. This code is adapted from
> something I've had online for 6+ years, just updating to
> "Microsoft.Jet. OLEDB.4.0" (which part of the code had been overhauled, part
> hadn't) ... and so getting a strange error like this is rather annoying.
>
> Also, if I cut the code out of the Function, and paste it into the main
> code, I get the same error, as does passing hard coded 'variables' for
> strPCode AND curPrice (e.g. replacing them with what the function was
> passing them, e.g. Code='ABC' AND Price=10
>
> Any help would be very much appreciated!
>
> Cheers,
> Graeme
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
[Non-text portions of this message have been removed]
Thanks for all the suggestions. Unfortunately it isn't related to any of the
parts you guys have suggested. If I "SELECT *" it works, but it I try to
selected a named field. e.g. "SELECT Code FROM..." then it immediately bombs, so
therefore not related to the "WHERE" clause.
I spent 4 hours last night trying every combination to get through, trying
different values for cursor types etc, and nothing. The only 'fix' was the
SELECT *, which doesn't really do what I want.
The only other option I found related to '80004005' is to do with permissions of
the file/directory, so I may contact my host to double check these things, but
on a read only statement I can't see that a problem should/could occur... then
again, this is Microsoft ;)
I will probably try re-writing some of my code to try something else... I don't
know what right now!
Cheers,
Graeme
--- In active-server-pages@yahoogroups.com, "VisioMVP" <VisioMVP@...> wrote:
>
> Try stepping through the code and see what the value for strSQL is when you
> are about to run the objRecordset.Open statement.
>
>
>
> John. Visio MVP
>
>
>
> From: active-server-pages@yahoogroups.com
> [mailto:active-server-pages@yahoogroups.com] On Behalf Of Graeme
> Sent: November-10-09 4:46 AM
> To: active-server-pages@yahoogroups.com
> Subject: [ASP] Bizarre error '80004005'
>
>
>
>
>
> Hi all,
>
> Well, this error has really got me stumped. There is no additional
> information other than: error '80004005' (not even the ever 'useful'
> Unspecified Error)
>
> The piece of code causing the problem is:
>
> Function BuildSize(strPCode, curPrice)
>
> Set objRecordset = Server.CreateObject("ADODB.Recordset")
>
> strSQL = "SELECT ProductID, Size, Code, SortCode, Quantity,
> ExtendedDelivery, POA"
> strSQL = strSQL & " FROM tblProducts"
> strSQL = strSQL & " WHERE Online = True AND Code='" & CStr(strPCode) & "'
> AND Price=" & CStr(curPrice)
> strSQL = strSQL & " ORDER BY Size;"
>
> objRecordset.Open strSQL, DB_ConnectionString, adOpenForwardOnly,
> adLockReadOnly, adCmdText
>
> ...
>
> End Function
>
> It dies on the "objRecordset.Open" part. The weirdest thing to me is that if
> I replace the strSQL = "SELECT * FROM tblProducts;" then the error
> disappears (of course it doesn't really provide a solution as to why there
> is the error.
>
> Adding ".tblProducts" to the SELECT fields (e.g. tblProducts.ProductID)
> doesn't solve the problem.
>
> objRecordset has been used previously, but even if I "Set objRecordset =
> Nothing" first, no go. Even if I make a new variable ("Dim objRecordset")
> within this Function, no go. It appears that I'm missing something in the
> SQL string, but as I can cut and paste it into an MS Access DB query and it
> works correctly, I can't see what can possibly be causing the problem!
>
> Any suggestions would be greatly appreciated. This code is adapted from
> something I've had online for 6+ years, just updating to
> "Microsoft.Jet.OLEDB.4.0" (which part of the code had been overhauled, part
> hadn't) ... and so getting a strange error like this is rather annoying.
>
> Also, if I cut the code out of the Function, and paste it into the main
> code, I get the same error, as does passing hard coded 'variables' for
> strPCode AND curPrice (e.g. replacing them with what the function was
> passing them, e.g. Code='ABC' AND Price=10
>
> Any help would be very much appreciated!
>
> Cheers,
> Graeme
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Try stepping through the code and see what the value for strSQL is when you
are about to run the objRecordset.Open statement.
John. Visio MVP
From: active-server-pages@yahoogroups.com
[mailto:active-server-pages@yahoogroups.com] On Behalf Of Graeme
Sent: November-10-09 4:46 AM
To: active-server-pages@yahoogroups.com
Subject: [ASP] Bizarre error '80004005'
Hi all,
Well, this error has really got me stumped. There is no additional
information other than: error '80004005' (not even the ever 'useful'
Unspecified Error)
The piece of code causing the problem is:
Function BuildSize(strPCode, curPrice)
Set objRecordset = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT ProductID, Size, Code, SortCode, Quantity,
ExtendedDelivery, POA"
strSQL = strSQL & " FROM tblProducts"
strSQL = strSQL & " WHERE Online = True AND Code='" & CStr(strPCode) & "'
AND Price=" & CStr(curPrice)
strSQL = strSQL & " ORDER BY Size;"
objRecordset.Open strSQL, DB_ConnectionString, adOpenForwardOnly,
adLockReadOnly, adCmdText
...
End Function
It dies on the "objRecordset.Open" part. The weirdest thing to me is that if
I replace the strSQL = "SELECT * FROM tblProducts;" then the error
disappears (of course it doesn't really provide a solution as to why there
is the error.
Adding ".tblProducts" to the SELECT fields (e.g. tblProducts.ProductID)
doesn't solve the problem.
objRecordset has been used previously, but even if I "Set objRecordset =
Nothing" first, no go. Even if I make a new variable ("Dim objRecordset")
within this Function, no go. It appears that I'm missing something in the
SQL string, but as I can cut and paste it into an MS Access DB query and it
works correctly, I can't see what can possibly be causing the problem!
Any suggestions would be greatly appreciated. This code is adapted from
something I've had online for 6+ years, just updating to
"Microsoft.Jet.OLEDB.4.0" (which part of the code had been overhauled, part
hadn't) ... and so getting a strange error like this is rather annoying.
Also, if I cut the code out of the Function, and paste it into the main
code, I get the same error, as does passing hard coded 'variables' for
strPCode AND curPrice (e.g. replacing them with what the function was
passing them, e.g. Code='ABC' AND Price=10
Any help would be very much appreciated!
Cheers,
Graeme
[Non-text portions of this message have been removed]
I'd say it's in the SQL string. I'd second the suggestion that
if CStr(curPrice) is a string, then maybe you need to add some ' marks.
You can add one piece at a time to your WHERE clause and see when it stops
working.
On Tue, Nov 10, 2009 at 4:46 AM, Graeme <gnwilson2001@...> wrote:
> Hi all,
>
> Well, this error has really got me stumped. There is no additional
> information other than: error '80004005' (not even the ever 'useful'
> Unspecified Error)
>
> The piece of code causing the problem is:
>
> Function BuildSize(strPCode, curPrice)
>
> Set objRecordset = Server.CreateObject("ADODB.Recordset")
>
> strSQL = "SELECT ProductID, Size, Code, SortCode, Quantity,
> ExtendedDelivery, POA"
> strSQL = strSQL & " FROM tblProducts"
> strSQL = strSQL & " WHERE Online = True AND Code='" & CStr(strPCode)
> & "' AND Price=" & CStr(curPrice)
> strSQL = strSQL & " ORDER BY Size;"
>
> objRecordset.Open strSQL, DB_ConnectionString, adOpenForwardOnly,
> adLockReadOnly, adCmdText
>
> ...
>
> End Function
>
> It dies on the "objRecordset.Open" part. The weirdest thing to me is that
> if I replace the strSQL = "SELECT * FROM tblProducts;" then the error
> disappears (of course it doesn't really provide a solution as to why there
> is the error.
>
> Adding ".tblProducts" to the SELECT fields (e.g. tblProducts.ProductID)
> doesn't solve the problem.
>
> objRecordset has been used previously, but even if I "Set objRecordset =
> Nothing" first, no go. Even if I make a new variable ("Dim objRecordset")
> within this Function, no go. It appears that I'm missing something in the
> SQL string, but as I can cut and paste it into an MS Access DB query and it
> works correctly, I can't see what can possibly be causing the problem!
>
> Any suggestions would be greatly appreciated. This code is adapted from
> something I've had online for 6+ years, just updating to
> "Microsoft.Jet.OLEDB.4.0" (which part of the code had been overhauled, part
> hadn't) ... and so getting a strange error like this is rather annoying.
>
> Also, if I cut the code out of the Function, and paste it into the main
> code, I get the same error, as does passing hard coded 'variables' for
> strPCode AND curPrice (e.g. replacing them with what the function was
> passing them, e.g. Code='ABC' AND Price=10
>
> Any help would be very much appreciated!
>
> Cheers,
> Graeme
>
>
>
> ------------------------------------
>
> ---------------------------------------------------------------------
> Home : http://groups.yahoo.com/group/active-server-pages
> ---------------------------------------------------------------------
> Post : active-server-pages@yahoogroups.com
> Subscribe : active-server-pages-subscribe@yahoogroups.com
> Unsubscribe: active-server-pages-unsubscribe@yahoogroups.com
> ---------------------------------------------------------------------Yahoo!
> Groups Links
>
>
>
>
[Non-text portions of this message have been removed]
Since you stripped down your SQL statement, I'd say it related to the where
clause.
I noticed your using CStr() to convert your second value to a string but not
wrapping it in quotes. It also appears to be a non-string/char value. Could
that be the issue?
Mark
--- On Tue, 11/10/09, Graeme <gnwilson2001@...> wrote:
From: Graeme <gnwilson2001@...>
Subject: [ASP] Bizarre error '80004005'
To: active-server-pages@yahoogroups.com
Date: Tuesday, November 10, 2009, 4:46 AM
Hi all,
Well, this error has really got me stumped. There is no additional information
other than: error '80004005' (not even the ever 'useful' Unspecified Error)
The piece of code causing the problem is:
Function BuildSize(strPCode, curPrice)
Set objRecordset = Server.CreateObject ("ADODB.Recordse t")
strSQL = "SELECT ProductID, Size, Code, SortCode, Quantity, ExtendedDelivery,
POA"
strSQL = strSQL & " FROM tblProducts"
strSQL = strSQL & " WHERE Online = True AND Code='" & CStr(strPCode) & "' AND
Price=" & CStr(curPrice)
strSQL = strSQL & " ORDER BY Size;"
objRecordset. Open strSQL, DB_ConnectionString , adOpenForwardOnly,
adLockReadOnly, adCmdText
...
End Function
It dies on the "objRecordset. Open" part. The weirdest thing to me is that if I
replace the strSQL = "SELECT * FROM tblProducts; " then the error disappears (of
course it doesn't really provide a solution as to why there is the error.
Adding ".tblProducts" to the SELECT fields (e.g. tblProducts. ProductID) doesn't
solve the problem.
objRecordset has been used previously, but even if I "Set objRecordset =
Nothing" first, no go. Even if I make a new variable ("Dim objRecordset" )
within this Function, no go. It appears that I'm missing something in the SQL
string, but as I can cut and paste it into an MS Access DB query and it works
correctly, I can't see what can possibly be causing the problem!
Any suggestions would be greatly appreciated. This code is adapted from
something I've had online for 6+ years, just updating to "Microsoft.Jet.
OLEDB.4.0" (which part of the code had been overhauled, part hadn't) ... and so
getting a strange error like this is rather annoying.
Also, if I cut the code out of the Function, and paste it into the main code, I
get the same error, as does passing hard coded 'variables' for strPCode AND
curPrice (e.g. replacing them with what the function was passing them, e.g.
Code='ABC' AND Price=10
Any help would be very much appreciated!
Cheers,
Graeme
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[Non-text portions of this message have been removed]
Hi all,
Well, this error has really got me stumped. There is no additional information
other than: error '80004005' (not even the ever 'useful' Unspecified Error)
The piece of code causing the problem is:
Function BuildSize(strPCode, curPrice)
Set objRecordset = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT ProductID, Size, Code, SortCode, Quantity, ExtendedDelivery,
POA"
strSQL = strSQL & " FROM tblProducts"
strSQL = strSQL & " WHERE Online = True AND Code='" & CStr(strPCode) & "' AND
Price=" & CStr(curPrice)
strSQL = strSQL & " ORDER BY Size;"
objRecordset.Open strSQL, DB_ConnectionString, adOpenForwardOnly,
adLockReadOnly, adCmdText
...
End Function
It dies on the "objRecordset.Open" part. The weirdest thing to me is that if I
replace the strSQL = "SELECT * FROM tblProducts;" then the error disappears (of
course it doesn't really provide a solution as to why there is the error.
Adding ".tblProducts" to the SELECT fields (e.g. tblProducts.ProductID) doesn't
solve the problem.
objRecordset has been used previously, but even if I "Set objRecordset =
Nothing" first, no go. Even if I make a new variable ("Dim objRecordset") within
this Function, no go. It appears that I'm missing something in the SQL string,
but as I can cut and paste it into an MS Access DB query and it works correctly,
I can't see what can possibly be causing the problem!
Any suggestions would be greatly appreciated. This code is adapted from
something I've had online for 6+ years, just updating to
"Microsoft.Jet.OLEDB.4.0" (which part of the code had been overhauled, part
hadn't) ... and so getting a strange error like this is rather annoying.
Also, if I cut the code out of the Function, and paste it into the main code, I
get the same error, as does passing hard coded 'variables' for strPCode AND
curPrice (e.g. replacing them with what the function was passing them, e.g.
Code='ABC' AND Price=10
Any help would be very much appreciated!
Cheers,
Graeme
--- In helpwithvb@yahoogroups.com, "Marvin Hunkin" <startrekcafe@...> wrote:
Hi .
did a course in visual basic at a college in south Australia in 2008 ,
Australia.
And a blind programming student using the jaws for windows screen reader
from http://www.freedomscientific.com
well had forgotten a lot of what i learnt in vb.
and now a lot of the examples in the course got corrupted.
and only my final project survived.
now.
a blind friend and i developing a star trek application using visual web
developer 2008 express and sql server and management studio 2008 express.
and he had written quite a lot of articles and will post on
http://www.blindgeeks.org
but my turn to write the article.
and when i got to advanced sql.
for using data tables got a bit stuck.
so created a test site and some quizzes.
but now, he is abandoing me.
as i am struggling to complete this third quiz.
the third quiz is to create a function, which takes two parameters and adds
the two numbers and returns the two numbers .
in vwd.
in the website and a message to show the two integers passed and the final
result.
Rick thomas says he is the guy who is helping me to learn my vb education on
my own.
so will paste the vb class, the markup for the page and the sub module click
event code.
he says that i am calling it incorrect.
can you please help.
if you are still up tonight.
or over the weekend.
please reply asap.
and help me out.
until i can figure this quiz out.
he says the star trek series is off, until i have a better understanding of
vb, and functions, sub, and parameters.
have been reading some tutorials on line.
please help me out if possible.
at a loss.
cheers Marvin.
Imports Microsoft.VisualBasic
Public Class TestClass1
' Public sub for Hello World Goes here.
Public Sub HelloWorld()
' User Message goes Here.
UserMsg.Show("Hello World")
End Sub
Public Sub DisplayParms (ByVal PassedMessage As string )
' User Msg goes here.
UserMsg.Show("PassedMessage Variable " & PassedMessage)
End Sub
Public Function AddTwoNumbers(ByVal PassedInt1 As Integer, ByVal
PassedInt2 As Integer) As Integer
' Declare Variables.
Dim answer As Integer = 0
' User Message for PassedInt1.
UserMsg.Show("PassedInt1 " & PassedInt1)
' User Message for PassedInt2.
UserMsg.Show("PassedInt2 " & PassedInt2)
' Return answer.
answer = PassedInt1 + PassedInt2
' User Message for answer.
UserMsg.Show("Answer is " & answer)
Return answer
end function
End Class
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button runat="server" Text="Display" ID="Button1" />
</div>
</form>
</body>
</html>
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
' Declare Variables.
' Instantiate a copy of the class.
' Call the sub routine.
Dim PassedInt1 As Integer = 2
Dim PassedInt2 As Integer = 2
Dim TestClass1 As TestClass1
TestClass1 = New TestClass1()
TestClass1.HelloWorld()
TestClass1.DisplayParms("Hello world")
TestClass1.AddTwoNumbers(PassedInt1, PassedInt2 )
End Sub
End Class
and here's the user msessage, the global code module and a logger module.
Public Class Globals
' Function:
' This Class holds global constants and variables so no need to
Instantiate.
Public Shared RootPath As String = ""
Imports Microsoft.VisualBasic
Imports System.Configuration
Public Class Logger
' Private Shared Inst As Logger = New Logger
Public Shared Sub WriteLine(ByVal Line As String)
Dim Filename As String
filename = "c:\TestSite\Logger.txt"
Dim objWriter As New System.IO.StreamWriter(Filename, True)
Try
If Not objWriter Is Nothing Then
objWriter.WriteLine(Line)
End If
Catch ex As Exception
End Try
objWriter.Close()
objWriter.Dispose()
End Sub
Public Shared Sub Clear()
Dim filename As String
filename = "c:\TestSite\Logger.txt"
' filename = Globals.RootPath & _
' System.Configuration.ConfigurationManager.AppSettings("LoggerPath")
Dim Sw As System.IO.StreamWriter
Sw = new System.IO.StreamWriter(filename)
Sw.WriteLine(" Newly Created:")
Sw.WriteLine( "")
Sw.Close()
Sw.Dispose()
End Sub
End Class
Imports Microsoft.VisualBasic
Public Class UserMsg
Public Shared Sub Show(ByVal Message As String)
System.Web.HttpContext.Current.Response.Write( _
"<SCRIPT LANGUAGE=""JavaScript"">" _
& vbCrLf)
System.Web.HttpContext.Current.Response.Write( _
"alert(""" & Message & """)" _
& vbCrLf)
System.Web.HttpContext.Current.Response.Write("</SCRIPT>")
End Sub
End Class
End Class
----- Original Message -----
From: "RicksPlace" <ofbgmail@...>
To: "Marvin Hunkin" <startrekcafe@...>
Sent: Friday, September 18, 2009 8:58 PM
Subject: Re: quiz 3 success
The following is not a correct call to a function. It demonstrates that you
do not understand the diference between a Subroutine and a Function even
though I just told you in the most simple terms I could. You will have to
continue your VB education on your own until you can use functions and
subroutines well. When you get there let me know and I will give you some
more quizs to make sure you understand them so I don't have to go through
trying to teach you Visual Basic on top of VWD. Then we can continue with
the series if I am not off into another project by then.
TestClass1.AddTwoNumbers(PassedInt1, PassedInt2 )
The above statement is incorrect.
End Sub
----- Original Message -----
From: "Marvin Hunkin" <startrekcafe@...>
To: "RicksPlace" <ofbgmail@...>
Sent: Friday, September 18, 2009 6:43 AM
Subject: Re: quiz 3 success
> hi.
> here's the click event module.
> is that what you are looking for.
> if not please explain exactly what you want.
> not a mind reader.
> Marvin.
>
>
> Partial Class _Default
> Inherits System.Web.UI.Page
>
> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Button1.Click
>
> ' Declare Variables.
> ' Instantiate a copy of the class.
> ' Call the sub routine.
> Dim PassedInt1 As Integer = 2
> Dim PassedInt2 As Integer = 2
> Dim TestClass1 As TestClass1
> TestClass1 = New TestClass1()
> TestClass1.HelloWorld()
> TestClass1.DisplayParms("Hello world")
> TestClass1.AddTwoNumbers(PassedInt1, PassedInt2 )
> End Sub
> End Class
>
>
> ----- Original Message -----
> From: "RicksPlace" <ofbgmail@...>
> To: "Marvin Hunkin" <startrekcafe@...>
> Sent: Friday, September 18, 2009 7:32 PM
> Subject: Re: quiz 3 success
>
>
> OK, here is the story. You use a functiion for a diferent reason than a
> Subroutine. A subroutine is a block of code you want to execute that does
> something like read a file or write a file or other things. A function is
> a
> block of code you call when you want to get something like a value
> returned
> to the calling module. A function returns a value to the calling module
> while a subroutine does not return a value to the calling subroutine.
> Functions are things that do something and return something. Most math
> functions are functions like to get the square root of a number or other
> built-in functions. Your problem did not require anything except to
> specify
> the parameters to pass into your function. Both Subroutines and Functiions
> can receive parameters. The parameter list in the calling module must
> match
> the parameter list in the called module. Now. Please display the result of
> your function in the click event and send me the code for the click event
> when done.
> I will not do any more explanations on this subject unless we get into
> more
> depth with functions and subs related to the project.
> Rick
> ----- Original Message -----
> From: "Marvin Hunkin" <startrekcafe@...>
> To: "RicksPlace" <ofbgmail@...>
> Sent: Friday, September 18, 2009 5:11 AM
> Subject: Re: quiz 3 success
>
>
>> hi.
>> well tell me how to get it to work.
>> thought i had.
>> let me know.
>> i am not a mind reader.
>> please let me know what you meant.
>> had to copy the function definition from that web site page.
>> so not sure why i was getting errors.
>> if i called the function straight from the click event was getting
>> errors.
>> so tell me how to get it right and to fix it right.
>> i am not a mind reader.
>> sorry.
>> i have disapointed you.
>> Marvin.
>> ----- Original Message -----
>> From: "RicksPlace" <ofbgmail@...>
>> To: "Marvin Hunkin" <startrekcafe@...>
>> Sent: Friday, September 18, 2009 6:15 PM
>> Subject: Re: quiz 3 success
>>
>>
>> Marv: You are not using the variable you return to the click event. the
>> idea
>> behind a function is that you call it to get something.In you r click
>> event
>> display the result of the calculation.
>> ----- Original Message -----
>> From: "Marvin Hunkin" <startrekcafe@...>
>> To: "RicksPlace" <ofbgmail@...>
>> Sent: Friday, September 18, 2009 1:11 AM
>> Subject: quiz 3 success
>>
>>
>>> hi.
>>> do not know why i was getting those errors.
>>> so went to the home work site and copied the private function
>>> definition.
>>> changed it to public.
>>> now got the quiz working.
>>> it gives me the correct answer.
>>> so got it working at last.
>>> glad about that.
>>> able to pass 2 variables .
>>> cheers Marvin.
>>>
>>> ps: was able to figure this on my own eventually.
>>> at least learning to debug my code.
>>>
>>> Imports Microsoft.VisualBasic
>>>
>>> Public Class TestClass1
>>>
>>> ' Public sub for Hello World Goes here.
>>> Public Sub HelloWorld()
>>> ' User Message goes Here.
>>> UserMsg.Show("Hello World")
>>> End Sub
>>> Public Sub DisplayParms (ByVal PassedMessage As string )
>>> ' User Msg goes here.
>>> UserMsg.Show("PassedMessage Variable " & PassedMessage)
>>> End Sub
>>> Public Function AddTwoNumbers(ByVal PassedInt1 As Integer, ByVal
>>> PassedInt2 As Integer) As Integer
>>>
>>> ' Declare Variables.
>>>
>>> Dim answer As Integer = 0
>>>
>>> ' User Message for PassedInt1.
>>> UserMsg.Show("PassedInt1 " & PassedInt1)
>>> ' User Message for PassedInt2.
>>> UserMsg.Show("PassedInt2 " & PassedInt2)
>>>
>>> ' Return answer.
>>> answer = PassedInt1 + PassedInt2
>>> ' User Message for answer.
>>> UserMsg.Show("Answer is " & answer)
>>> Return answer
>>> end function
>>>
>>> End Class
>>>
>>> <%@ Page Language="VB" AutoEventWireup="false"
>>> CodeFile="Default.aspx.vb"
>>> Inherits="_Default" %>
>>>
>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>>>
>>> <html xmlns="http://www.w3.org/1999/xhtml">
>>> <head runat="server">
>>> <title></title>
>>> </head>
>>> <body>
>>> <form id="form1" runat="server">
>>> <div>
>>> <asp:Button runat="server" Text="Display" ID="Button1" />
>>> </div>
>>> </form>
>>> </body>
>>> </html>
>>>
>>>
>>> Partial Class _Default
>>> Inherits System.Web.UI.Page
>>>
>>> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
>>> System.EventArgs) Handles Button1.Click
>>>
>>> ' Declare Variables.
>>> ' Instantiate a copy of the class.
>>> ' Call the sub routine.
>>> Dim PassedInt1 As Integer = 2
>>> Dim PassedInt2 As Integer = 2
>>> Dim TestClass1 As TestClass1
>>> TestClass1 = New TestClass1()
>>> TestClass1.HelloWorld()
>>> TestClass1.DisplayParms("Hello world")
>>> TestClass1.AddTwoNumbers(PassedInt1, PassedInt2 )
>>> End Sub
>>> End Class
>>>
>>>
>>>
>>
>>
>>
>
>
>
--- End forwarded message ---