Skip to main content
Participating Frequently
December 16, 2009
Question

Unable to use builtin functions to select records from MySQL Server (ASP)

  • December 16, 2009
  • 3 replies
  • 710 views

I am currently using Dreamweaver CS4, and am trying to use the built in functions to create record sets to my MySQL database. I have a full web application built but I have had to build it manually.

I want to use some of the built in features of dw to save time. However this is the error I recieve:

Provider error '80040e3d'
Type is invalid.
/NotifySys/login.asp, line 29

Line 29 is the sql execute command created by dw. I can't seem to find anything online that points to a dw bug. Any Thoughts?

When I make all the sql statements myself, everything works fine, and all of the 'test' functions when creating these record sets and insert commands show that all is well!

I have built a test page as to narrow down the problem. One of the issues that I have narrowed down is I have a form with One text feild for 'ID', and one record in the table it is accessing with ID and FirstName populated. On form submit it goes to the test2.asp page, created a record set using the Request.Form('ID') method. This was created fully using the dw gui features. NOW, if I modify the recordset properties to add a AND FirstName = paraFirstName (*variable created using gui and uses the Request.Form("FirstName") Method*) and of coarse add that field to the form, I get the above error.

I have searched and searched to no avail! This is the contents of the MySQL querylog, you can see the first successful query, and then the absense of the query statement after the changes.

3 Query       SELECT database()

     3 Query       SELECT database()

      3 Query       SELECT * FROM contacts WHERE ID = 34 AND FirstName = 'Adam'

091216  1:13:40       3 Quit     

091216  1:15:22       4 Connect     root@localhost on NotifySys

      4 Query       SET NAMES utf8

      4 Query       SELECT database()

      4 Query       SELECT database()

My table is using the default charset latin1, I thought maybe thats the problem?

Again, I am not trying to 'FIX' this form, I am trying to find out why this error occurs when using ANY of the builtin database featuers in DW. This is a method to isolate the problem.

OH, i am programming in ASP VB, on an IIS 6 server w/MySQL server v5 using a system dsn on the 'testing' server.

ANY, ANY, ANY help would be awesome!

[Subject line edited my moderator to indicate server-side technology used]

This topic has been closed for replies.

3 replies

Participating Frequently
December 16, 2009

WHHOOOOOOO!!!!!

Yes, its a bug in MySQL/ODBC connector v5 - See: http://bugs.mysql.com/bug.php?id=26985

Moved to v5.1.16

WORKS!!

Hopefully someone else will be able to find the solution easier now.  Thanks for all your help!

Participating Frequently
December 16, 2009

Cool.

Participating Frequently
December 16, 2009

My guess is that you are sending the wrong datatype in the command object parameter.

Compare the parameter objects's datatype with the actual data you are populating it with. Or, paste the recordset code to the forum.

This is probably a result of using a server behavior for one database and then trying to apply it to MySQL. You do understand that the combination of ASP/MySQL is not supported in DW server behaviors, right?

Participating Frequently
December 16, 2009

NO, I had no idea its not supported?! I have used it for years.....

No, the data type is definetly correct.

The Table is set to use latin1......But it has no other options (at least in the db admin tool i am using).

So, Can I change dreamweaver to use latin1 (I dont need utf8)? Why is it trying to change the charset?


*I think we are getting closer!*

Participating Frequently
December 16, 2009

>NO, I had no idea its not supported?! I have used it for years.....

OK, I may be mistaken then. I didn't think those were supported combination but I could be wrong.

>No, the data type is definetly correct.

The parameter object type for the string is set to 200 (AdVarChar)?  I have seen that error when the parameter types are set incorrectly.

Participating Frequently
December 16, 2009

Ok, this is a little redundant, but I am copying it from another forum I posted on as well:

Ok, this may be helpful. The query logs show that it is trying to set the char to utf8, but when creating a new table, I do not have an option of creating it with that character set. Is it possible that my MySQL server does not have the charset available? Below is an exerpt from the querylog. Query 3 is the hardcoded method, query 4 is using the dw gui to do the same thing. What do you think?

3 Query       SELECT database()
     3 Query       SELECT database()
     3 Query       SELECT * FROM contacts WHERE ID = 34 AND FirstName = 'Adam'
091216  1:13:40            3 Quit      
091216  1:15:22            4 Connect     root@localhost on NotifySys
     4 Query       SET NAMES utf8
     4 Query       SELECT database()
     4 Query       SELECT database()

Participating Frequently
December 16, 2009

Typing this command gives me the following result. It shows that utf8 is supported? But this has got to be where the problem lies:  SHOW CHARACTER SET;

big5 Big5 Traditional Chinese big5_chinese_ci 2

dec8 DEC West European dec8_swedish_ci 1

cp850 DOS West European cp850_general_ci 1

hp8 HP West European hp8_english_ci 1

koi8r KOI8-R Relcom Russian koi8r_general_ci 1

latin1 cp1252 West European latin1_swedish_ci 1

latin2 ISO 8859-2 Central European latin2_general_ci 1

swe7 7bit Swedish swe7_swedish_ci 1

ascii US ASCII ascii_general_ci 1

ujis EUC-JP Japanese ujis_japanese_ci 3

sjis Shift-JIS Japanese sjis_japanese_ci 2

hebrew ISO 8859-8 Hebrew hebrew_general_ci 1

tis620 TIS620 Thai tis620_thai_ci 1

euckr EUC-KR Korean euckr_korean_ci 2

koi8u KOI8-U Ukrainian koi8u_general_ci 1

gb2312 GB2312 Simplified Chinese gb2312_chinese_ci 2

greek ISO 8859-7 Greek greek_general_ci 1

cp1250 Windows Central European cp1250_general_ci 1

gbk GBK Simplified Chinese gbk_chinese_ci 2

latin5 ISO 8859-9 Turkish latin5_turkish_ci 1

armscii8 ARMSCII-8 Armenian armscii8_general_ci 1

utf8 UTF-8 Unicode utf8_general_ci 3

ucs2 UCS-2 Unicode ucs2_general_ci 2

cp866 DOS Russian cp866_general_ci 1

keybcs2 DOS Kamenicky Czech-Slovak keybcs2_general_ci 1

macce Mac Central European macce_general_ci 1

macroman Mac West European macroman_general_ci 1

cp852 DOS Central European cp852_general_ci 1

latin7 ISO 8859-13 Baltic latin7_general_ci 1

cp1251 Windows Cyrillic cp1251_general_ci 1

cp1256 Windows Arabic cp1256_general_ci 1

cp1257 Windows Baltic cp1257_general_ci 1

binary Binary pseudo charset binary 1

geostd8 GEOSTD8 Georgian geostd8_general_ci 1

cp932 SJIS for Windows Japanese cp932_japanese_ci 2

eucjpms UJIS for Windows Japanese eucjpms_japanese_ci 3