Link to home
Start Free TrialLog in
Avatar of PaulSlechta
PaulSlechta

asked on

Sql Server 0x80004005 deadlock error using ADO

I am using ADO and I get a deadlock error.  When I query the errors collection I get back 0x80004005 and the typical deadlock error message.  I know that other messages can come back from the database with the same error number.  Is there any way to distinguish the difference other than searching through the message.  We handle our code execution different if it is a deadlock.  I cant search the message because other languages are used.

I am using this provider
Provider=SQLOLEDB.1;Data Source=devmacine;Initial Catalog=AAD;Persist Security Info=False

Avatar of Sara bhai
Sara bhai
Flag of India image

try out following with ur values.

'* set your variables here
serverIP = "192.168.100.1"
serverPORT = "1433" '* default port is 1433/TCP
serverDB = "Northwind"
serverLOGIN = "login"
serverPASSWORD = "pass"

'* open connection
Dim con
Set con = Server.CreateObject("ADODB.Connection")
con.ConnectionString = "Provider=SQLOLEDB.1;" & _
"Persist Security Info=False;" & _
"Network Library=DBMSSOCN;" & _
"Data Source=" & serverIP & "," & serverPORT & ";" & _
"Initial Catalog=" & serverDB & ";" & _
"User ID=" & serverLOGIN & ";" & _
"Password=" & serverPASSWORD & ";" & _
"Connect Timeout=5;Pooling=False"
Avatar of PaulSlechta
PaulSlechta

ASKER

No difference.
This message is what I need.  1205 is the number I need to get.  All I get is the Message and 0x80004005

Msg 1205, Level 13, State 51, Line 1
Transaction (Process ID 54) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
ASKER CERTIFIED SOLUTION
Avatar of PaulSlechta
PaulSlechta

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial