PDA

View Full Version : Problem connecting to database


Pete
07-24-2004, 03:28 AM
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 .....

bruce
07-25-2004, 11:28 AM
Please create a support ticket.

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

[b]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">

pbissegger
10-13-2004, 09:33 AM
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 !