Home > Software engineering >  Help: how to detect MSSQL database in MFC project status, and delete database connection, to connect
Help: how to detect MSSQL database in MFC project status, and delete database connection, to connect

Time:11-18

Excuse me each great god, and how to detect MSSQL database in MFC project status, and delete database connection, to connect to the database and so on, the beginner database operation, if the problem is too idiot please understand

CodePudding user response:

Baidu links to c + + mysql instance many ah, testing database link equipment using mysql_ping function, my version is 5.7

CodePudding user response:

reference 1/f, to be continued _1006 response:
baidu links to c + + mysql, instance a lot of ah, testing database link equipment using mysql_ping function ah, my version is 5.7

My MFC program database connection is Microsoft SQL Server2012, I am in the ontimer state is used to judge the state of the database connection,
If (m_pConnection - & gt; State==adStateClosed), but didn't work, to detect the State has always been adStateOpen (even if stop SQL server), I don't know what reason?

CodePudding user response:

I used to do a project, used a stupid way: direct TcpConnect corresponding server IP and port number. If not, you think database service hung up the... When my application is written to a remote database, but requires a fixed period of time intervals, to confirm whether the database state OK. Don't know whether I like you demand?