473,595 Members | 2,456 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Works on one page, but not the other?!

4 New Member
I've been assigned a bugfix where a particular bit of script that selects the appropriate connection has suddenly started to fail:

if formatdatetime( dateStr, 1) = formatdatetime( now(), 1) then
With cn
.ConnectionStri ng= ShapeConnection
.CommandTimeout = .ConnectionTime out
.Open
End With
elseif formatdatetime( dateStr, 1) < formatdatetime( now(), 1) then
With cn
.ConnectionStri ng = Apollo2ShapeCon nection
.CommandTimeout = .ConnectionTime out
.Open
End With
end if

where dateStr is a date selected by the user in a dd-mm-yyyy format. The comparison is failing in both cases and so no connection is being selected. I've changed the code to the following and now it works fine:

if cdate(dateStr) = cdate(now()) then
With cn
.ConnectionStri ng= ShapeConnection
.CommandTimeout = .ConnectionTime out
.Open
End With
elseif cdate(dateStr) < cdate(now()) then
With cn
.ConnectionStri ng = Apollo2ShapeCon nection
.CommandTimeout = .ConnectionTime out
.Open
End With
end if

It does work now so I'm happy enough with that. What I really dont understand is the original bit of script is used in quite a few pages, and in all these other pages it still works fine. All the pages are on the server and all recieve the dateStr variable in the same format. I've passed the same date into both pages, in one case it fails, in the other it works. WHY?!?

Any ideas about this would be greatly appreciated! It is severely messing with my head!

Cheers :)
Sep 1 '06 #1
0 1061

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3127
by: Sean | last post by:
Hello, The isset($_REQUEST) works okay on other servers but not on mine. The way the application works is the links are provided as: http://url.com/cc.php?page=currencies&new And then in cc.php the code is if isset($_REQUEST) {
4
5458
by: lawrence | last post by:
Can anyone tell me why this code works in Netscape 7.1 but not in IE??? <SCRIPT type='text/javascript'> function makeVisible(nameOfDiv) { document.getElementById(nameOfDiv).style.visibility='visible'; document.getElementById(nameOfDiv).style.height='auto'; if (nameOfDiv != 'weblogs')
1
2134
by: | last post by:
The following code: Private Sub ClearControls(ByVal ctrl As Control) Dim i As Int32 For i = ctrl.Controls.Count - 1 To 0 Step -1 ClearControls(ctrl.Controls(i))
10
2744
by: Guadala Harry | last post by:
I have a modal dialog that currently does all of the following except item 4. 1. lets users select a graphic from a list of thumbnails (and when selected, displays the full-size image in a preview DIV) 2. when users close the dialog, the application receives the URL to the selected graphic. 3. the modal dialog lets the users upload a new graphic if the dialog does not present them with one they are already happy with. 4. upon uploading...
2
8505
by: Mark | last post by:
Hi, I'm fairly new to .NET and having problems getting an ASP.NET page working on my web host. The page works fine on my PC running against localhost. I have a MySQL database and a simple C# app with an odbcConnection object, odbcDataAdapter and a datasetCustomers object placed on the form. On page load, I fill the datasetCustomers from the "Customers" table
5
2233
by: Grigs | last post by:
Hello, I have a project that contains a WebService that works great when connecting to it on my Localhost. Once we post the files to the test web server, all of the pages that do not touch the webservice work fine. However, the ones that do touch it get the following error: The request failed with HTTP status 404: Not Found Here is the full error:
6
2067
by: patrick j | last post by:
Hi I've been testing out the "Conditional Comment" for IE. This is because for my web-site I want to have two style sheets, one for IE 6 and one for other browsers. Thus I hope to have my web-site as I want it for "other browsers" but still have it presentable in IE. I understand why the conditional comment works, despite the subject header for this posting. What I don't understand is why IE "ignores" the link to the CSS that precedes...
0
918
by: Radu | last post by:
Hi. I have a page which contains this hyperlink: <a href="Excel%20Docs/Structure%20Summary.xls" target="_blank"> where the file "Structure Summary.xls" has a size of about 1.5MB. The link works great from all the desktops in our company, but on some laptops it fails with "The page cannot be displayed" page. It does NOT fail 100% of the time, only most of the time... say 95%. I click on the link, I can hear the disk spinning for about 3...
1
3400
by: Chris Auer | last post by:
I have one page that gets its contents from a class called FormBuilder.cs. It generates a web part. On that page GetWebResourceUrl works fine. All other pages generates an invalid assembly key. If I change the type to the working class I can make it work on any page. Works string scriptLocation = Page.ClientScript.GetWebResourceUrl(typeof(FormsBuilderWebPart.FormBuilder), "FormsBuilderWebPart.JScript1.js");
1
1330
Ajm113
by: Ajm113 | last post by:
I am running the Bizzar Server and I got mysql and php working. I created a login/logout page that does the user stuff and it works 100%. But if I used mysql on some other page I get these warnings. Warning: mysql_query() : Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\BizzarServer\Apache2\htdocs\index.php on line 77 Warning: mysql_query() : A link to the server could not be established in...
0
7883
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8262
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8020
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6675
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5839
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3915
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2391
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1491
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1226
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.