iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > Classic ASP

Reply
 
LinkBack Thread Tools
Old December 1st, 2005, 01:24 PM   #1
New Member
 

Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 fogofogo is on a distinguished road
another database connection question! asp and mysql

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:

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
fogofogo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 1st, 2005, 01:49 PM   #2
Rob
Elite Veteran
SuperMember
 
Rob's Avatar
 

Join Date: Jul 2003
Location: Southern UK
Age: 35
Posts: 3,133
Blog Entries: 7
Thanks: 28
Thanked 22 Times in 19 Posts
Rep Altering Power: 0 Rob is a jewel in the rough Rob is a jewel in the rough Rob is a jewel in the rough
Re: another database connection question! asp and mysql

One fairly obvious thing wrong is that you are using localhost..... localhost is NOT remote... I suspect you need your remote server name in there instead.
__________________
Rob - Webforumz Founder

Latest Project: Sanctuary for Student Midwives
Rob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 1st, 2005, 03:05 PM   #3
New Member
 

Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 fogofogo is on a distinguished road
Re: another database connection question! asp and mysql

That line is actually commented out.

I found the error though - it was the <> brackets.

Thanks
fogofogo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 1st, 2005, 03:10 PM   #4
Rob
Elite Veteran
SuperMember
 
Rob's Avatar
 

Join Date: Jul 2003
Location: Southern UK
Age: 35
Posts: 3,133
Blog Entries: 7
Thanks: 28
Thanked 22 Times in 19 Posts
Rep Altering Power: 0 Rob is a jewel in the rough Rob is a jewel in the rough Rob is a jewel in the rough
Re: another database connection question! asp and mysql

Quote:
Originally Posted by fogofogo
That line is actually commented out.

I found the error though - it was the <> brackets.

Thanks
ROFL..... erm... yeah... I'm now pretty embarrased. I shoulda saw that straight-away.
__________________
Rob - Webforumz Founder

Latest Project: Sanctuary for Student Midwives
Rob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 2nd, 2005, 05:48 AM   #5
New Member
 

Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 fogofogo is on a distinguished road
Re: another database connection question! asp and mysql

ha! Ah - it was late in the evening mate. Long hard day etc etc.
fogofogo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
database , connection , question , asp , mysql


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Easiest way to open database connection! Monie Databases 4 November 1st, 2007 05:35 AM
Connection to access database thriftyspider Other Languages 1 August 7th, 2007 05:41 PM
PHP n MySQL connection uddin PHP 1 April 18th, 2007 03:41 AM
Database connection fogofogo Classic ASP 7 December 5th, 2005 11:25 AM
Database Connection Strings Smokie Classic ASP 0 August 7th, 2003 06:51 AM


Search Engine Optimization by vBSEO 3.2.0 RC8