我的asp.net程序在Visual Web Developer 2005 Express Edition下编译后用系统自带的Asp.net Development Server下调试运行正常,但是在IIS 5.1下就出错,捕获的错误提示为“无效的过程调用或参数”。
系统说明:
开发平台是:winxp sp2 + Sql 2000 + Visual 2005 + IIS 5.1;
在asp.net项目中调用原系统VB编译的一个dll文件,函数名为FindMeByUserName(ByVal strUserName As String);具体代码如下:
//---------------------------------------------------------
Public Function FindMeByUserName(ByVal strUserName As String)
On Err GoTo Err_FindMeByUserName
objErr.ErrorLog "Cls_用户 ", "FindMeByUserName ", "请求开始 ", "Null "
Dim rs As New ADODB.Recordset
Dim strSql As String
strSql = "SELECT * FROM TB_用户 WHERE 用户名= " & " ' " & strUserName & " ' "
' ' ' & " AND 删除标志 <> 1 "
rs.Open strSql, g.Cn, adOpenKeyset, adLockOptimistic '执行
mCopyProperties rs
Exit Function
Err_FindMeByUserName:
objErr.ErrorLog "Cls_用户 ", "FindMeByUserName ", "内部错误: ", Err.Description
End Function
//---------------------------------------------------------
在asp.net(C#)下的调用:
//--------------------------------------------------------------- webyingping.Cls_Main objMain = new webyingping.Cls_Main();
YingPing.Cls_用户 obj用户 = new YingPing.Cls_用户();
protected void BtnSubmit_Click(object sender, EventArgs e)
{
string name = this.txtUsername.Text.Trim();
string psw = this.txtPassword.Text.Trim();
try
{
obj用户.FindMeByUserName( name);
}
catch(Exception se)
{
objMain.ShowMessage(se.Message,Response);
objMain.ShowMessage( "错误: "+name, Response);
}
}
//---------------------------------------------------------------
在这个地址下调试是无错误的,http://localhost:1055/WebYingPingV1.2/login.aspx