Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Unable to get data in ASP from Access


Message #1 by "pankaj kumar" <kumarpa@t...> on Mon, 3 Dec 2001 12:12:52
Hi Friends,

 I have created a COM server which uses VC++ dll(not COM)to connect to 

 Access database.

system DSN has been used 

    pwdstring = "ODBC;DSN=FST_SANDB32;UID=";

 

I am getting value in VB but getting following error in  ASP :



 A trappable error (E06D7363) occurred in an external object. The script  

cannot continue running. 

 



Main file of vc++ dll is:



  // partiden.cpp : Defines the initialization routines for the DLL.

//



#include "stdafx.h"

#include "partiden.h"

#include "cnidset.h"

#include "cpserset.h"



#ifdef _DEBUG

#define new DEBUG_NEW

#undef THIS_FILE

static char THIS_FILE[] = __FILE__;

#endif



CCnIdSet *m_CnIdSet = new CCnIdSet;

CCpSerSet *m_CpSerSet = new CCpSerSet;



///////////////////////////////////////////////////////////////////////////

//

// CPartidenApp



BEGIN_MESSAGE_MAP(CPartidenApp, CWinApp)

	//{{AFX_MSG_MAP(CPartidenApp)

		// NOTE - the ClassWizard will add and remove mapping 

macros here.

		//    DO NOT EDIT what you see in these blocks of 

generated code!

	//}}AFX_MSG_MAP

END_MESSAGE_MAP()



///////////////////////////////////////////////////////////////////////////

//

// CPartidenApp construction



CPartidenApp::CPartidenApp()

{

	// TODO: add construction code here,

	// Place all significant initialization in InitInstance

}



///////////////////////////////////////////////////////////////////////////

//

// The one and only CPartidenApp object



CPartidenApp theApp;



extern "C" __declspec (dllexport) void getconeid(long *retcode, char 

*cone_type,

							char *series, char 

*scone, char *cone)

{

	CString FltStr;





	FltStr  = "(OFFICIAL_PART_NUMBER = '";

	FltStr += cone;

	FltStr += "') AND (PART_SERIES.SORTED_PART_NUMBER = ";

	FltStr += "COMPONENT_PARTS.SORTED_PART_NUMBER) AND ";

	FltStr += "(SERIES.SORTED_SERIES_NUMBER = 

PART_SERIES.SORTED_SERIES_NUMBER)";





	m_CnIdSet->m_strFilter = FltStr;

//if recordset not open then do so, else requery

	if(!m_CnIdSet->IsOpen())

	{

		m_CnIdSet->Open(CRecordset::forwardOnly, NULL, 

CRecordset::readOnly);

	}

	else

	{

		m_CnIdSet->Requery();

	}





	if(!m_CnIdSet->IsBOF())

	{

		*retcode = 0;

		strcpy(cone_type, m_CnIdSet->m_COMPONENT_TYPE);

		strcpy(series, m_CnIdSet->m_OFFICIAL_SERIES_NUMBER);

		strcpy(scone, m_CnIdSet->m_SORTED_PART_NUMBER);

	}

	else

	{

		*retcode = 1;

	}

	return;

}

  



Anybody can tell what is going wrong.

  Thanks in advance


  Return to Index