473,480 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create 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
.ConnectionString= ShapeConnection
.CommandTimeout = .ConnectionTimeout
.Open
End With
elseif formatdatetime(dateStr, 1) < formatdatetime(now(), 1) then
With cn
.ConnectionString = Apollo2ShapeConnection
.CommandTimeout = .ConnectionTimeout
.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
.ConnectionString= ShapeConnection
.CommandTimeout = .ConnectionTimeout
.Open
End With
elseif cdate(dateStr) < cdate(now()) then
With cn
.ConnectionString = Apollo2ShapeConnection
.CommandTimeout = .ConnectionTimeout
.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 1054

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

Similar topics

2
3117
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...
4
5431
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) {...
1
2125
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
2731
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...
2
8491
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#...
5
2224
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...
6
2061
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...
0
912
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...
1
3395
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...
1
1320
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....
0
7037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7076
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6732
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...
0
6886
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...
1
4768
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...
0
4472
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...
0
2990
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...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
174
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...

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.