Re: IDispatch error #3149
- From: "Michael Harvey" <michaelharvey.nospam@xxxxxxxxxxxx>
- Date: Thu, 28 Jul 2005 13:19:27 -0400
Is there a way to specify the location of the workgroup information file in
the Open function, when using C++ for Microsoft.Jet.OLEDB.4.0. I have not
found a C++ example in MSDN that uses secure Access files with the Jet
provider.
"Michael Harvey" <michaelharvey.nospam@xxxxxxxxxxxx> wrote in message
news:uoVtyJTkFHA.4024@xxxxxxxxxxxxxxxxxxxxxxx
> Thanks for the solution, but that applies to Visual Studio .NET.
> I am using VC++ 6 to make a WIN32 console application. The error message
> appears in the console window on calling the Open function.
>
> // adotest2.cpp : Defines the entry point for the console application.
> //
>
> #include "stdafx.h"
> #import "c:\Program Files\Common Files\System\ADO\msado15.dll" \
> no_namespace rename("EOF", "EndOfFile")
>
> #include <stdio.h>
> #include <icrsint.h>
>
> _COM_SMARTPTR_TYPEDEF(IADORecordBinding, __uuidof(IADORecordBinding));
>
> inline void TESTHR(HRESULT _hr) { if FAILED(_hr) _com_issue_error(_hr); }
>
> class CCustomRs : public CADORecordBinding
> {
> BEGIN_ADO_BINDING(CCustomRs)
> ADO_VARIABLE_LENGTH_ENTRY2(1, adVarChar, m_ch_fname,
> sizeof(m_ch_fname), m_ul_fnameStatus, false)
> ADO_VARIABLE_LENGTH_ENTRY2(2, adVarChar, m_ch_lname,
> sizeof(m_ch_lname), m_ul_lnameStatus, false)
> END_ADO_BINDING()
> public:
> CHAR m_ch_fname[22];
> CHAR m_ch_lname[32];
> ULONG m_ul_fnameStatus;
> ULONG m_ul_lnameStatus;
> };
>
> void main(void)
> {
> ::CoInitialize(NULL);
> try
> {
> _RecordsetPtr pRs("ADODB.Recordset");
> CCustomRs rs;
> IADORecordBindingPtr picRs(pRs);
> pRs->Open("SELECT * FROM Data",
> "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=c:\\temp\\PAY5000.mdb;User ID=admin;Password=PAYData5000;",
> adOpenForwardOnly, adLockReadOnly, adCmdText);
> TESTHR(picRs->BindToRecordset(&rs));
>
> while (!pRs->EndOfFile)
> {
> // Process data in the CCustomRs C++ instance variables.
> printf("Name = %s %s\n",
> (rs.m_ul_fnameStatus == adFldOK ? rs.m_ch_fname: "<Error>"),
> (rs.m_ul_lnameStatus == adFldOK ? rs.m_ch_lname: "<Error>"));
>
> // Move to the next row of the Recordset.
> // Fields in the new row will automatically be
> // placed in the CCustomRs C++ instance variables.
>
> pRs->MoveNext();
> }
> }
> catch (_com_error &e )
> {
> printf("Error:\n");
> printf("Code = %08lx\n", e.Error());
> printf("Meaning = %s\n", e.ErrorMessage());
> printf("Source = %s\n", (LPCSTR) e.Source());
> printf("Description = %s\n", (LPCSTR) e.Description());
> }
> ::CoUninitialize();
> }
>
>
> "Val Mazur (MVP)" <group51a@xxxxxxxxxxx> wrote in message
> news:O1xr1FzjFHA.1044@xxxxxxxxxxxxxxxxxxxxxxx
>> Hi,
>>
>> Check if this is not your case
>>
>> http://support.microsoft.com/default.aspx?scid=kb;en-us;823913
>>
>> --
>> Val Mazur
>> Microsoft MVP
>>
>> http://xport.mvps.org
>>
>>
>>
>> "Michael Harvey" <michaelharvey.nospam@xxxxxxxxxxxx> wrote in message
>> news:%23X4DJJnjFHA.1464@xxxxxxxxxxxxxxxxxxxxxxx
>>> Hi, I get this error concerning the workgroup information file. The file
>>> does exist, so it must be opened by another user. However, I haven't a
>>> clue how to determine who has opened it. There is no-one else logged on
>>> to the network.
>>>
>>> Error:
>>> Code = 80040e4d
>>> Meaning = IDispatch error #3149
>>> Source = Microsoft JET Database Engine
>>> Description = Cannot start your application. The workgroup information
>>> file is missing or opened exclusively by another user.
>>>
>>
>>
>
>
.
- References:
- IDispatch error #3149
- From: Michael Harvey
- Re: IDispatch error #3149
- From: Val Mazur \(MVP\)
- Re: IDispatch error #3149
- From: Michael Harvey
- IDispatch error #3149
- Prev by Date: Re: calling stored procedure with optional parameter
- Next by Date: ADO return varchar string with space trimmed
- Previous by thread: Re: IDispatch error #3149
- Next by thread: ADO.NET performance with large tables
- Index(es):