Every time I try to call pb_Unload16 it fails (returns O) and causes VB 6.0 to GPF. Has anyone ever ssen this happen?
Using Windows 98 SE...
Using Windows 98 SE...
'============================================================================== ' Routines for thunk to odbc 16 bit dll ' '============================================================================== Public Type SQL32Call cConnect As String * 128 InFile As String * 128 OutFile As String * 128 ReqType As Long End Type Public Declare Function pb_Unload16 Lib "DM321632.DLL" (ByVal hDLL As Long) As Long Public Declare Function pb_Load16 Lib "DM321632.DLL" (ByVal dllName As String) As Long Public Declare Function pb_GetProc16 Lib "DM321632.DLL" (ByVal zDll As Long, ByVal zFunction As String) As Long Public Declare Sub dmSQL32call Lib "DM321632.DLL" Alias "pb_Call16" (ByVal hProc As Long, Rec As SQL32Call) Global ghDLL As Long Global pfnDTest As Long 'Just for test 'Global rec As String Global gConnect As String Global Const SQLInsert = 1 Global Const SQLUpdate = 1 Global Const SQLDelete = 1 Global Const SQLSelect = 2 Global Const SQLDataSources = 3 Global gSQLCommandFile As String Global gSQLResultFile As String Sub Main() Dim s As Long gConnect = "ODBC;dsn=agencyG2;dbq=agencyG2;uid=morrisd;pwd=password;database=agencyG2" ghDLL = pb_Load16("dmodbc16.dll") pfnDTest = pb_GetProc16(ghDLL, "dmSQL32call") gSQLCommandFile = App.Path + "\" + "SQLIncmd.txt" gSQLResultFile = App.Path + "\" + "result.txt" Frm_Agnt.Show 1 'vbModal - this shows the extracted data for processing pb_Unload16 ghDLL '- This causes the System error in the VB runtime ' but not with the compiled exe program End Sub Function DoSQL(SQLfName$, SQLCmd$, OutFile$, _ dbConnect As String, SqlType As Long) As Long Dim fNo As Integer fNo = FreeFile Open SQLfName$ For Output As #fNo Print #fNo, SQLCmd$ Close fNo If Exist(OutFile) Then Kill OutFile End If Dim Req As SQL32Call Req.cConnect = dbConnect Req.InFile = SQLfName Req.OutFile = OutFile Req.ReqType = SqlType dmSQL32call pfnDTest, Req DoSQL = Req.ReqType End Function
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment