Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
April 17, 2014, 08:29:55 AM

Pages: [1]   Go Down
  Print  
Author Topic: asp interface with mysql failure  (Read 1960 times)
Aching
Newbie
*
Offline Offline

Posts: 1


« on: July 11, 2003, 09:16:12 PM »

Hi, could anyone help. We have been trying to test the database connection using asp to mysql but without success. The error message obtained is as follows:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable
to complete your request.


The scripts applied is as follows:
<%@ Language=VBScript %>
<%
dim con,rs
set con=server.CreateObject("ADODB.Connection")
set rs=server.CreateObject("ADODB.Recordset")
 
con.Provider = "MySQLProv"
con.Properties("Data Source") = "server=pegasus.lunarpages.com;DATABASE=databasename here;UID=useridhere;PWD=userpasswordhere"
con.Open
 
sql = "SELECT * from new_member_list"
 
rs.Open sql, con, 3, 1
Response.Write  rs.RecordCount
rs.Close
 

%>



If you have working test scripts to share, will be greatly appreciated!@! Idea
Logged

justintime
agabird
Trekkie
**
Offline Offline

Posts: 10


« Reply #1 on: July 13, 2003, 01:32:50 PM »

Not sure if the connection you make is ok.
But at least the response.write is wrong. should be:

Response.Write (rs.RecordCount)

I use another way to connect, here the script I tested and is working:

<%@ Language=VBScript %>
<%
dim con,rs
set con=server.CreateObject("ADODB.Connection")
set rs=server.CreateObject("ADODB.Recordset")

Con.Open "Driver={mySQL}; Server=localhost; Database=hereyourdatabase; uid=hereyouruserid; password=hereyourpass"

sql = "SELECT * from new_member_list"

rs.Open sql, con, 3, 1
Response.Write (rs.RecordCount)
rs.Close

%>

Hope it helps!
Logged
bycosm2
Newbie
*
Offline Offline

Posts: 2


WWW
« Reply #2 on: August 04, 2003, 09:01:22 AM »

Try this:

for your, "Driver" it should be {mySQL} and your server I don't think is pegasus.lunarpages.com but localhost.  You can pretty much cut and paste the code below.... just change the other things such as the database name, userid,.. et.



%>
dim con,rs

set con=server.CreateObject("ADODB.Connection")
set rs=server.CreateObject("ADODB.Recordset")

Con.Open "Driver={mySQL}; Server=localhost; Database=hereyourdatabase; uid=hereyouruserid; password=hereyourpass"


      sql = "select * from new_member_list"
      response.write sql
%>

Good Luck!
Logged
brians4
Newbie
*
Offline Offline

Posts: 3


« Reply #3 on: October 04, 2003, 10:25:39 AM »

I am a newbie so forgive me for this simple question.

If i want to simply test my connection to my Mysql database do I put one of your recommended connection scripts inside my all asp pages that need to access my database? If no, please tell me where this script needs to go. Thanks in advance.

Brian
Logged
TWebMan
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3052



WWW
« Reply #4 on: October 05, 2003, 04:27:40 AM »

Hello Brian,
  It would go in any page that is going to need a connection, or you can put the string in a common include.
Logged

"Computers cause people to make more mistakes than any other invention in history, with the possible exception of handguns and tequila."  - Unknown
"Liberty of any kind is seldom lost all at once." - D. Hume
Every day is an Ode to Joy
The planet will be fine... and so will your site
Pages: [1]   Go Up
  Print  
 
Jump to: