Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional 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 December 1st, 2005, 01:25 PM
Authorized User
 
Join Date: Nov 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default another database connection question! asp and mysq

Hi all,

I'm trying to remotely access a mysql database and I am experiencing a few problems

Code:
<% 
Dim sConnection, objConn , objRS 

'sConnection = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=newsxml; OPTION=3" 


    sConnection = "Driver={MySQL ODBC 3.51 Driver};" & _ 
        "Server=<82.195.128.88>;" & _ 
        "Database=<johnfog_xml>;" & _ 
        "Uid=<johnfog_xml>;" & _ 
        "Pwd=<wordword>;" 


Set objConn = Server.CreateObject("ADODB.Connection") 

objConn.Open(sConnection) 

Set objRS = objConn.Execute("SELECT Heading, Contents FROM DeHavillandNews")


While Not objRS.EOF
Response.Write objRS.Fields("Heading") & ", " & objRS.Fields("Contents") & "<br>"
'Response.Write & " "
objRS.MoveNext
Wend 

objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
and here is the error message:

Quote:
quote:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[MySQL][ODBC 3.51 Driver]Unknown MySQL server host '<82.195.128.88>' (11001)
/mysql/index2.asp, line 22
Is there anything obvious thats wrong here?
I'm fairly new to this so any help would be really appreciated.

Thanks all

 
Old December 1st, 2005, 02:19 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

You need to lose the angled brackets from around the values in your connection string e.g 82.195.128.88 instead of <82.195.128.88>

HTH,

Chris

 
Old December 2nd, 2005, 08:20 AM
Authorized User
 
Join Date: Nov 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

haha! Thanks for that Chris - that worked. :)






Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP Database Connection shaikot Classic ASP Databases 1 June 12th, 2006 07:47 PM
Database Connection Problem with ASP.NET fukai100 Classic ASP Databases 2 August 13th, 2004 12:12 PM
Database Connection Problem with ASP.NET fukai100 SQL Server ASP 1 August 12th, 2004 07:37 PM
connection to Database. ASP, Dreamweaver, Access CrazyCanuck Classic ASP Basics 2 July 4th, 2004 09:12 PM





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