Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp connection to asphostportal.com mysql database 1

Status
Not open for further replies.

shameer21

Technical User
May 11, 2015
4
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!
 
localhost?
can you post the connection string?

Borislav Borissov
VFP9 SP2, SQL Server
 
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

%>
 
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
 
ahaaaa I think I need replaced
Code:
db_server = mysql.secureserver.net
with my database hostname from the Hosting Control Panel. [bigsmile]
 
:)
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top