Hello all, I have a question for ya. I have an inventory script that I have been using on mu SQl 2K DB's and it works great but we have a new SQL 2005 and I am unable to connect to it with vb using the a local 2005 db account.
I created a user in SQL 2005 and attached that user to a database. I am able to create a local ODBC to the sql 2005 database fine using the locally created account. But when I try and connect with my script the 2005 server does not connect. Here is my code:
Is there something different in SQL 2005 that I need to know???
Thanks,
timgerr
-How important does a person have to be before they are considered assassinated instead of just murdered?
So there you go! You're the retarded offspring of five monkeys having butt sex with a fish-squirrel! Congratulations!
I created a user in SQL 2005 and attached that user to a database. I am able to create a local ODBC to the sql 2005 database fine using the locally created account. But when I try and connect with my script the 2005 server does not connect. Here is my code:
Code:
Public Function GDAIS(strCPU)
Const adOpenStatic = 3
Const adLockOptimistic = 3
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
' objConnection.Open _
' "Provider=SQLOLEDB;Data Source=MeServerName;" & _
' "Persist Security Info=True;Initial Catalog=LANDesk;" & _
' "User ID=XXX;Password=XXXXX;"
objConnection.Open _
"Provider=sqloledb;" & _
"Data Source=MeServerName;" & _
"Initial Catalog=LANDesk;" & _
"User Id=XXX;" & _
"Password=XXXXXX"
objRecordSet.Open "SELECT Computer.DeviceName FROM LANDesk.dbo.Computer Computer WHERE(Computer.DeviceName='"& strCPU &"')", _
objConnection, adOpenStatic, adLockOptimistic
objRecordSet.MoveFirst
If objRecordSet.RecordCount > 0 Then
GDAIS = "GDAIS-lddb"
End If
objRecordSet.Close
objConnection.Close
End Function
Thanks,
timgerr
-How important does a person have to be before they are considered assassinated instead of just murdered?
So there you go! You're the retarded offspring of five monkeys having butt sex with a fish-squirrel! Congratulations!