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 April 21st, 2005, 01:13 PM
Authorized User
 
Join Date: Mar 2005
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default DW2004 error from DB

Here's the error I'm getting now--
Quote:
quote:
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: "SELECT * FROM [DataBa"]'
/folderName/FileName.asp, line 9
I've tried to rename the DataBaseName so it's one word, and it is. The error message truncates the "DataBaseName".

Is it too long? Shouldn't be. But I'll try to rename and reduce the length.

d.t.

 
Old April 21st, 2005, 01:23 PM
Authorized User
 
Join Date: Mar 2005
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To no avail! I've renamed the file to 4 letters and it still reads "type mismatch: '[string: "SELECT * FROM[Name"]'

I take it the boldened from the above message is the error message itself...the rest is from the code.

help!

 
Old April 21st, 2005, 02:09 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Can you post the surrounding / offending code?

Imar
 
Old April 21st, 2005, 06:49 PM
Authorized User
 
Join Date: Mar 2005
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

whew...

the "problem" has been through various evolutions...
Here's the latest:

the error now reads, "Microsoft VBScript compilation error '800a0401' expected end of statement

/filename/site.asp, line 16

rsData.Source = "SELECT Field1, Field2, Field3, Field4, etc. FROM FileName WHERE Category = " + Replace(rsData_MMColParam, "'","''") [u]+ " AND FilteredField = "FilteredData""</u>

(the underlined part is my own, which might be the problem...I need another book, I guess, on SQL commands)

Here is the coding in question:

<%@LANGUAGE="VBSCRIPT"%>

<%
Dim rsData__MMColParam
rsData__MMColParam = "1"
If (Request.QueryString("1stCategory") <> "") Then
  rsData__MMColParam = Request.QueryString("1stCategory")
End If
%>
<%
Dim rsData
Dim rsData_numRows

Set rsData = Server.CreateObject("ADODB.Recordset")
rsData.ActiveConnection = MM_connFileName_STRING
rsData.Source = "SELECT Data, Field1, Field2, Field3, Field4, Field5 FROM Table WHERE Category = " + Replace(rsData__MMColParam, "'", "''") + " AND FilteredData = "FilteredData""
rsData.CursorType = 0
rsData.CursorLocation = 2
rsData.LockType = 1
rsData.Open()

rsData_numRows = 0
%>

thanks man.


 
Old April 22nd, 2005, 01:03 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Try this:

rsData.Source = "SELECT Data, Field1, Field2, Field3, Field4, Field5 FROM Table WHERE Category = " + Replace(rsData__MMColParam, "'", "''") + " AND FilteredData = "FilteredData""

Response.Write("SQl is " & rsData.Source)
Response.End

rsData.CursorType = 0
rsData.CursorLocation = 2
rsData.LockType = 1
rsData.Open()


This writes out the Sql statement and stops the page response.

Also look at this:

" AND FilteredData = "FilteredData""

Is the word present in the table FilteredData? Or do you mean this:

" AND FilteredData = ' & FilteredData & "'"

to add the value of the variable FilteredData to your query?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old April 22nd, 2005, 10:47 AM
Authorized User
 
Join Date: Mar 2005
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar,
FilteredData is the name of the file, which, when I replaced the double quotes with single quotes, it runs!

where should i go for protocols, commands, etc. to get references for things like this?

(DW2004 has limited help on creating SQL queries, 4 pages)...

 
Old April 22nd, 2005, 10:56 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

What do you mean with "the name of the file"? Are you querying against a text file? Or is it the name of a file stored in a column in the database?

There are many SQL tutorials available on the web. The books associated with this form (Beginning Dreamweaver MX/MX 2004) introduce you to SQL as well.

Cheers,

Imar
 
Old July 21st, 2005, 05:18 AM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to birajghosh
Default

I defined a function of type RECORDSET in a COM object. Then from my asp page i am calling this function and setting it to a local recorset variable, which gives error...why? While same operation is working well from VB. Error is Type mismatch Error no 0x800A000D

 
Old July 21st, 2005, 06:16 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

How is this related to Dreamweaver MX in general and the books Beginning Dreamweaver MX specifically??

I think you're better off posting this in one of the ASP or VB forums...

Cheers,

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
restore DB error RinoDM SQL Server 2000 6 October 6th, 2006 04:18 PM
Restore from DB error... RinoDM SQL Language 0 October 6th, 2006 10:18 AM
SWF elements in DW2004 not working in FF snejsnej Dreamweaver (all versions) 4 February 17th, 2006 03:28 PM
Form to db Error on " ' " merchafil Classic ASP Databases 1 December 5th, 2005 07:34 AM
Insert into db error keyvanjan Classic ASP Databases 1 December 5th, 2005 07:30 AM





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