Professional Web Applications Themes

oleDBConnection not recognizing Database - ASP.NET General

Hi, I'm using oleDBConnection to connect to SQL server. I keep getting "SQL Server does not exist" on Open event. The code I'm using is the following Dim objConn As New OleDbConnection("Provider=SQLOLEDB;Data Source=sqlserver;Database=db;User Id=user;Password=user;") Can anyone help? Roger -- Axiom Software, Ltd. 400 Columbus Ave Valhalla, NY 10595 (914) 769-8800...

  1. #1

    Default oleDBConnection not recognizing Database

    Hi,
    I'm using oleDBConnection to connect to SQL server. I keep getting "SQL
    Server does not exist" on Open event.
    The code I'm using is the following
    Dim objConn As New OleDbConnection("Provider=SQLOLEDB;Data
    Source=sqlserver;Database=db;User Id=user;Password=user;")


    Can anyone help?

    Roger

    --
    Axiom Software, Ltd.
    400 Columbus Ave
    Valhalla, NY 10595
    (914) 769-8800


    Roger Guest

  2. #2

    Default Re: oleDBConnection not recognizing Database

    My Data Source is a machine name. SQL server uses SQL Server and Windows
    authentication.




    "Kevin Spencer" <com> wrote in message
    news:phx.gbl... 
    be 
    machine 
    >
    >[/ref]


    Roger Guest

  3. #3

    Default Re: oleDBConnection not recognizing Database

    Try substituting "Initial Catalog" for "Database" in your Connection String.
    Example:

    "Provider=sqloledb;Data Source=MachineName;Initial Catalog=Databasename;User
    Id=UserName;Password=UserPassword;"

    If that doesn't work, one of a couple of things could be wrong:

    1. The machine name is not recognized across the network. Try using an IP
    address instead. And make sure that the SQL Server is using TCP/IP
    2. Your User Name and/or Password are incorrectly typed
    3. Your UserName account doesn't have permission to access the database

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    The more I learn, the less I know.

    "Roger Cantillo" <com> wrote in message
    news:phx.gbl... 
    > be 
    > machine [/ref][/ref]
    "SQL 
    > >
    > >[/ref]
    >
    >[/ref]


    Kevin Guest

Similar Threads

  1. #39834 [NEW]: PHP not recognizing php.ini changes
    By nicole at antfarminteractive dot com in forum PHP Bugs
    Replies: 2
    Last Post: December 17th, 02:11 PM
  2. Security exception while opening an OleDBConnection
    By CyberLotus in forum ASP.NET Security
    Replies: 3
    Last Post: February 11th, 12:17 PM
  3. not recognizing swft
    By AWD in forum Macromedia Flash Sitedesign
    Replies: 2
    Last Post: October 17th, 04:18 AM
  4. ASP.NET and OleDbConnection
    By vMike in forum ASP.NET General
    Replies: 2
    Last Post: June 24th, 04:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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