1
Microsoft Visual C++ 2008 Express Edition을 사용하고 있습니다.SQLAPI ++로 MVC++ 연결
SQL API 웹 사이트 [http://www.sqlapi.com/index.html]를 따랐습니다.
내가 SqlApi ++ 설치했지만하지만 내 컴파일러 내가 뭘 잘못 #include <SQLAPI.h>
을 감지되지 않는 이유는 무엇입니까?
이
내 코드입니다 :#include <stdio.h> // for printf
#include <SQLAPI.h> // main SQLAPI++ header
int main(int argc, char* argv[])
{
SAConnection con; // create connection object
try
{
// connect to database
// in this example it is Oracle,
// but can also be Sybase, Informix, DB2
// SQLServer, InterBase, SQLBase and ODBC
con.Connect(
"test", // database name
"tester", // user name
"tester", // password
SA_Oracle_Client);
printf("We are connected!\n");
// Disconnect is optional
// autodisconnect will ocur in destructor if needed
con.Disconnect();
printf("We are disconnected!\n");
}
catch(SAException &x)
{
// SAConnection::Rollback()
// can also throw an exception
// (if a network error for example),
// we will be ready
try
{
// on error rollback changes
con.Rollback();
}
catch(SAException &)
{
}
// print error message
printf("%s\n", (const char*)x.ErrText());
}
return 0;
}
@Seril 나는 이것을하고 있습니다. 그리고 요점은 that.now입니다. 데이터베이스와 테이블을 확인하기 위해 sqlApI를 열어야합니다. 아래에서 아무 것도 볼 수 없습니다. 우리는 sqlserver 2005에서와 똑같이하고 싶습니다. sqlApi가이 옵션을 제공해야합니다. – user1118700
@seril 변경 사항을 적용했습니다. 이제 컴파일러는 헤더 파일을 감지 할 수 있습니다. 이제이 con.Connect ( " 테스트 ", // 데이터베이스 이름 "테스터 ", // 사용자 이름 "테스터 ", // 암호 SA_Oracle_Client); 에 문제가 있습니다. 내 sqlapi를 열고 나서 새 데이터베이스를 작성해야한다고 가정합니다. work.can을 사용하면 어떻게 처리할까요? – user1118700