473,419 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

Upgrade help (Interop Problems with DAO)

I'm having some Interop problems. I really need someone's
help on this, i'm running out of ideas. I have upgraded
my Data access controls to the latest ver.

Now then i have a form with these ref's:
Interop.DAO,System,System.Data,System.Drawing,Syst em.windo
ws.forms,System.XML.
all that's on this form is a button and when the button
is clicked it opens up a fox pro database and gets the
needed info/close. Now this works just fine on my
development PC. no errors/no probs. But when i move it
over to my win NT 4x machine it throws this err.

object ref not set to a instance of a object.
'Mod
Module UpgradeSupport
Friend DAODBEngine_definst As New DAO.DBEngine()
End Module
'click Evt for form1
Private Sub Command1_Click(ByVal eventSender As
System.Object, ByVal eventArgs As System.EventArgs)
Handles Command1.Click
MsgBox(GetLoanCode("RNM31025.DBF", 0))
End Sub

Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Try

' Loads the companies list information and
stores it in the
' collection complist
Dim db As DAO.Database
Dim tbl As DAO.Recordset
Dim tmpServer As String
Dim tmpRemoteSite As Boolean
Dim DAODBEngine_definst As New DAO.DBEngine()
'Set db = OpenDatabase
("\\serverc\c\datasys\", False, False, "FoxPro 2.5;")
db = DAODBEngine_definst.OpenDatabase
("C:\Complist\", False, False, "FoxPro 2.5;")
tbl = db.OpenRecordset("COMPLIST",
DAO.RecordsetTypeEnum.dbOpenSnapshot)
tbl.MoveLast()
tbl.MoveFirst()

Dim clsComplist As New CompanyList()

While Not tbl.EOF
If Trim(tbl.Fields("ID").Value & "")
<> "" Then
tmpServer = tbl.Fields
("Server").Value & ""
tmpRemoteSite = CBool(tbl.Fields
("RemoteSite").Value & "")
If tmpServer = "" Then tmpServer = "A"
clsComplist.GetCompanies.Add
(tbl.Fields("ID").Value, tbl.Fields("Billcode").Value
& "", tmpServer, CShort(tbl.Fields("RemoteType").Value
& ""), tmpRemoteSite)
tmpServer = ""
End If
tbl.MoveNext()
End While
MsgBox("done")
Catch
MsgBox(Err.Number & " " & Err.Description)
End Try
End Sub
'form1 info
Option Strict Off
Option Explicit On
Imports VB = Microsoft.VisualBasic
Friend Class Form1
Inherits System.Windows.Forms.Form
#Region "Windows Form Designer generated code "
Public Sub New()
MyBase.New()
If m_vb6FormDefInstance Is Nothing Then
If m_InitializingDefInstance
Then
m_vb6FormDefInstance
= Me
Else
Try
'For the
start-up form, the first instance created is the default
instance.
If
System.Reflection.Assembly.GetExecutingAssembly.En tryPoint
..DeclaringType Is Me.GetType Then

m_vb6FormDefInstance = Me
End If
Catch
End Try
End If
End If
'This call is required by the Windows
Form Designer.
InitializeComponent()
End Sub
'Form overrides dispose to clean up the
component list.
Protected Overloads Overrides Sub Dispose(ByVal
Disposing As Boolean)
If Disposing Then
If Not components Is Nothing
Then
components.Dispose()
End If
End If
MyBase.Dispose(Disposing)
End Sub
'Required by the Windows Form Designer
Private components As
System.ComponentModel.IContainer
Public ToolTip1 As System.Windows.Forms.ToolTip
Public WithEvents Command1 As
System.Windows.Forms.Button
'NOTE: The following procedure is required by
the Windows Form Designer
'It can be modified using the Windows Form
Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.components = New
System.ComponentModel.Container()
Me.ToolTip1 = New System.Windows.Forms.ToolTip
(Me.components)
Me.Command1 = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'Command1
'
Me.Command1.BackColor =
System.Drawing.SystemColors.Control
Me.Command1.Cursor =
System.Windows.Forms.Cursors.Default
Me.Command1.Font = New System.Drawing.Font
("Arial", 8.0!, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Command1.ForeColor =
System.Drawing.SystemColors.ControlText
Me.Command1.Location = New System.Drawing.Point
(56, 96)
Me.Command1.Name = "Command1"
Me.Command1.RightToLeft =
System.Windows.Forms.RightToLeft.No
Me.Command1.Size = New System.Drawing.Size(185,
41)
Me.Command1.TabIndex = 0
Me.Command1.Text = "Command1"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5,
13)
Me.ClientSize = New System.Drawing.Size(312, 209)
Me.Controls.AddRange(New
System.Windows.Forms.Control() {Me.Command1})
Me.Font = New System.Drawing.Font("Arial", 8.0!,
System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)

End Sub
#End Region
#Region "Upgrade Support "
Private Shared m_vb6FormDefInstance As Form1
Private Shared m_InitializingDefInstance As
Boolean
Public Shared Property DefInstance() As Form1
Get
If m_vb6FormDefInstance Is
Nothing OrElse m_vb6FormDefInstance.IsDisposed Then

m_InitializingDefInstance = True
m_vb6FormDefInstance
= New Form1()

m_InitializingDefInstance = False
End If
DefInstance =
m_vb6FormDefInstance
End Get
Set
m_vb6FormDefInstance = Value
End Set
End Property
#End Region

cheers.
--------------
:)

Nov 20 '05 #1
4 5653
"john" <no****@email.com> schrieb
I'm having some Interop problems. I really need someone's
help on this, i'm running out of ideas. I have upgraded
my Data access controls to the latest ver.

Now then i have a form with these ref's:
Interop.DAO,System,System.Data,System.Drawing,Syst em.windo
ws.forms,System.XML.
all that's on this form is a button and when the button
is clicked it opens up a fox pro database and gets the
needed info/close. Now this works just fine on my
development PC. no errors/no probs. But when i move it
over to my win NT 4x machine it throws this err.

object ref not set to a instance of a object.


In which line?
--
Armin

Nov 20 '05 #2
The problem(s) are here

dbsource = DAODBEngine_definst.Workspaces(0).OpenDatabase
("C:\dbf\", False, False, "FoxPro 2.6;")
' Connecting to Table

tblSource = dbsource.OpenRecordset(sTableName,
DAO.RecordsetTypeEnum.dbOpenTable)
-----Original Message-----
"john" <no****@email.com> schrieb
I'm having some Interop problems. I really need someone's help on this, i'm running out of ideas. I have upgraded my Data access controls to the latest ver.

Now then i have a form with these ref's:
Interop.DAO,System,System.Data,System.Drawing,Syst em.windo ws.forms,System.XML.
all that's on this form is a button and when the button is clicked it opens up a fox pro database and gets the
needed info/close. Now this works just fine on my
development PC. no errors/no probs. But when i move it over to my win NT 4x machine it throws this err.

object ref not set to a instance of a object.


In which line?
--
Armin

.

Nov 20 '05 #3
here is a new error message.
this happens when i take out the vbHelper Mod and add
this in the method that opens the database.
Dim a As New DAO.DBEngine()
a.workspace(0)....

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80040112):
Exception from HRESULT: 0x80040112.
at Project1.Form1.test(String& sTableName, Int16&
iNoDocuments)
at Project1.Form1.Button1_Click(Object sender,
EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp
(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m,
MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage
(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc
(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///d:/winnt/microsoft.net/framework/v1.1.4322/mscorli
b.dll
----------------------------------------
Project1
Assembly Version: 1.0.1334.18831
Win32 Version: 1.0.1334.18831
CodeBase: file:///C:/Documents%20and%
20Settings/John/Desktop/test/upgraded/obj/Release/Project1
..exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///d:/winnt/assembly/gac/system.windows.forms/1.0.500
0.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///d:/winnt/assembly/gac/system/1.0.5000.0__b77a5c561
934e089/system.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.3052.4
CodeBase:
file:///d:/winnt/assembly/gac/microsoft.visualbasic/7.0.50
00.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///d:/winnt/assembly/gac/system.drawing/1.0.5000.0__b
03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
Interop.DAO
Assembly Version: 4.0.0.0
Win32 Version: 4.0.0.0
CodeBase: file:///C:/Documents%20and%
20Settings/John/Desktop/test/upgraded/obj/Release/Interop.
DAO.DLL
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file
for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms
section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.

Nov 20 '05 #4
Hello,

"john" <no****@email.com> schrieb:
I'm having some Interop problems. I really need someone's
help on this, i'm running out of ideas. I have upgraded
my Data access controls to the latest ver.


Why don't use ADO .NET?

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Morning DJ | last post by:
I have a continuous form that works just swell in A97. The datasource is a linked table in the backend database that has an ID field as the PK and no other indices. I take that table from the...
3
by: NickName | last post by:
We have a form-based application running all right. But once upgraded from 97 to 2003. One of the functions no longer work, for instance, one function that queries all sellers and populates them,...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
0
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
9
by: The Grim Reaper | last post by:
Dear Gurus... (Sorry to cross post... but...) I have a dire problem - been working on this for days now. It's the undocumented API's for NTDLL.dll - namely NtOpenSection, NtMapViewOfSection,...
3
by: RayPower | last post by:
I'm having a system using Access 2000 as both front-end (queries, forms, reports & temp tables for reports) & back-end (data) with back-end running on the server. The application runs on the...
4
by: dorpnospam | last post by:
We have an old but very critical application that was written in VB 6 against Access 95 dbs. We need to ditch this decrepit old unstable db platform but we are trying to determine the best...
2
by: Paul Engel | last post by:
I have an application that must work with some old Access97 databases. I have been able to accomplish the task w/ ADO.Net, but the performance is about 25X slower. Since the program is working on...
1
by: Armin Zingler | last post by:
Hi group, after waiting more than 4 month in the .upgrade group for an answer, I dare to ask here. :-) I open a VB6 project in VB 2008 (express) and have the Wizard convert it. It also...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.