ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Creating a Windows DLL with Visual Basic
Subject:   Error in loading DLL
Date:   2005-10-05 14:25:20
From:   country
Response to: Error in loading DLL

I am trying to access ADO object inside the windows dll .


I am getting the following error message
" Un handled Exception - ACCESS VIIOLATION"
Unhandled Exception Code (0XC0000005) at Address
(0X66024439)
Attempt to WRITE data at address (0x00000098)


Following is the code i used


Dim connstr As String
Dim Conn As Object
Dim rs As Object
Dim ret As Long
Dim sql As String
On Error GoTo ErrLabel
connstr = "***"
Set Conn = CreateObject("adodb.Connection")
Set rs = CreateObject("adodb.Recordset")
sql = "exec dbo.GetVerifyCoupon "
sql = sql + CStr(coupnum) + "," + CStr(cardID) + "," + CStr(siteID)
Conn.Open connstr
Set rs = Conn.Execute(sql)
ret = rs.fields(0).Value
Set Conn = Nothing
status = ret
Exit Sub
ErrLabel:
Set Conn = Nothing
status = 4