Problem connecting to database

Discussion in 'Databases' started by Pete, Jul 24, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have followed your database migration article (Q10180) and it worked perfectly. Using MySQLCC I can see all my database information on DiscountASP.NET. However, I am having problems accessing the data.

    I have followed your article : Q10085 - HOWTO: Query MySQL Database in ASP.net, in order to make my database connections. Very simple. However, whenever I run a page that tries to access my database, I get the following error:

    ERROR [42S02] [MySQL][ODBC 3.51 Driver][mysqld-4.0.18-standard-log]Table '[databasename].[tablename]' doesn't exist.

    where [databasename] is my database in the Discount ASP control panel and [tablename] is my table.

    However, I see them there using MySQLCC !!!

    Any ideas about what I am doing wrong ? Here's my code:

    <%@ Import Namespace="System.Data.Odbc" %>

    <html>

    <script runat="server">

    Dim MyConString As String = "DSN=[username]_mysqlConn"
    Dim MyConn As New OdbcConnection(MyConString)
    MySQL = "select Groupname, Leaguenum from Leagues where Grouptype = 'league'"
    Dim Cmd as New OdbcDataAdapter(MySQL , MyConn)
    Cmd.Fill(ds, "leagues")

    </script>

    where [username] is my username.

    [:(]

    Thanks .....
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Please create a support ticket.

    Need more sensitve information (username) and stuff to trouble shoot the problem.

    quote:Originally posted by Pete

    I have followed your database migration article (Q10180) and it worked perfectly. Using MySQLCC I can see all my database information on DiscountASP.NET. However, I am having problems accessing the data.

    I have followed your article : Q10085 - HOWTO: Query MySQL Database in ASP.net, in order to make my database connections. Very simple. However, whenever I run a page that tries to access my database, I get the following error:

    ERROR [42S02] [MySQL][ODBC 3.51 Driver][mysqld-4.0.18-standard-log]Table '[databasename].[tablename]' doesn't exist.

    where [databasename] is my database in the Discount ASP control panel and [tablename] is my table.

    However, I see them there using MySQLCC !!!

    Any ideas about what I am doing wrong ? Here's my code:

    <%@ Import Namespace="System.Data.Odbc" %>

    <html>

    <script runat="server">

    Dim MyConString As String = "DSN=[username]_mysqlConn"
    Dim MyConn As New OdbcConnection(MyConString)
    MySQL = "select Groupname, Leaguenum from Leagues where Grouptype = 'league'"
    Dim Cmd as New OdbcDataAdapter(MySQL , MyConn)
    Cmd.Fill(ds, "leagues")

    </script>

    where [username] is my username.

    [:(]

    Thanks .....

    </blockquote id="quote"></font id="quote">
     
  3. Found what the problem was.

    The tablenames in MySQL on DiscountASP are CASE specific. For instance, if the table name was "leagues" and you wrote "Leagues" in your code, you will get this error.

    So watch your CASES !
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page