Database Connection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mahesh123
    New Member
    • Oct 2007
    • 64

    Database Connection

    Hi,

    I am using the ADODB Connections for SQLServer2000. When I Connecting to the SQL Server I am getting an error

    "SQL Server Does not Exits or Acess Dennied"

    so please tell how can we solve this error.
  • jamesd0142
    Contributor
    • Sep 2007
    • 471

    #2
    My guess is your connection string, or file path have some error in it,.

    ensure the path to your database is correct.
    -------
    Are you using the app.path method? if yes then this can cause problems if you put you *.mdb file in the wrong location.
    ----------

    Comment

    • mahesh123
      New Member
      • Oct 2007
      • 64

      #3
      Originally posted by jamesd0142
      My guess is your connection string, or file path have some error in it,.

      ensure the path to your database is correct.
      -------
      Are you using the app.path method? if yes then this can cause problems if you put you *.mdb file in the wrong location.
      ----------

      I am Using the SQL Server. Sometimes it will connected to the SQL Server and some time it will not connected to the SQL Server.

      Comment

      • jrtox
        New Member
        • Sep 2007
        • 89

        #4
        Originally posted by mahesh123
        I am Using the SQL Server. Sometimes it will connected to the SQL Server and some time it will not connected to the SQL Server.
        Hello,

        Check your SQL Server if its Running everytime you used it.

        what you are using in establishing connection from your VB to your DB?

        Regards
        Ervin

        Comment

        • mahesh123
          New Member
          • Oct 2007
          • 64

          #5
          Originally posted by jrtox
          Hello,

          Check your SQL Server if its Running everytime you used it.

          what you are using in establishing connection from your VB to your DB?

          Regards
          Ervin
          I am using the ADODB Connection for the SQL Server.

          the Connection String is used by me

          conn.Connection Timeout = 15
          conn.Connection String = "driver={SQ L Server};server= " & Server2003 & ";UID=" & EmployeeLogin & " ;password=" & mahesh & ";database= " & emplogin & ""
          conn.Open
          If conn.State <> adStateOpen Then
          MsgBox ("SQL Server is not started. Please contact administrator")
          End If
          connectDatabase = enumDBConnectio n.DBConnected

          Here EmployeeLogin is the Seperate User created by the admin with all permissions for accessing the emplogin database.

          Comment

          • jrtox
            New Member
            • Sep 2007
            • 89

            #6
            Originally posted by mahesh123
            I am using the ADODB Connection for the SQL Server.

            the Connection String is used by me

            conn.Connection Timeout = 15
            conn.Connection String = "driver={SQ L Server};server= " & Server2003 & ";UID=" & EmployeeLogin & " ;password=" & mahesh & ";database= " & emplogin & ""
            conn.Open
            If conn.State <> adStateOpen Then
            MsgBox ("SQL Server is not started. Please contact administrator")
            End If
            connectDatabase = enumDBConnectio n.DBConnected

            Here EmployeeLogin is the Seperate User created by the admin with all permissions for accessing the emplogin database.

            Hello,

            Maybe my attachment(samp le.zip) will help you, just the Connection string.

            Follow this link
            http://www.thescripts. com/forum/thread719352.ht ml

            Regards
            Phils Ervin

            Comment

            Working...