[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

odbc.net using mysql and vb.net

simon fuller

6/11/2002 10:55:00 PM

Hi,

I am pulling my hair out with this one!

As a novice I found a samplepage.aspx, I converted it to
use odbc.net (since
the database is mysql). I receive the following message.
I would appreciate
some help as I havent got a clue what I am doing wrong!
Thanks in advance!

[OdbcException: ERROR [S1000] [TCX][MyODBC]Access denied
for user:
'ODBC@localhost' (Using password: NO)
ERROR [01000] [Microsoft][ODBC Driver Manager] The driver
doesn't support
the version of ODBC behavior that the application
requested (see
SQLSetEnvAttr).]
Microsoft.Data.Odbc.OdbcConnection.Open() +646
ASP.search3_aspx.ShowAuthors(Object Sender, EventArgs
E) in
D:\webspace\admin\website\website.co.uk\www\search3.aspx:2
9
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
+108

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEv
entHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent
(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent
(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263

Here's my source code:

<%@ Import namespace = "System.Data"%>
<%@ Import namespace = "Microsoft.Data.Odbc"%>
<%@ Assembly Name = "Microsoft.Data.Odbc" %>


<script language="VB" runat="server">

Sub Page_Load(Sender As Object, E As EventArgs)

If Not Page.IsPostBack Then
state.Items.Add("CA")
state.Items.Add("IN")
state.Items.Add("KS")
state.Items.Add("MD")
state.Items.Add("MI")
state.Items.Add("OR")
state.Items.Add("TN")
state.Items.Add("UT")
End If
End Sub

Sub ShowAuthors(Sender As Object, E As EventArgs)

Public Sub CreateMyOdbcDataReader(mySelectQuery As
String, _

Dim con As New OdbcConnection("driver={MySQL}; " & _
"databaseÚtabasename;SERVER=localho
st; UID=myuserid;
PWD=mypassword")
Dim cmd As OdbcCommand
Dim qry As String

con.Open()
qry = "select * from authors where state='" & _
state.SelectedItem.Text & "'"
cmd = New OdbcCommand(qry, con)

DataGrid1.DataSource = cmd.ExecuteReader()
DataGrid1.DataBind()

con.Close()

End Sub

</script>

<form runat="server">

State: <asp:DropDownList id="state" runat="server" />

<asp:Button Text="Show Authors" OnClick="ShowAuthors"
runat="server"/>
<p/>
<asp:DataGrid id="DataGrid1" runat="server"/>

</form>




1 Answer

(Nam Kang)

6/12/2002 10:53:00 PM

0

Simon,

You may want to download a tool called filemon to help you troubleshoot
permission error. You can get it from www.sysinternals.com. Search for
access denied and make sure the aspnet account has permissions if you are
running under the machine account.

Hope that helps,
Nam

This posting is provided "AS IS" with no warranties, and confers no rights.