Wrox Programmer Forums
|
BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4
This is the forum to discuss the Wrox book Beginning Dreamweaver MX by Charles E. Brown, Imar Spaanjaars, Todd Marks; ISBN: 9780764544040
Please indicate which version of the book you are using when posting questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 12th, 2004, 06:12 PM
Registered User
 
Join Date: Jun 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default TheSoccerSite

Hi All,

I have just Bought ' Beginning Dreamweaver MX 2004 ! I have been working through it. I have a few problems so I thought I would load the Final Complete Site using Microsoft IIS as the server. It is actually an SQL Server.

Everything works great except that the files in the Admin folder of the site will not write to the database. In other words all logins and database connections are working but the database input is failing. With createEvents.asp which |I have been working with I get an erroe message saying that there is a data type mismatch.

The precise message is

" # Error Type:
Microsoft JET Database Engine (0x80040E07)
Data type mismatch in criteria expression.
/theLocalSoccerSite/Admin/createEvent.asp, line 135 "

I am really struggling with it since as far as i know the Final Site downloaded from Wrox is tested to work correctly. It is probably a silly mistake that I have made but I cannot figure it out. I tried checking the .mdb to see what the mismatch could be but could not see anything wrong with it.

Previously, I had an error the operation must be an updateable query but that has gone since I added read.write and modify permissions to the database folder that resides outside the site on my hard disk in the database folder. IUSR_ComputerName permissions have been given.

Is there anyone who can offer some guidance on this?

Bye now,

Eddie

eddie
 
Old June 13th, 2004, 05:08 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Eddie,

You say your server is actually a SQL Server. Does that mean you're running TheSoccerSite against a SQL Server database? Or are you still using the provided Access database?

To see whate exactly you're sending to the database, can you make the following changes to the code, and then post the outcome to this forum? Change the code around line 135 (MM_editCmd.Execute) to this:
Code:
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    Response.Write("SQL is " & MM_editQuery)
    Response.End()
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close
    I think the problem has to do with the way you're sending a date to the database, but I am not sure yet....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old June 13th, 2004, 04:08 PM
Registered User
 
Join Date: Jun 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Thanks for your help on this. I have got a SQL Server 2000 'trial' version on the machine which upgraded MSDE 7.0, I think but the database is an access *.mdb. I was assuming that the code that would 'kick in', would be the code that connects to the access database.

I cut and pasted the code from your e-mail and the following appeared on the events.asp page "SQL is insert into Events (Title,Summary,EventDescription,Category,StartDate ,EndDate) values ('c','c','c',1,'3.4.2000','7.8.2003')" but nothing else came up at all!!

To be honest, I am not sure what all this signifies but would be very grateful for your advice.

Bye now,

Eddie Bickford

eddie
 
Old June 13th, 2004, 04:14 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I sort of assumed the code you're using to connect to the database is pretty much the same as in the book.

What often matters with these kind of errors, is the data you're sending to the database.

It's correct that nothing else showed up; that was the whole purpose of the code I gave you. The statement wrote out the SQL that is about to be send to the database, and then stops the page execution (Response.End)

Are you sure your setup accepts the '7.8.2003' format for a date? Did you try 07/08/2003 instead?

And maybe the code that connects to the database *does* matter. I am still not sure what database you're using. Can you post your connection string and code if the previous solution doesn't work?

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old June 14th, 2004, 02:43 PM
Registered User
 
Join Date: Jun 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Imar - It was the date. I was putting in 3.4.2000 date format which is accepted but obviously is not a format that the database likes. It works now. I am very grateful as I am going through the book and sometimes my own effort does not work so it is very helpful to check the working site against the practice site.

Incidentally, I have noticed that you are one of the co-authors and those admitted to my database!!! So thanks again.

I am very grateful as it has been most frustrating with me also consulting my domain site tech guys with absurd questions about write permissions etc. when all the time it was the date. I thought it must something else but could not locate it.

Maybe if there are any problems again, I can consult you once more but for now thanks.

Bye now,

Eddie Bickford

eddie
 
Old June 14th, 2004, 04:56 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Eddie,

Yes, I am one of the authors. In fact, I am the one that wrote the part about TheSoccerSite, so I should know how it works, and what to expect.

If you want to fix errors like you had now in the future, you have a couple of options. 1st, you can use the regular expressions we used in the book to check for a valid dd.mm.yyyy format. Then at the server, use the ASP replace function to replace each dot with a slash. This way, you user can enter your date format, while ASP / ADO still receives the required format with the slashes.

Alternatively, you can offer three drop downs for the day, month and year, or offer a calendar (there are many commercial and free calendars available). This way, you can be sure about the format of the date you receive.
Finally, you could change the regional settings for the entire Web site so it accepts your date format. Personally, I wouldn't go for that option, as it makes your application server dependent.

While typing this message I received your e-mail. The answer to this problem can be found in this FAQ: http://Imar.Spaanjaars.Com/QuickDocID.aspx?QUICKDOC=263

I hope all this helps, and if it doesn't: let me know.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old June 15th, 2004, 10:52 AM
Registered User
 
Join Date: Jun 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar - Thanks that's a great help.

Bye now,

Eddie Bickford

eddie
 
Old June 15th, 2004, 10:54 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're welcome

Did that also answer the e-mail you sent me? In that case, I won't respond to that separately.....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dreamweaver - TheSoccerSite - Calculator.asp zhengfengyang Dreamweaver (all versions) 5 March 21st, 2006 03:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.