Re: Problem with ADO 2.7 and VB .NET Application
From: Val Mazur (group51a_at_hotmail.com)
Date: 02/23/04
- Next message: Val Mazur: "Re: Problem changing password using ADOX.Catalog.Users(User).ChangePassword"
- Previous message: Val Mazur: "Re: Distributing ADO 2.6 with an application"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 22 Feb 2004 22:18:44 -0500
Hi Marcin,
I think you have an issue, which described in next KB
http://support.microsoft.com/default.aspx?scid=kb;en-us;815117&Product=ado
--
Val Mazur
Microsoft MVP
"Marcin Floryan" <marcin[REMOVE]@floryan.neostrada.pl> wrote in message
news:u3pp9tS%23DHA.3568@TK2MSFTNGP10.phx.gbl...
> Hello!
>
> I have created a VB .NET 2003 application that uses ADO 2.7 for data
> access - accessing a Microsoft Access 2000 .mdb database via Microsoft.Jet
> 4.0.
> The application works fine with most of the users but there are some users
> who get a nasty error and the application doesn't start. (All my end-users
> use created installer to deploy the application and they all have the
> following components installed:
> * All updates from windowsupdate
> * Microsoft JET 4.0 SP8
> * .NET Framework 1.1
>
> The error some of the users get is:
> QueryInterface for interface ADODB._Recordset failed
>
> The more precise message from JIT debugger is:
> System.InvalidCastException: QueryInterface for interface ADODB._Recordset
> failed.
> at ADODB.RecordsetClass.MoveFirst()
>
> I have modified my code slightly to remove then call to MoveFirst() but
> the
> problem persists and it occurs on win98 as well as on win2000 and still I
> have some users reporting the software working OK under win98 and win2000
>
> To state the problem clearly the essential code follows:
>
> conDat = New ADODB.Connection
> With conDat
> .Provider = "Microsoft.Jet.OLEDB.4.0"
> .Mode = ADODB.ConnectModeEnum.adModeReadWrite
> .Properties("Jet OLEDB:Database Password").Value = "*****"
> End With
> Try
> conDat.Open("data.mdb")
> Catch ex As Exception
> MsgBox(ex.ToString)
> conDat = Nothing
> End
> End Try
>
> And then:
>
> Dim rst As ADODB.Recordset
> Dim iUsers As Integer = 0
> rst = conDat.Execute("SELECT count(*) FROM [users]")
> If Not rst.EOF Then '??
> iUsers = rst.Fields(0).Value
> End If
> rst.Close()
> rst = Nothing
>
> The error occurs in the line marked with '??
>
> (In the previous version - there was also a line: rst.MoveFirst() causing
> the reported above exception)
>
> The most important question is what causes this code to work on some
> systems
> (like my WinXP and other win2k or win98) and not work on others.
> Is it possible that it is caused by a missing component or a conflicting
> ver
> sion of component? If it means anything one of the systems where my
> software
> fails has office 97 installed and another one office 2k
>
> Hope there is some resonable solution.
>
> Best regards,
>
> Marcin Floryan
>
>
- Next message: Val Mazur: "Re: Problem changing password using ADOX.Catalog.Users(User).ChangePassword"
- Previous message: Val Mazur: "Re: Distributing ADO 2.6 with an application"
- Messages sorted by: [ date ] [ thread ]