Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. ADO Disconnected Recordset

ADO Disconnected Recordset

Scheduled Pinned Locked Moved Database
databasegraphicssysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cmacgowan
    wrote on last edited by
    #1

    Hi ... I am trying to use ADO disconnected recordset to insert data into a sql table. I am using AddNew(vField, vValue) with UpdateBatch(). The code below does not throw any exceptions ... but does not add data to the table. Any comments are appreciated, Thanks, Chris void CTestApp::TestDatabaseUpdateBatch1a(void) { int nDataCount = 0; long nIndex = 0; long nIndex2 = 0; CString csMessage; CString csErrorMessage; CString csTemp; CString csSQL; BOOL bIsOpen; BOOL bIsEmpty; long nCount = 0; int nTemp = 0; int nLimit = 0; int nTempInt = 0; long nTempLong = 0; double nTempDouble = 0; HRESULT hResult; SYSTEMTIME st; int i = 0; string strTemp; _variant_t sval; _variant_t vNull; vNull.vt = VT_ERROR; vNull.scode = DISP_E_PARAMNOTFOUND; COleSafeArray colesaFieldList; COleSafeArray colesaDataList; vector *pvecDataList; pvecDataList = new vector; COleDateTime oledtCurrentDate = COleDateTime::GetCurrentTime(); // Convert the OleDateTime to the varient // COleVariant vCurrentDateTime(oledtCurrentDate); COleVariant vCurrentDateTime; CMxTextParse *pMxTextParse = NULL; CMainFrame *pMainFrame = (CMainFrame *)AfxGetMainWnd(); CFrameWnd* pChild = pMainFrame->GetActiveFrame(); CTestMeteorlogixView* pView = (CTestMeteorlogixView*)pChild->GetActiveView(); pView->WriteLog("Start TestDatabaseUpdateBatch1a."); pView->WriteLog("Load table using AddNew() and UpdateBatch()."); // Define ADO connection pointers _ConnectionPtr pConnection = NULL; _RecordsetPtr pRecordset = NULL; try { // When we open the application we will open the ADO connection pConnection.CreateInstance(__uuidof(Connection)); // Replace Data Source value with your server name. bstr_t bstrConnect("Provider='sqloledb';Data Source='SQLDEV';" "Initial Catalog='AlphaNumericData';" "User Id=cmacgowan;Password=cmacgowan"); // Open the ado connection pConnection->Open(bstrConnect,"","",adConnectUnspecified); // Create an instance of the database pRecordset.CreateInstance(__uuidof(Recordset)); // Select the correct sql string. Note that we are creating an

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups