Results 1 to 12 of 12

Thread: Win95 Issues with connecting to SQL Server

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    39

    SQL problems with Win95

    I'm developing an ActiveX application to be run in a browser. When it loads, the app. connects to an SQL Server. The code works when the application is viewed in IE5.0 under Win98/NT, however, when I try to connect in Win95, I get error 80004005 (DSN not found or specified driver does not exist). Here is my code:

    ----------------------------------
    Option Explicit
    Private cntn As ADODB.Connection
    Private Const DB_uid = "LDT_User"
    Private Const DB_pwd = "LDT_User"
    Private Const DB_driver = "SQL Server"

    Public Function create(dbname As String, server As String) As Boolean
    On Error GoTo Errhandler
    Set cntn = New ADODB.Connection
    cntn.ConnectionString = "uid=" & DB_uid & ";pwd=" & DB_pwd & ";server=" & server & ";driver=" & DB_driver & ";database=" & dbname
    cntn.ConnectionTimeout = 30
    cntn.open
    cntn.BeginTrans
    create = True
    Exit Function
    Errhandler:
    create = False
    End Function
    -----------------------------------

    Any idea what is going wrong?

    Thanks in advance for your response,

    Nahid Harjee

    *NOTE: I realized that Win95 doesn't provide the SQL Server drivers, so I installed MDAC 2.1. Now the error message is no longer DSN not found...., it is: SQL Server not found.

    [Edited by harjeen on 06-22-2000 at 06:19 PM]

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    The driver needs to be wrapped in braces; ie;

    Private Const DB_driver = "{SQL Server}"

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    39
    Hmmm... that doesn't seem to work. I don't think it's a problem with the driver name specification, because the application works in Windows 98/NT.

    I did a little more investigation of this problem, and there seems to be a difference in how 98/NT connect to the SQL server compared to how 95 does it. That is, in 98/NT, I can specify the SQL server by it's IP address, and it connects fine. However, when I attempt the same procedure in 95, I get the error:

    [Microsoft][ODBC SQL Server Driver][Named Pipes]Specified SQL Server not found.

    Yet, in 95, when I use the computer name instead of IP address, it DOES connect. This solution is not satisfactory for me though, because people will be connecting, via my app, from around the world to my SQL Server. They obviously will not be able to put in the server name, they have to use IP.

    I'm quite confused about what the difference could be. Any ideas?

    Nahid

  4. #4
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    Hmm, I have an application that uses ADO (now, I've just converted it from ODBC) that works fine under 98/NT [using a server name, not address. That runs counter to your experiences], I'll try it using 95 on Monday

    Until then, are all your machines running the same version of MDAC?

    What version of SQL server are you running, as well?

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    39
    Yep, all my machines are running the latest and "greatest" version of MDAC. My SQL Server is ver 7.0.

    Thanks for all the help JHausmann. You're definitely the Database Master.

  6. #6
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    did you install DCOM 98 on your Win95 clients?

  7. #7

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    39

    DCOM/MDAC

    Clunietp,

    Isn't DCOM98 just for Win98 machines? My Win95 clients all have DCOM95 and MDAC 2.5.

  8. #8
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    You can install DCOM98 on Win95, I just did. MY application, however, doesn't work at all in Win95. I'm getting "No Such Interface Supported"...

  9. #9
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    you are right Harjeen, my bad!

    sorry

  10. #10
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    why don't you just use a native OLEDB connection string?

    "Provider=SQLOLEDB;Data Source=MyServer;UID=User;PWD=Password;Initial Catalog=Database"

  11. #11

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    39

    Talking PROBLEM SOLVED!

    You were almost there clunietp!

    I changed my connection string to:

    cntn.ConnectionString = "Provider=SQLOLEDB;Network Library=dbmssocn;uid=" & DB_uid & ";pwd=" & DB_pwd & ";server=" & server & ";database=" & dbname

    and everything worked. The Network Library parameter specifies that the connection should be made via TCP/IP (dbmssocn is the TCP/IP library).

    Thanks for everyone's help!

    Nahid

  12. #12
    New Member
    Join Date
    Dec 2000
    Posts
    11
    Ok, I hate to open an old post, but I'm having a problem using harjeen's solution. I am using VB 6.0 connecting to SQL Server 6.5 and trying to connect to the database server with remote computers over the internet using tcp/ip.

    My connection string looks like this:
    cntn.ConnectionString = "Provider=SQLOLEDB;Network Library=dbmssocn;uid=" & DB_uid & ";pwd=" & DB_pwd & ";server=" & server & ";database=" & dbname
    cntn.Open

    But when it tries to connect, I get a "General network error. Please see your network documentation". Anybody know why I would get this? Is sql server not configured properly?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width