Solved

SQL Server Error

Posted on 2002-04-26
7
985 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now