SAS/main.cpp
2022-07-03 18:22:02 +08:00

34 lines
866 B
C++

#import "c:\\Program Files\\Common Files\\System\\ado\\msado15.dll" no_namespace rename("EOF", "EndOfFile")
#include <stdio.h> // wprintf
#include <iostream>
#include <locale.h> // setlocale
#include <string>
#include<vector>
#include "DBCUtils.h"
#include "StudentDAO.h"
using namespace std;
//¸ß¼¶¹¦ÄÜ Ö±½ÓÊäÈësqlÓï¾ä
int main() {
setlocale(LC_ALL, "chs");
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
string pwd;
wprintf(L"Enter password:");
getline(cin, pwd);
_ConnectionPtr pconnect(_uuidof(Connection));
if (getConnection(pwd, pconnect)) {
try {
}catch (_com_error& err) {
wprintf(L"The application throws the error: %s\n", (wchar_t*)err.ErrorMessage());
wprintf(L"Description = %s\n", (wchar_t*)err.Description());
}
}
CoUninitialize();
return 0;
}