PDA

View Full Version : Unhandled exception in VB6.EXE(DAO350.DLL) 0xC0000005 Access Violation


Tryin2Koad
05-28-2004, 01:45 PM
We are using Windows 2000 Pro (SP4), to access an Informix 7.31 database on a Windows 2000 Server (SP3).

RDB set as public variable in form as follows:
Public RDB As Database

It is then opened up as follows:
Set RDB = OpenODBCDatabase()

--------------------
Function OpenODBCDatabase is as follows
--------------------
Function OpenODBCDatabase() As Database
On Error GoTo OpenDatabaseError

Set OpenODBCDatabase = Workspaces(0).OpenDatabase("DatabaseName", _
False, True, _ "ODBC;DSN=DSNName;DATABASE=DatabaseNameOnDisk;UID=UserID;PWD=password;L OGINTIMEOUT=240")
On Error Resume Next
Exit Function

OpenDatabaseError:
MsgBox "Trying to open the Database" & Chr(13) & _
"Error # " & Err.Number & Chr(13) & _
Err.Description & Chr(13) & _
"Generated from " & Err.Source, vbCritical
Resume Next
End Function
--------------------

The code that now triggers the error (but worked in the past):
SQLQuery = 'UPDATE ttdsls040001 SET t_opicker = "abc12345" WHERE t_orno = 50000'
RDB.Execute SQLQuery, dbSeeChanges + dbFailOnError + dbSQLPassThrough


I get an application error, details below:

First this pops up:
vb6.exe Application Error
The instruction at "0x04672b9f" referenced memory at "0x6d3fd0ee". The memory could not be read. (Note - the addresses change every time I try this).

So, I click "Cancel", which brings up the debugger. The debugger shows:
Unhandled exception in VB6.EXE(DAO350.DLL) 0xC0000005 Access Violation

I click "OK" then get this:

A bunch of Assembler, with the little yellow arrow pointing to this line:
04672B9F cmp esi,dword ptr [eax]

The Call Stack shows:
DAO350! 04672b9f()
6d3fd0ee()

This used to work. What is different? I don't know. Why is it no longer working? I'm not sure. I have been playing around with the project references to see if anything helps. I was/am using Microsoft DAO 2.5/3.5 compatibility library. Any assistance would be appreciated.

ShaneH
05-28-2004, 01:52 PM
I know this is not very helpful, but did you try a re-boot? Also, try compiling and running it outside the IDE. Do you get an error then? Will it even let you compile?

Tryin2Koad
05-28-2004, 02:08 PM
I tried a reboot, but that didn't do the trick (it is happening on 2 different computers).

Yes, it will let me compile.

I do not know what you are referring to when you say IDE (intelligent drive electronics, informix data engine, I do extacy...). It is just another TLA to me (three letter acronym) that deters my learning. Could you please use the long form of the item you are referring to? I hear way too many TLA's to be able to isolate them anymore between hardware, software, electronics, government etc....

As an extra note, while playing around with the references, the reference to DAO 2.5/3.5 Compatability Library has now disappeared :(. So, now I am stuck with DAO 3.5 Library.

ShaneH
05-28-2004, 05:39 PM
Sorry, IDE in this usage means Integrated Development Environment, basically the Visual Studio software that you're using to write your program. For some reason, your code is crashing the IDE (that's vb6.exe)

Dennis DVR
05-29-2004, 12:08 AM
try to updrade your DAO 3.5 to DAO 3.6 and see what happend

MKoslof
05-29-2004, 08:23 AM
Upgrade your MDAC and make sure you have only ONE DAO reference :). Do not have 3.6 and 3.5 referenced at the same time..these use some different underlying dlls, so I conflict will occur.