告訴你吧!絕對可以的! 在Uses 中加入 Wininetprocedure testonline; var I:integer; begin types:=internet_connection_modem+Internet_connection_lan+internet_connection_proxy; if internetgetconnectedState(@types,0) then showmessage('your pc is online!') else showmessage('your pc is offline!') end;
然后再连接
Ado.Connected := True
....
如果想通过插网线让数据库连结,不可能 :-(呵呵其实你可以在每次访问数据库的时候先ADO.connected:=true;这样你关它以前什么状态呢,反正我相连的时候你要是true :-)
如果出错的话就设置ado.connected为false
ado.connected:=true
else
ado.connected:=false;
ADOConnection.connected:=True;
在Uses 中加入 Wininetprocedure testonline;
var I:integer;
begin
types:=internet_connection_modem+Internet_connection_lan+internet_connection_proxy;
if internetgetconnectedState(@types,0) then
showmessage('your pc is online!')
else
showmessage('your pc is offline!')
end;
我是想让程序运行后就不用再管了。(不管网线断或通)
但现在断后又通时,程序就不再写数据到数据库中。
在except中用ado.connected:=true没有用
在写数据时直接用ado.connected:=true也没有用
我????