Print Page | Close Window

Cdate error after migration

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=13632
Printed Date: 05 April 2026 at 2:53am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Cdate error after migration
Posted By: wnypa
Subject: Cdate error after migration
Date Posted: 03 February 2005 at 2:58pm
After migrating from sql to access manually, I get this error everytime a new user posts, I've narrowed it down to it not posting the joined date in the access database, If i manually enter it, the problem goes away. 
-=error=-
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'CDate'

/forum/forum_posts.asp, line 645
/-=error=-
a simelar message appears in a PM from the same new user(since the migration).
 
I had some other issues with nulls in the database i fixed them by setting the default value to 0. but this problem remains.



Replies:
Posted By: dj air
Date Posted: 03 February 2005 at 6:14pm
please search the forum as this has been gone over many , many times.

im not sure but i think it was to do with te LCID .

have the miogration changed to a different part of the word, server completely.. also this is discussed within the documentation that comes with the forum.


Posted By: wnypa
Date Posted: 04 February 2005 at 3:47pm
The LCID is the same, and the server has not changed, I believe this not to be a region issue.
 
I have looked at both common.asp files old and new and both are set to 'Session.LCID = 1033  This is hosted by me, and I haven't changed regions.
 
I check the format of the cell in the new access database, and it appears to be the same format as the old.
 
I've gone through all the old posts with a cdate error. I only get the error when the page has to post the joined date. which is null, because when they joined it didn't post the date to the new database.


Posted By: wnypa
Date Posted: 04 February 2005 at 4:23pm
Problem Solved!!!
 
Default value was missing in the database (again) changed to "now()"
and all is well again... I hope this helps someone in the future migrating from SQL to Access.
 
 
Thanks for the Ideas from moderators.Clap


Posted By: dj air
Date Posted: 04 February 2005 at 4:27pm
no problem, ill remember that if someone else asks about it.LOL


Posted By: iSec
Date Posted: 13 February 2005 at 12:27am
Hello guys,
 
Please help me overcome the above error as I am facing it now after migrating from MS SQL to MS Access, where do I start and what to fix? Thanks for your time.


Posted By: WebWiz-Bruce
Date Posted: 13 February 2005 at 4:51am
The CDate error on the forum_posts.asp page is usually cousred by the edit date, if the post has been edited.

The problem comes when changing servers etc. from a server that uses a period (.) in decimal numbers and those servers that use (,) in decimal numbers eg:-

123456.55
123456,55

If you have access to the server, changing the servers settings to use (.) instead of (,) or vise versa would sortout this issue.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: sfd19
Date Posted: 13 February 2005 at 7:14am
Originally posted by -boRg- -boRg- wrote:

The CDate error on the forum_posts.asp page is usually cousred by the edit date, if the post has been edited.

The problem comes when changing servers etc. from a server that uses a period (.) in decimal numbers and those servers that use (,) in decimal numbers eg:-

123456.55
123456,55

If you have access to the server, changing the servers settings to use (.) instead of (,) or vise versa would sortout this issue.
Without server acces he can use this:
 
Originally posted by sfd19 sfd19 wrote:

We had the same problem after switching from an American server to a German server and then back to an American. It was annoying
 
Right before this line in /functions/functions_format_post.asp
 
If isNumeric(dtmEditedDate) Then dtmEditedDate = CDate(dtmEditedDate) Else dtmEditedDate = 0
 
add a new line.
 
When your server is using "." in the date format (eg German servers) then add
dtmEditedDate = Replace(dtmEditedDate,",",".")
or when your server is using "," in the date format (eg American servers) then add
 
dtmEditedDate = Replace(dtmEditedDate,".",",")
 
When you are not sure what format your current server is using then check for a message in your database that has been edited with the current server settings and see if that server is using "," or "." in the number of the edited date. Then apply the fitting code line from above.
 
That should help.
 
http://forums.webwiz.net/forum_posts.asp?TID=13374&PN=3&TPN=1 - http://forums.webwiz.net/forum_posts.asp?TID=13374&PN=3&TPN=1
 
 
On a personal note, Borg, I would really recommend that you create a closed sticky here where you add the solutions to the main problems that are getting asked about 3 times here every week.
 
'Admin password', 'Login problem', 'CDate', 'Group/member permissions' , 'Email setup', 'free hosts' and more, all of it has been asked and answered a hundred times here.
You could save yourself a lot of time by creating a closed 'Your problem gets solved here!'-sticky, then add the solutions to the main problems, then a link to the WWF FAQ and then a link to the search button that seems to be so hard to find.
 
Just a suggestion. Wink
 


-------------
Politics, economy & social issues: http://www.studentsfordemocracy.net - StudentsforDemocracy.net


Posted By: iSec
Date Posted: 13 February 2005 at 2:22pm
Originally posted by -boRg- -boRg- wrote:

The CDate error on the forum_posts.asp page is usually cousred by the edit date, if the post has been edited.

The problem comes when changing servers etc. from a server that uses a period (.) in decimal numbers and those servers that use (,) in decimal numbers eg:-

123456.55
123456,55

If you have access to the server, changing the servers settings to use (.) instead of (,) or vise versa would sortout this issue.
I do not have access to the server. Could you tell me where specifically to look in the forum and what to edit? Thanks.


Posted By: iSec
Date Posted: 13 February 2005 at 3:26pm
i GET THIS ERROR WHEN TRYING TO POST A NEW MESSAGE:


Posted By: dj air
Date Posted: 13 February 2005 at 3:32pm
what is on that line. it maybe that you need to set the default values for the feilds.

open the database and make sure the default values for fields are correct.

but please post the line then we can get a better idea.

also a version number of WWF and database type would be helpful to.


Posted By: iSec
Date Posted: 13 February 2005 at 3:39pm

Ok here's what is on the line 826 of post_message.asp:

lngNumOfPosts = CLng(rsCommon("No_of_posts"))
 
 


Posted By: dj air
Date Posted: 13 February 2005 at 3:45pm
is the account a brand new one (IE the account has not posted before).

this database was upsized right (is now SQL and was access?)

this problem maybe because during the upsizing the

field type wasn't put to int/big int

or the default value is not set to 0

or the field doesn't contain a value at all (if this one look about the one above as that may not be set also)



Posted By: iSec
Date Posted: 13 February 2005 at 3:50pm

Dj air, please be patient with me. I'm not very good at this, I used to have my forum as SQL but after I changed hosting provider I no lonegr had MS SQL database so I switched to Access.

I uploaded a brand new access version to my webspace, then I went to the wwForum.mdb and replaced it with my SQl database wwwForum.mdb that i used to have on the old forum. Now any user registers and posts they get these errors and I don't know what to do.


Posted By: dj air
Date Posted: 13 February 2005 at 4:09pm
have you made sure that the database is correct and 100% in tacked?

did you do a compact and repair on the database?

it sounds like te default values aren't set in the database, have you tried a blank new database to see if that fixes it , then you know its because the database is not correct.


Posted By: iSec
Date Posted: 13 February 2005 at 4:14pm
How do I make sure that the db is correct and 100% in tacked? Do I open it in MS Access and check on that or how? And how do I set the default values? How do I add a blank new database? I am so thankful to you mate. Your help is appreciated. BTW, I did not repair or compact the db.


Posted By: dj air
Date Posted: 13 February 2005 at 4:20pm
no problem

1 Setting default values

- open the database in Access
- then open the tables in design view
then in each row/field you see a name,field type - comment

if you click the row in the bottom section you see lots of values /options.

make sure the one that says default value has '0' for the number of posts (this is for the threads table)

2. to Compact and repair

ope n the database in access, then on the tools menu you will see database utilities i think

click that and select Compact & Repair"


trying a new database

upload a new blank database withithe same name as the one on the server , this will replace the existing one.. then try posting a message, if it works you know its the original database thats the problem.

make sure you back up the original database before uplopading a blank one.


Posted By: iSec
Date Posted: 13 February 2005 at 4:32pm
then in each row/field you see a name,field type - comment
 
So you're saying that I should replace any value in those fields with the word: commentQuestion or a dash before whatever comment is there?
 


Posted By: dj air
Date Posted: 13 February 2005 at 4:39pm
no.. ill explain thats was just saying what the collumn names where

in the above screen shot you see te section called general and one set back saying lookup?

if you make sure the general pannel is in front as it is in the screen shot.

then in the list below you should see default value .

--> where it says field name at the top of the screen shot.. there is a list of fields (PM_ID, Author_ID....)

click on PM_Message_Date, then in the section i mentioned above about the defaul value see if it s default value is set to NOW()

then use the same method to check the post count within the tblauthor table, the default value should be 0

also check that the join dates default value  is set to NOW()



after another way to check is to open the table in record view so you can see the records.

thehn see what value is in those fields mentioned if there is nothing at all in them for any record, oralso the very bottom one as the last one is the default values per a new record.


Posted By: iSec
Date Posted: 13 February 2005 at 5:04pm
Do I do this for every single table or just for the ones that you mentioned (PM_Message_Date, join dates, post count within the tblauthor table)?


Posted By: dj air
Date Posted: 13 February 2005 at 5:08pm
you need to make sure all tables default values are correct, you wiull have to compare them to a default/blank database.


Posted By: iSec
Date Posted: 13 February 2005 at 5:11pm
Ok I can't do this Confused I will try to go back to MS SQL, my friend has an MS SQL db. I will keep you informed if I get any errors while doing that.


Posted By: dj air
Date Posted: 13 February 2005 at 5:14pm
if you can are able to / security i mean . you can send a copy of the database to me at aaron [@] emagine-hosts.com and i wil download and look tomorrow.?


Posted By: iSec
Date Posted: 13 February 2005 at 5:18pm
Ok but before we do this, do you think I should go back to MS SQL as I have about 1000 forum mebers? By the way, I can zip the db and upload it on my webspace and you can download it from there.


Posted By: dj air
Date Posted: 13 February 2005 at 5:22pm
you have 1000 members , what sort of traffic, users do you get on at once?

also how many forums, topics and threads do you have, likely to get if its quite a few i would recommend going back to SQL.


Posted By: sfd19
Date Posted: 13 February 2005 at 5:32pm
Originally posted by Info_Tech Info_Tech wrote:

Originally posted by -boRg- -boRg- wrote:

The CDate error on the forum_posts.asp page is usually cousred by the edit date, if the post has been edited.

The problem comes when changing servers etc. from a server that uses a period (.) in decimal numbers and those servers that use (,) in decimal numbers eg:-

123456.55
123456,55

If you have access to the server, changing the servers settings to use (.) instead of (,) or vise versa would sortout this issue.
I do not have access to the server. Could you tell me where specifically to look in the forum and what to edit? Thanks.
 
Was my post right above yours not clear enough - where I explained what to do when you do not have access to the server?


-------------
Politics, economy & social issues: http://www.studentsfordemocracy.net - StudentsforDemocracy.net


Posted By: iSec
Date Posted: 13 February 2005 at 5:41pm
dj air, to see the forum of my website: http://www.iraqvoice.com/justa/aforum/default.asp - http://www.iraqvoice.com/justa/aforum/default.asp
 
sfd19, No it wasn't clear enough "to me"...It would be great if you give me an explaination as if you're talking to a beginner that is facing this issue for the first time. Thanks.


Posted By: dj air
Date Posted: 13 February 2005 at 6:29pm
with the number of posts (60 thosand) i would recommend the SQL version.




Posted By: sfd19
Date Posted: 13 February 2005 at 8:18pm
Originally posted by Info_Tech Info_Tech wrote:

dj air, to see the forum of my website: http://www.iraqvoice.com/justa/aforum/default.asp - http://www.iraqvoice.com/justa/aforum/default.asp
 
sfd19, No it wasn't clear enough "to me"...It would be great if you give me an explaination as if you're talking to a beginner that is facing this issue for the first time. Thanks.
 
That is how I tried to explain it. Which part was not 'beginner-like'?
 
 
Originally posted by sfd19 sfd19 wrote:

Right before this line in /functions/functions_format_post.asp
 
If isNumeric(dtmEditedDate) Then dtmEditedDate = CDate(dtmEditedDate) Else dtmEditedDate = 0
 
add a new line.
 
When your server is using "." in the date format (eg German servers) then add
 
dtmEditedDate = Replace(dtmEditedDate,",",".")
 
or when your server is using "," in the date format (eg American servers) then add
 
dtmEditedDate = Replace(dtmEditedDate,".",",")
 
When you are not sure what format your current server is using then check for a message in your database that has been edited with the current server settings and see if that server is using "," or "." in the number of the edited date. Then apply the fitting code line from above.
 


-------------
Politics, economy & social issues: http://www.studentsfordemocracy.net - StudentsforDemocracy.net



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net