返回列表 发布新帖
楼主: 张硕御月

电脑基础知识大全

 楼主| 发表于 2011-10-31 14:59:01 | 查看全部
87,Q:Asp 中无 DSN 法连接 SQL Server 数据库的方法及其注意问题
A:无 DSN 法连接 SQL Server 数据库的方法示例如下:
'Less-DSN 法连接 SQLServer 服务器
set conn=server.createObject("adodb.connection")
conn.Open "driver={SQL Server};server=mysqlserver; database=jspcs; uid=sa;
pwd=sql"
其中服务器名为 mysqlserver(ip=192.168.0.1),数据库为 jspcs,用户名为 sa,口令为 sql。由于使用了 TCP/IP
协议,所以 server=mysqlserver 语句段还可以写成指向安装 SQL Server 的机器的 IP 地址,即
server=192.168.0.1,注意该 IP 地址必须是网卡的默认(基本) IP 地址。同时,如果在 Client 端设置 SQL Server
ODBC,也可以把服务器名输成 SQL Server 的 IP 地址。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-10-31 14:59:12 | 查看全部
88,Qelphi 中判断系统是否已经安装了声卡
A:要判断系统是否安装了声卡,调用 Winmm.dll 中的 waveOutGetNumDevs 和 midiOutGetNumDevs
函数就可以了。这两个函数在 Var 部分的说明如下:
function waveOutGetNumDevs: longint; stdcall; external 'winmm.dll' name
'waveOutGetNumDevs';
function midiOutGetNumDevs: longint; stdcall; external 'winmm.dll' name
'midiOutGetNumDevs';
//判断声卡是否存在
Function IsSoundcardInstalled : Boolean;
Var
WaveOutPutDeviceCount : Integer;
MidiOutPutDeviceCount : Integer;
Begin
Result := False;
WaveOutPutDeviceCount := waveOutGetNumDevs;
MidiOutPutDeviceCount := midiOutGetNumDevs;
if (WaveOutPutDeviceCount>0) and (MidiOutPutDeviceCount>0) Then
  Result := True
Else
  Result := False;
End;

procedure TForm1.Button1Click(Sender: TObject);
Begin
if IsSoundcardInstalled Then
  ShowMessage('系统已经安装了声卡.')
Else
  ShowMessage('系统没有安装声卡.');
end;
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-10-31 14:59:21 | 查看全部
89,Q:用 ASP 打开 Web 服务器上的应用程序
A:
<%
dim wsh
set wsh = createobject("WScript.Shell")
response.write wsh.run("command.com")
set wsh = nothing
%>
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号
QQ会员群

Copyright © 2021-2025 中企互动平台 版权所有 All Rights Reserved.

相关侵权、举报、投诉及建议等,请发 E-mail:bztdxxl@vip.sina.com

Powered by Discuz! X3.5|京ICP备10020731号-1|京公网安备 11010102001080号

关灯 在本版发帖
扫一扫添加管理员微信
返回顶部
快速回复 返回顶部 返回列表