Solved

SQL Server Error

Posted on 2002-04-26
7
993 Views
Last Modified: 2007-11-27
Run - time '2147467259(080004005)';
[DBNETLIB][ConnectionOpen(Connect()).]SQL Server does not exist or access denied

Secondly how do I change the server name from
SAICRESCENT\SQLSVRINSTANCE  to a single name


When I check the SQL SERVICE Manager I find the server name  as SAICRESCENT\SQLSVRINSTANCE and so in the code I am giving like below.  I had given  full permissions to Administrator .


Private Sub Command1_Click()
Option Explicit

Dim oConn As ADODB.Connection
Dim oRs As ADODB.Recordset

Private Sub Form_Load()

 Set oConn = New ADODB.Connection

 With oConn
     .Provider = "SQLOLEDB"
     .ConnectionString = "Server=\\SAICRESCENT\SQLSVRINSTANCE;UID= Administrator;Pwd=;Database=PUBS;"
     .Open
 End With
 sSQL = "SELECT * FROM JOBS"
 oRs.Open sSQL, oConn, adOpenForwardOnly, adLockReadOnly
End Sub
0
Comment
Question by:Richards
7 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6974555
Try this:
With oConn
    .Provider = "SQLOLEDB"
    .ConnectionString = "Server=SAICRESCENT\SQLSVRINSTANCE;UID= Administrator;Pwd=;Database=PUBS;"
    .Open
End With

CHeers
0
 

Author Comment

by:Richards
ID: 6978090
Thanks ! Angel . Now I am getting this error
Runt-time '-2147467259 (80004005)' :
Login failed for user 'sa'. Reason : Not
associated  with a trusted SQL Server Connection
I had given all the access to this user
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6979697
try those:
-- connect using the NT account (which must be accepted by SQL Server by either defining either the NT account itself or one of the NT groups the NT account belongs to)
With oConn
   .Provider = "SQLOLEDB"
   .ConnectionString = "Server=SAICRESCENT\SQLSVRINSTANCE;Integrated Security=SSIP;"
   .Open
End With

-- use the SA login explicitely
With oConn
   .Provider = "SQLOLEDB"
   .ConnectionString = "Server=SAICRESCENT\SQLSVRINSTANCE;UID=sa;Pwd=;Database=PUBS;"
   .Open
End With

CHeers
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:Richards
ID: 6981360
Hi Angel

Thanks !

When I try the first one I am getting this error
Run-Time error '-2147217887 (80040e21)' :
Multiple-step OLE DB operation generated errors. Check each OLE DB status value , if available . No work was
done

When I try the sa expliclty it is giving this error
Run time error '-214721843(80040e4d)';
Login failed for user 'sa'
0
 
LVL 2

Expert Comment

by:Chicko
ID: 7104340
Richards,

Most of your questions can be answered on the ms technet site, simply search on the error number you are getting and let technet do the rest.

http://www.microsoft.com/technet

Hope this helps

Regards
Chicko
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7265687

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 7296574
Per recommendation, points NOT refunded and question closed.

Netminder
CS Moderator
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In today’s complex data management environments, it is not unusual for UNIX servers to be dedicated to a particular department, purpose, or database.  As a result, a SAS® data analyst often works with multiple servers, each with its own data storage…
SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question