Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
|
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL 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 September 16th, 2005, 12:50 PM
Registered User
 
Join Date: Sep 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default cant connect to DB using ASP and ADO

I am trying to connect to mysql db through asp with code that is to upload a file from a computer. I get this error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

ODBC driver does not support the requested properties.

/uploadexmple.asp, line 44

I am using code from http://www.asp101.com/articles/jacob/scriptupload.asp . An asp file upload program written by jacob Gilley. Heres where mine goes wrong:

ElseIf Uploader.Form("saveto") = "database" Then

            ' Open the table you are saving the file to
            dim rs
            Set RS = Server.CreateObject("ADODB.Recordset")
            RS.open "lecnotes", "Driver={Mysql}; Server=mysql1.webhost.ie; Database=paulmc; UID=paul; PWD=1981 ",2,2
            RS.AddNew ' create a new record

            RS("filename") = file.filename ##[b]THE ERROR OCCURS HERE LINE44
            RS("filesize")= File.FileSize
            RS("contenttype") = File.ContentType

            ' Save the file to the database
            File.SaveToDatabase RS("filedata")

            ' Commit the changes and close
            RS.Update
            RS.Close
        End If

lecnotes is the name of the table where i'll store the file and it has properties:



     Field Type Attributes Null Default Extra Action
filename varchar(20)
filesize varchar(20)
contenttype varchar(40)
filedata blob BINARY

any help appreciated...
 
Old October 27th, 2005, 11:49 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post
Default

Try downloading first MyODBC driver from MySQL website, then
create a DSN through from that driver. It works for me, when I access MySQL database through ASP scripts. Hope this helps.
JOHN

 
Old February 6th, 2006, 07:09 AM
Registered User
 
Join Date: Feb 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to g.tamilselvan
Default

hai,

pls try to download the following file from www.mysql.com "mysql-connector-odbc-3.51.12-win32" if download completed then install it. finally u create a DSN for ur database and u can try to connect the mysql db with the asp and vb.

pls try this.

all the best





Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect to DB hernann C# 2005 2 July 31st, 2006 05:06 PM
how to connect ado is asp angelo_cruz ADO.NET 1 November 24th, 2005 01:02 PM
Connect to SQL Server using NT Authentication (ADO donnie200 Access VBA 5 July 15th, 2005 06:33 AM
ADO connect string for FoxPro db file lcsgeek Classic ASP Databases 1 September 12th, 2003 04:53 AM
How to connect .dbf file with ADO & DAO with code cbpanchal VB How-To 4 July 28th, 2003 10:14 PM





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