Computing.Net > Forums > Programming > c++ Informix ODBC connection

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

c++ Informix ODBC connection

Reply to Message Icon

Original Message
Name: Alan Casey
Date: February 24, 2003 at 12:18:20 Pacific
Subject: c++ Informix ODBC connection
OS: Win NT
CPU/Ram: P2, 32M
Comment:

I have a problem with the below piece of code which tries to connect to a table in a remote Informix database. I get the error, cannot find DSN name or no default driver specified. I have checked my ODBC Informix driver 2.8 settings and all are correct. The program even finds other tables within the database. Perhaps it has somethinng to do with an ini file which it cannot access. The code is below:

// mstrsndb.cpp : implementation file
//

#include "stdafx.h"
#include "LBWC_new.h"
#include "mstrsndb.h"
#include "SNDB_DFT.H"

#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMstrSnDB

IMPLEMENT_DYNAMIC(CMstrSnDB, CRecordset)

CMstrSnDB::CMstrSnDB(CDatabase* pdb)
: CRecordset(pdb)
{
//{{AFX_FIELD_INIT(CMstrSnDB)
m_serialnum = _T("");
m_board_source_code = 0;
m_rev_level = _T("");
m_assy_code = _T("");
m_confirmed = 0;
m_nFields = 6;
//}}AFX_FIELD_INIT
}


CString CMstrSnDB::GetDefaultConnect()
{
return _T(rmt_sn_connect);
}

CString CMstrSnDB::GetDefaultSQL()
{
return _T(master_sn_tbl);
}

void CMstrSnDB::DoFieldExchange(CFieldExchange* pFX)
{
//{{AFX_FIELD_MAP(CMstrSnDB)
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Text(pFX, "serialnum", m_serialnum);
RFX_Date(pFX, "time_stamp", m_time_stamp);
RFX_Int(pFX, "board_source_code", m_board_source_code);
RFX_Text(pFX, "rev_level", m_rev_level);
RFX_Text(pFX, "assy_code", m_assy_code);
RFX_Int(pFX, "confirmed", m_confirmed);
//}}AFX_FIELD_MAP
}

/////////////////////////////////////////////////////////////////////////////
// CMstrSnDB diagnostics

#ifdef _DEBUG
void CMstrSnDB::AssertValid() const
{
CRecordset::AssertValid();
}

void CMstrSnDB::Dump(CDumpContext& dc) const
{
CRecordset::Dump(dc);
}
#endif //_DEBUG


Report Offensive Message For Removal








Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you own an iPhone?

Yes
No, but soon
No


View Results

Poll Finishes In 7 Days.
Discuss in The Lounge
Poll History




Data Recovery Software