Error 1 fatal error C1083: Cannot open type library file: 'c:\windows\microsoft.net\framework\v2.0.50727\system.dll': Error loading type library/DLL. c:\users\test444\documents\visual studio 2008\projects\sampleado\sampleado\sampleado.cpp 3 SampleADO
#include "stdafx.h" #import "C:\Program Files (x86)\Common Files\System\ado\msado15.dll" rename_namespace("MSXML") rename("EOF", "ADOEOF") #import "System.dll" #include <windows.h> #include <sql.h> #include <sqlext.h> #include <sqltypes.h> #include <sqlncli.h> #include <stdio.h> #include <cstdio> #include <string> #include <conio.h> using namespace MSXML; using namespace System; void GetConnected(unsigned char *conn) { HRESULT hr = S_OK; _RecordsetPtr pRstAuthors = NULL; hr = pRstAuthors.CreateInstance(__uuidof(Recordset)); if(FAILED(hr)) { printf("Failed creating record set instance"); return; } pRstAuthors.Open("SELECT * FROM LabOpsStatus",conn, adOpenStatic, adLockReadOnly,adCmdText); pRstAuthors.MoveFirst(); //Loop through the Record set if (!pRstAuthors.ADOEOF) { while(!pRstAuthors.ADOEOF) { printf("%s",pRstAuthors.Fields.GetItem("OBRESessionID").Value); printf("%s",pRstAuthors.Fields.GetItem("CurrentStep").Value); printf("%s",pRstAuthors.Fields.GetItem("Status").Value); //printf("%d - %sn",valField2,(LPCSTR)valField1); pRstAuthors.MoveNext(); } } CoUninitialize(); return; } void _tmain() { GetConnected((unsigned char *)"DRIVER={SQL Server};SERVER=(local);Database=labops;UID=sa;PWD=99ARCF1RE;Trusted_Connection=yes"); getch(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)