473,545 Members | 2,679 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 1058

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

Similar topics

2
3124
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
5452
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
2133
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
2735
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...
2
8502
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...
5
2230
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...
6
2066
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...
0
917
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...
1
3398
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 =...
1
1329
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 ...
0
7428
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...
0
7685
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. ...
0
7784
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6014
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...
0
5071
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3485
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1039
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
738
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...

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.