INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

asp connection to asphostportal.com mysql database

asp connection to asphostportal.com mysql database

(OP)
Hello...

I'm trying to connect via asp to a asphostportal.com mysql database on their server. I've created the database and added a users table. I have an opensource intranet (UAPortal) that is really plug&play, it comes with an Access database attached, so you just load it on your server and go. But I want to use it with the faster, more capable mysql server that comes with asphostportal hosting. I have the connection strings given by asphostportal, but when I try to incorporate that info into the common.asp file, I get this:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'localhost' (10061)

/Common.asp, line 34

Please tell me what I'm doing wrong. I'm self-taught, so type slowly!

All advice is appreciated!

RE: asp connection to asphostportal.com mysql database

localhost?
can you post the connection string?

Borislav Borissov
VFP9 SP2, SQL Server

RE: asp connection to asphostportal.com mysql database

(OP)
I use this but error

CODE -->

<%
Dim oConn, oRs
Dim qry, connectstr
Dim db_name, db_username, db_userpassword

db_server = "mysql.secureserver.net"
db_name = "your_dbusername"
db_username = "your_dbusername"
db_userpassword = "your_dbpassword"
fieldname = "your_field"
tablename = "your_table"

connectstr = "Driver={MySQL ODBC 3.51 Driver};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open connectstr

qry = "SELECT * FROM " & tablename

Set oRS = oConn.Execute(qry)

if not oRS.EOF then
while not oRS.EOF
response.write ucase(fieldname) & ": " & oRs.Fields(fieldname) & "
"
oRS.movenext
wend
oRS.close
end if

Set oRs = nothing
Set oConn = nothing

%> 

RE: asp connection to asphostportal.com mysql database

Is that

CODE

db_server = "mysql.secureserver.net" 
actual value?
because I didn't see any "localhost" string in your connection string.

Borislav Borissov
VFP9 SP2, SQL Server

RE: asp connection to asphostportal.com mysql database

(OP)
ahaaaa I think I need replaced

CODE

db_server = mysql.secureserver.net 
with my database hostname from the Hosting Control Panel. bigsmile

RE: asp connection to asphostportal.com mysql database

smile
Yes.
You need to replace these also:

db_name = "your_dbusername"
db_username = "your_dbusername"
db_userpassword = "your_dbpassword"

Borislav Borissov
VFP9 SP2, SQL Server

RE: asp connection to asphostportal.com mysql database

(OP)
yes... I'll replace it. thank bro bigglasses

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close