Page 1 of 1

Possible reasons for Access Violation in module sqloledb.dll

Posted: Fri 12 Aug 2011 10:57
by brace
Which are the possibile reasons for this error:

Access violation at address 4DD1D3C4 in module 'sqloledb.dll'. Read of address 1570A0001

?

This is the call Stack:
TDataSet.DoInternalOpen
TDataSet.OpenCursor
TDataSet.SetActive
TDataSet.Open

I am just opening a query (TMSQuery). This error occurs only on a particular server, and only on this particular query. I tried also to restart Sql Server Service and to restart the full machine.


I copy and paste here the content of the query, there are also 2 integer parameters that are passed before executing.

Code: Select all

SELECT ER.ID_EVA_REFERENCES, ER.ID_EVA_REFERENCE_TYPES,ERT.REF_NAME,
ER.ID_EVENTO, ER.ID_FOR_ALL, ER.ID_CONTATTO, ERT.KORD_APP,
REFNAME = (CASE 
 WHEN ERT.KORD_APP = 5 THEN (SELECT RAGIONE_SOCIALE FROM GCF_ANAGRAFICA WHERE ID_CONTO = ER.ID_FOR_ALL)
 WHEN ERT.KORD_APP = 7 THEN (SELECT NOME + ' ' + COGNOME FROM PER_ANAGRAFICA WHERE ID_DIPENDENTE = ER.ID_FOR_ALL)
 WHEN ERT.KORD_APP = 22 THEN (SELECT COD_CESPITE + ' ' + DESCR_CESPITE FROM CES_ANAGRAFICA WHERE ID_CESPITE = ER.ID_FOR_ALL)
 WHEN ERT.KORD_APP = 4 THEN (SELECT COD_ARTICOLO + ' ' + DESCR_ARTICOLO FROM ART_ANAGRAFICA WHERE ID_ARTICOLO = ER.ID_FOR_ALL)
 WHEN ERT.KORD_APP = 46 THEN (SELECT NOME + ' ' + COGNOME FROM CIT_ANAGRAFICA WHERE ID_CITTADINI = ER.ID_FOR_ALL)
 WHEN ERT.KORD_APP = 6 THEN (SELECT DESCR_FUNZIONE FROM MSQ_FUNZIONI WHERE ID_FUNZIONE = ER.ID_FOR_ALL)
 WHEN ERT.KORD_APP = 38 THEN (SELECT COD_PROGETTO + ' - ' + DESCR_PROGETTO FROM PRG_PROGETTI WHERE ID_PROGETTO = ER.ID_FOR_ALL)
 WHEN ERT.KORD_APP = 14 THEN (SELECT CONVERT(VARCHAR(10), ID_EVENTO) + ' - ' + NRO_EVENTO + ' - ' 
	+ ISNULL(DESCR_TITOLO, '') FROM EVA_TESTATA_EVENTO WHERE ID_EVENTO = ER.ID_FOR_ALL)
 END), 
REFCONTACT = (CASE  
 WHEN ERT.IS_COMMON IS NULL THEN ''
 ELSE (SELECT ISNULL(COGNOME, '') + ' ' + ISNULL(NOME, '') FROM GCF_CONTATTI WHERE ATTIVO = 'Y' AND ID_CONTATTO = ER.ID_CONTATTO)
 END) 
FROM EVA_REFERENCES ER
INNER JOIN EVA_REFERENCE_TYPES ERT ON ER.ID_EVA_REFERENCE_TYPES = ERT.ID_EVA_REFERENCE_TYPES
WHERE ER.ID_EVENTO = :ID_EVENTO AND  ERT.MODULE_KORD_ID = :MKORD_ID

Posted: Fri 12 Aug 2011 12:14
by AndreyZ
Hello,

This problem might be caused by Microsoft Data Access Components (MDAC). You can try upgrading them to the latest version and check them after it. For more information, please see:
http://support.microsoft.com/kb/301202
http://www.microsoft.com/download/en/de ... en&id=1953

You can also try using Native Client provider and check if it solves the problem. For this, you should set the TMSConnection.Options.Provider property to prNativeClient.

Posted: Fri 12 Aug 2011 18:32
by brace
Thanks for the information.

I also found why the error was there: a query parameter was not initialized. Anyway on all machines this was ok, while on that customer I had the AV.

So probably that customer has a problem with MDAC as you suggested.

Thanks a lot.