February 28, 2011 at 10:00 am
We had 2 customers out of hundreds that were getting error 80004005 when reading from the database using C++ code. Or server also has CSharp and java code, and those languages can connect and work just fine.
In the C++ code, the connection is valid and works fine, but simple selects and updates all fail with 80004005.
I replaced the connection string from "DRIVER=SQL Server;SERVER=" to "DRIVER={SQL Server Native Client 10.0};SERVER=" and everything seemed ok, but in further testing all is fine except 1 thread in 1 program still exhibits the earlier behavior.
We have checked permissions on tables, run the queries. I have looked at the errorlog and eventlog on SQL Server and there is nothing there. I have run SQL Profiler on the server and I can see that the queries get there, but I do not see an error (I don't see that it was success either, I am not a Profiler expert).
Any help or pointer would be great.
February 28, 2011 at 10:34 am
It sounds like it is a connection string issue. Check out Connection Strings[/url] website. That error number is one I have dealt with myself and simple getting the right connection string solved it perfectly. May take a little trial and error.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
February 28, 2011 at 10:41 am
i have tried several combinations from there, but nothing fixed this issue. Even in this one program, it works great, except in one thread. I was thinking it was possibly multiple recordsets open.
Code originally had a connection per thread, total 2. I changed the code to share a connection, and that did not fix the issue either.
February 28, 2011 at 10:44 am
What is the error message? This error number can have several different messages along with it.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
February 28, 2011 at 10:55 am
I would love to have an erorr message, but I cannot find one anywhere. I am trying to set up profiler to give me results, but have not found them yet. Below is my C++ code, the error HRESULT comes from the hr = Insert(); comes from. I know it is there, because the calls table is empty. The output in the log is 00,0000,000016fc,02/25/11,16:27:05,Cdbcalls::DBAddCall Insert -- HRESULT returned an unknown error..
charszRowBuf[16384];
sprintf(szRowBuf, "SELECT nCallNo, guidCallID, nOrigIP, nDestIP, FROM calls WHERE nCallNo = %u" , pCDRData->nCallNo);
hr = OpenRowset(szRowBuf);
if (hr != S_OK)
{
GetHRRESULTMessage(hr, message);
Diag(0,0,_T("Cdbcalls::DBAddCall OpenRowset -- %s."), message);
return(false);
}
bool doInsert = false;
hr = MoveNext();
if (hr != S_OK)
{
if ( hr == 0x0040ec6) // there is no next.
{
doInsert = true;
}
else
{
GetHRRESULTMessage(hr, message);
Diag(0,0,_T("Cdbcalls::DBUpdateCall SetData - %s"), message);
Close();
return(true);
}
}
ClearRecord();
CopyCDRData(pCDRData, true);
if (doInsert)
{
hr = Insert();
}
else
{
hr = SetData();
}
if (hr != S_OK)
{
GetHRRESULTMessage(hr, message);
Diag(0,0,"Cdbcalls::DBAddCall Insert -- %s.", message);
Close();
return(false);
}
February 28, 2011 at 11:02 am
I am about 99.9999% certain that the user is not able to insert to the calls table. Is there a trigger on this table that is maybe doing another insert that you didn't think of to check permissions on?
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
February 28, 2011 at 11:11 am
I ran OSQL with this user's credentials with a -Q"insert into calls (nCallNo, ...) values (44, ...)" and it worked fine. I could not think of another way to test this. There are not any triggers on this table.
February 28, 2011 at 11:18 am
Short of a connection string or permissions i don't know what else would cause this. Did you say you were able to reproduce the error while profiler was running? What did it say? Can you see the insert? Are there error messages?
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
February 28, 2011 at 11:24 am
Someone else had the time to try profiler, the insert did show up, she did not see any error or success code, I assume there are some more flags I have to turn on for the trace, i will be doing that today.
March 1, 2011 at 10:28 am
ok, I got profiler running. I get
Error: 590, Severity: 16, State: 1
RPC was aborted without execution.
Viewing 10 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply