MSDE 2000 Release A: Run-Time Error '-2147467259 (8000040050)'

G

Guest

Hi all,
I have MSDE 2000 Release A installed in my Windows XP Pro - Microsoft NT 4
LAN System in the following 2 instances:
1) a "default" instance cofigured to use Windows Authentication Mode,
2) a "named" instance cofigured to use Mixed Mode.
I executed the attached VBA code in Access 2003 and I got a Run-Time Error
'-2147467259 (800004005)': [DBNETLIB][ConnectionOpen(Connect())SQL.Server
does not exist or access denied. I am new in MS SQL Server/MSDE 2000 Release
A and I do not know what is wrong in my code or SQL parameters. Please help
and advise
Thanks in advance,
SHC
/////////////////////////////////////
Sub OpenMySQLDB()
Dim cnn1 As Connection
Dim rst1 As Recordset
Dim str1 As String

'Create a Connection object after instantiating it,
'this time to a SQL Server database.
Set cnn1 = New ADODB.Connection
str1 = "Provider=SQLOLEDB;Data Source=localhost;" & _
"Initial Catalog=NorthwindCS;User Id=sa;Password=SSPI;"
cnn1.Open str1

'Create recordset reference, and set its properties.
Set rst1 = New ADODB.Recordset
rst1.CursorType = adOpenKeyset
rst1.LockType = adLockOptimistic

'Open recordset, and print a test record.
rst1.Open "Customers", cnn1
Debug.Print rst1.Fields(0).Value, rst1.Fields(1).Value

'Clean up objects.
rst1.Close
cnn1.Close
Set rst1 = Nothing
Set cnn1 = Nothing

End Sub
 
D

David Lloyd

One suggestion would be to replace the "localhost" value in the connection
string with the name of the computer the MSDE is installed on. To connect
to the default instance, I believe you just use the computer name. If you
want to connect to a named instance, then it is in the form of
"ComputerName\InstanceName."

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


Hi all,
I have MSDE 2000 Release A installed in my Windows XP Pro - Microsoft NT 4
LAN System in the following 2 instances:
1) a "default" instance cofigured to use Windows Authentication Mode,
2) a "named" instance cofigured to use Mixed Mode.
I executed the attached VBA code in Access 2003 and I got a Run-Time Error
'-2147467259 (800004005)': [DBNETLIB][ConnectionOpen(Connect())SQL.Server
does not exist or access denied. I am new in MS SQL Server/MSDE 2000
Release
A and I do not know what is wrong in my code or SQL parameters. Please help
and advise
Thanks in advance,
SHC
/////////////////////////////////////
Sub OpenMySQLDB()
Dim cnn1 As Connection
Dim rst1 As Recordset
Dim str1 As String

'Create a Connection object after instantiating it,
'this time to a SQL Server database.
Set cnn1 = New ADODB.Connection
str1 = "Provider=SQLOLEDB;Data Source=localhost;" & _
"Initial Catalog=NorthwindCS;User Id=sa;Password=SSPI;"
cnn1.Open str1

'Create recordset reference, and set its properties.
Set rst1 = New ADODB.Recordset
rst1.CursorType = adOpenKeyset
rst1.LockType = adLockOptimistic

'Open recordset, and print a test record.
rst1.Open "Customers", cnn1
Debug.Print rst1.Fields(0).Value, rst1.Fields(1).Value

'Clean up objects.
rst1.Close
cnn1.Close
Set rst1 = Nothing
Set cnn1 = Nothing

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top