Originally posted by: NewToMS-VC++5
Download Source Code may be used to do the same thing as the instruction in the article but it certainly doesn't do it as instructed in the article.
I've been following the instructions in the article. I've created the Helper.idl and included the line
import "msado15.idl";
in it as instructed in the article.
But I'm getting:
Processing C:\WINNT\system32\msado15.idl
msado15.idl
MIDL error 0xc0000005: unexpected compiler problem. Try to find a work around.
Error executing c:\winnt\system32\cmd.exe.
Would someone make the Source Code that follows the instruction in the article as is available?
Thanks.
Reply
Originally posted by: Muhamed rafi
hi,
can u tell me how to connec the vc__client to access the oracle database which is running on scounix rnvironment..
Thanks & rgds
rafi
Originally posted by: aa
this is a great article.
but when an mfc client imports more than one vc++ dll that
has a method that returns _Recordset** ,i have a redefinition error when importing the 2nd tlb\dll.
what can i do to solve this problem ?
note: it works in a vb client.
Originally posted by: Nick Grant
_ConnectionPtr m_pConnection;
do
CoUninitialize();
Presumably this means that your program suffers this
Nick Grant
The following simple code sample leaks memory at the rate
of about 16k per hour on my PII-400.
CoInitialize(NULL);
{
m_pConnection.CreateInstance( __uuidof( Connection ) );
m_pConnection = NULL;
}
while (1);
problem as well, or have you managed to find a workaround?
Originally posted by: J. Tian
Is a way to create a data source object like the one created with VB in msdn.microsoft.com/isapi/msdnlib.idc?theURL=/library/devprods/vs6/vbasic/vbcon98/vbconcreatingdatasource.htm
Thanks.
Reply
Originally posted by: Adrian Edmodns
Great! Write the book. It would sell
ReplyOriginally posted by: John GODEL
When I add this line compiler gave this errors
F:\Microsoft Visual Studio\MyProjects\EchoCOM\17Sep\Source\EchoCOM\EMInputMgr.cpp(428) : error C2065: '_ConnectionPtr' : undeclared identifier
F:\Microsoft Visual Studio\MyProjects\EchoCOM\17Sep\Source\EchoCOM\EMInputMgr.cpp(430) : error C2228: left of '.CreateInstance' must have class/struct/union type
_ConnectionPtr pConn;
F:\Microsoft Visual Studio\MyProjects\EchoCOM\17Sep\Source\EchoCOM\EMInputMgr.cpp(428) : error C2146: syntax error : missing ';' before identifier 'pConn'
F:\Microsoft Visual Studio\MyProjects\EchoCOM\17Sep\Source\EchoCOM\EMInputMgr.cpp(428) : error C2065: 'pConn' : undeclared identifier
pConn.CreateInstance(__uuidof(Connection));
and for this line :
F:\Microsoft Visual Studio\MyProjects\EchoCOM\17Sep\Source\EchoCOM\EMInputMgr.cpp(430) : error C2065: 'Connection' : undeclared identifier
Why?
you have to import msado15.dll in your project you can add this code in your project #import "C:\program files\common files\system\ado\msado15.dll" no_namespace \ rename( "EOF", "adoEOF" )
ReplyOriginally posted by: Doug Knudson
bool CAISADOConnect::Execute(CString procName)
// See how we did
// See if the result set returned rows
return true;
}
create proc ado_test_proc
begin
return some_value
end
Thanks for this and your previous article on ADO. As a real ADO novice, your articles have been the best documentation I have been able to find! I do have a question on executing Stored Procedures that return a result set AND a return value. I am able to retieve one or the other but not both... This is what I do:
{
// Attach a parameter to the Command object to receive the return value
_ParameterPtr retValParm = mp_ado_command->CreateParameter("Return Value",adInteger,adParamReturnValue,4,COleVariant((long)0));
mp_ado_command->Parameters->Append(retValParm);
// Get a BSTR for the stored procedure name and attach it to the command object
BSTR bProcName = procName.AllocSysString();
mp_ado_command->CommandText = bProcName;
SysFreeString(bProcName);
// Execute the query and set the current record count member variable
m_hr = mp_ado_recordset->Open(mp_ado_command.GetInterfacePtr(),vtMissing,adOpenStatic,adLockReadOnly,adCmdStoredProc);
if (FAILED(m_hr))
{
return false;
}
else
{
m_row_count = mp_ado_recordset->GetRecordCount();
}
The Stored Procedure looks like this:
as
select
some_column
from
SOME_TABLE
When the code executes, I can retrieve the returned value (some_value) from the Parameter Object, but the call to Open the recordset succeeds but the record set is empty. If I comment out the return statement in the Stored Procedure, I get the recordset loaded with data (and of course, no return value).
Any ideas would be greatly appreciated!!
You need to close the recordset before any return or output parameters become populated. See this article on MSDN for more information: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adosql/adoprg02_525v.asp
ReplyOriginally posted by: Rama Nadendla
Hi
Does anybody know of any prblems with ado used in dll's. i am exporting a database manager object from the dll which has an connection. In the constructor i do an open and in the destructor i close the connection. The _ConnectionPtr's Release call is causing the exception. I am not sure where the reference count is getting messed up. I do not explicity call AddRef on any of the ADO ptr's. If anybody has an idea please...
Thanks in advance.
Rama
Originally posted by: Alex Moyzes
Any information about ADO is very usefull. I have created Data Base Browser (DBB) with ADO. DBB allows you read any Databases, Tables on SQL Server, MS Acces, Oracle, and Sybase and get the result of queries. Unfortunatelly I could not find how to get information about names of tables particular database. So I had to use SQLTables that is, in my opinion, inconsistent ADO idea. If you know how to do it, please send me information.
Reply