Forums

ASP

This topic is locked

Connecting to a remote server using MySQL

Posted 06 Nov 2001 12:03:07
1
has voted
06 Nov 2001 12:03:07 Sally Pugh posted:
Hello to you all <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> I'm a total newbie to all this asp lark! What fun eh? LOL

I would be really greatful if someone could help me out here please? I have tried honest!

Using Ultradev, I've created a search page and a results page and uploaded both to our service provider. I've also created a database in Access 97 and successfully uploaded that to our service provider using MySQL. When I check the connection within the results page in Ultradev I'm told that the 'connection was made successfully' yet when I run the query 'live' then I'm told 'ADODB.Recordset.1 error '800a0e7d' Invalid connection'. It seems to always get stuck at the 'rssubjectguides.Open' bit!

Here's the relevent (I presume <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle> code:

&lt;%@LANGUAGE="VBSCRIPT"%&gt; &lt;%

Dim rssubjectguides__varsubject
rssubjectguides__varsubject = "%"
if(Request("subject" &lt;&gt; "" then rssubjectguides__varsubject = Request("subject"

Dim rssubjectguides__varcampus
rssubjectguides__varcampus = "%"
if(Request("campus" &lt;&gt; "" then rssubjectguides__varcampus = Request("campus"

%&gt; &lt;%
set rssubjectguides = Server.CreateObject("ADODB.Recordset"
rssubjectguides.ActiveConnection = "dsn=subjectguides;"
rssubjectguides.Source = "SELECT * FROM subjectguidestbl1 WHERE subject LIKE '" + Replace(rssubjectguides__varsubject, "'", "''" + "' AND campus LIKE '" + Replace(rssubjectguides__varcampus, "'", "''" + "'"
rssubjectguides.CursorType = 0
rssubjectguides.CursorLocation = 2
rssubjectguides.LockType = 3
rssubjectguides.Open
rssubjectguides_numRows = 0
%&gt;

Thanks in anticipation!


Reply to this topic