Click to See Complete Forum and Search --> : mySQL database access


CrazyGaz
06-12-2003, 04:07 PM
I have this code

<%
Dim CS
Dim RS
Set CN=Server.CreateObject("ADODB.Connection")
CN.Open "Provider=SQLOLEDB.1;uid=gaz;password=cool;Initial Catalog=asp_forum"
Set RS = CN.Execute ("Select user_name, password FROM login_details")
%>

<html>
<% while not RS.EOF and not RS.BOF %>
<%=RS("user_name")%>
<%RS.movenext
wend %>
</html>

and when I run it I get this error

Apache Active Scripting Runtime Error
[DBMSSOCN]General network error. Check your network documentation.

Line #5, Char #1

my question is what am I doing wrong? the database and table exist as do the fields in the table.

I am using OpenSA's version of Apache which is configured for ASP.

help!

cheers, Gaz

cmelnick
06-12-2003, 04:51 PM
I am not exactly sure because I am unfamiliar with Asp and Apache (I have used Perl/Apache/MySQL), but I think you are missing a data source from your connection string. You might want to check out this page (http://www.aspfree.com/authors/michaelw/alternativetomsiis.asp), about 2/3 of the way down are some example connection strings. Your current connection doesn't know what database you are trying to load.

Correct me if I am wrong someone!

CrazyGaz
06-12-2003, 05:00 PM
I got it working by installing some MODC driver and then connecting in a different way.

But thanks anyway.