The following code attaches to an Oracle database to draw data into Access. It works about 25% of the time and crashes the rest. The crash is horrible as it doesnt show me an error message, but instead closes the database pops up a window saying "Microsoft Office Excel has encountered a problem and needs to close. We are sorry for the inconvenience."
The crash happens when 'rsADO.Open SQL, cnADO' executes. Any ideas what Access is up to, how to fix it, or how to get Access to tell me what it doesnt like rather than crashing?
MS Access 2003 SP2 running on XP Pro Ver2002 SP2
Here's the code....
Dim cnADO As ADODB.Connection
Dim rsADO As ADODB.Recordset
Set cnADO = New ADODB.Connection
Set rsADO = New ADODB.Recordset
cnADO.CursorLocation = adUseClient
cnADO.Mode = adModeShareDenyNone
cnADO.CommandTimeout = 0
cnADO.ConnectionString = "Provider=OraOLEDB.Oracle.1;Password='xxxx';Persist Security Info=True;User ID='xxxx';Data Source=ORACLE.SERVER"
cnADO.Open 'Open connection
Do 'Added to check state
Loop While cnADO.State = 0 'Added to check state
SQL = sqlGetData
KillSomeTime 15 'Added some stability
rsADO.Open SQL, cnADO
The crash happens when 'rsADO.Open SQL, cnADO' executes. Any ideas what Access is up to, how to fix it, or how to get Access to tell me what it doesnt like rather than crashing?
MS Access 2003 SP2 running on XP Pro Ver2002 SP2
Here's the code....
Dim cnADO As ADODB.Connection
Dim rsADO As ADODB.Recordset
Set cnADO = New ADODB.Connection
Set rsADO = New ADODB.Recordset
cnADO.CursorLocation = adUseClient
cnADO.Mode = adModeShareDenyNone
cnADO.CommandTimeout = 0
cnADO.ConnectionString = "Provider=OraOLEDB.Oracle.1;Password='xxxx';Persist Security Info=True;User ID='xxxx';Data Source=ORACLE.SERVER"
cnADO.Open 'Open connection
Do 'Added to check state
Loop While cnADO.State = 0 'Added to check state
SQL = sqlGetData
KillSomeTime 15 'Added some stability
rsADO.Open SQL, cnADO