conection string for a MySQL database

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default conection string for a MySQL database

    I'm trying to get asp to conect to a MySQL database, I've tried copying a
    few examples online that I found [there doesn't seem to be many!!] and I
    always get a 500 error with the code below. what am i doing wrong?
    any examples of a working connection string anyone could show me would be
    fantastic. thanks i advance.

    Wayne...

    <%@ LANGUAGE="VBSCRIPT" %>
    <%
    Set MyConn = Server.CreateObject("ADODB.Connection")
    MyConn.Open = "DSN=main;Uid=wayne;Pwd=******;"

    SQL_query = "SELECT * FROM content;"
    Set RS = MyConn.Execute(SQL_query)
    %>
    <HTML>
    <HEAD>
    <TITLE>test</TITLE>
    </HEAD>
    <BASEFONT FACE="arial">
    <BODY>

    <p><b><% Response.Write SQL_query %></b></p>

    <%while not RS.eof%>
    <%=RS("")%>&nbsp;<%=RS("title")%>&nbsp;<%=RS("date ")%>&nbsp;<%=RS("content")
    %><br>
    <%RS.MoveNext%>
    <%wend%>

    <%
    RS.Close
    MyConn.Close
    %>
    ===========
    the other version I tried:
    ===========
    <%@ LANGUAGE="VBSCRIPT" %>
    <%
    strConnection =
    "driver={MySQL};server=IP_NUMBER_GOES_HERE;uid=way ne;pwd=******;database=mai
    n;option=NUM"
    Set adoDataConn = Server.CreateObject("ADODB.Connection")
    adoDataConn.Open strConnection

    strQuery = "SELECT * FROM content;"
    Set RS = adoDataConn.Execute(strQuery)
    %>

    ==================
    HEEELLLPPPP!!!!!!!!!!!!!!!!!!!!!!!!!!


    Wayne... Guest

  2. Similar Questions and Discussions

    1. Coldfusion distributed IIS conection
      Hello, I need some help to understand what goes into the ISAPI conection from a IIS server and a ColdFusion one. The IIS machine: Windows 2003 and...
    2. MySQL Database not retrieving the full database
      Hi, I am using MySQL and PHP for my repository. It has 500+ records. till now it was displayiing all records in the database, but since from one...
    3. convert string to safe string before adding to database
      Hi I am updating a site for a client who is running CF5. The update and insert queries break when the user uses inverted commas ". I currently...
    4. LAN no conection
      I am trying to conect two pcs through the nic adaperts in WIN XP, can I run a cable directly to each adapter?
    5. slow conection
      I got this "internet booster" form a website. I used to get speeds of 1.8 mbps, aftre I installed I'm getting speeds of 600 kbps. I uninstalled the...
  3. #2

    Default Re: conection string for a MySQL database

    On Mon, 17 May 2004 00:17:48 +0100, "Wayne..."
    <wayne@secretwebdesign.com> wrote:
    >always get a 500 error with the code below. what am i doing wrong?
    Not posting the full error. See:

    Why do I get a 500 Internal Server error for all ASP errors?
    [url]http://www.aspfaq.com/show.asp?id=2109[/url]

    Also:

    [url]http://www.able-consulting.com/ADO_Conn.htm[/url]

    Jeff
    Jeff Cochran Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139