ODBC access through ASP .NET page

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

  1. #1

    Default ODBC access through ASP .NET page


    I have an application where I'm using ODBC connection to query a
    database via C#.

    I'm sure my connection string and dsn information are correct because
    the application works fine when
    1) I run it from Visual Studio
    2) I create a C# console application and give the .exe full trust using
    the .NET configuration wizard.

    If I create an ASP .NET web application using C# and the exact same
    connection code I get the following error:


    ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not
    found and no default driver specified
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: Microsoft.Data.Odbc.OdbcException: ERROR [IM002]
    [Microsoft][ODBC Driver Manager] Data source name not found and no
    default driver specified

    Source Error:

    An unhandled exception was generated during the execution of the current
    web request. Information regarding the origin and location of the
    exception can be identified using the exception stack trace below.

    Stack Trace:


    [OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data
    source name not found and no default driver specified]
    Microsoft.Data.Odbc.OdbcConnection.Open() +646
    Overdue_Items.WebForm1.btnRunOverdueItemsReport_Cl ick(Object sender,
    EventArgs e) in c:\inetpub\wwwroot\overdue_items\webform1.aspx.cs: 101
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

    System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.Rai
    sePostBackEvent(String eventArgument) +57
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
    sourceControl, String eventArgument) +18
    System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
    +33
    System.Web.UI.Page.ProcessRequestMain() +1277



    I'm assuming that it's a security issue since the console application
    works fine but I can't figure out where I have to make the appropriate
    security changes for the ASP .NET page to run.

    I'm running on Windows Server 2003 with IIS 6.0.

    Any advice?

    Thanks,

    Michael



    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Michael S Guest

  2. Similar Questions and Discussions

    1. DBI and DBD::ODBC and MS Access
      Using Perl and DBI:ODBC with an MS Access database on Windows XP running IIS (Just a getting started guide) Creating the access database: a.....
    2. ODBC access from aix to a informix db V7.12
      Hello! is there anybody who works with a odbc-connection from a aiy maschine to a informix db? because we plan to initiate a...
    3. [PHP] ODBC for MS Access
      I use Linux box + PHP installed on it and want to connect/access MS Access database installed on Windows box. Below are my Questions: 1 What...
    4. ODBC for MS Access
      Dear All, I use Linux box + PHP installed on it and want to connect/access MS Access database installed on Windows box. Below are my Questions:...
    5. IIS 5.1 and anonymouse access (php & odbc)
      Can anyone explain the pros and cons of running IIS 5.1 with Anonymous access turned off ? I am writing a php script which connects to an Access...
  3. #2

    Default Re: ODBC access through ASP .NET page

    Michael S wrote:
    > I have an application where I'm using ODBC connection to query a
    > database via C#.
    This is a classic asp newsgroup. While you may be lucky enough to find a
    dotnet-savvy person here who can answer your question, you can eliminate the
    luck factor by posting your question to an appropriate group. I suggest
    microsoft.public.dotnet.framework.adonet.

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows [MVP] 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