服务器有一自写组件,功能很简单,就是从ORACLE中根据户号检索出户名,
当我在程序中调用时,要8秒钟才能出结果,而如果把DLL中的代码转移到主程序代码中,却很快就检索到结果了。
组件没有问题的,因为在别的机子上调用也很快,这是什么原因啊?!

解决方案 »

  1.   

    编译好的DLL,怎么调试啊,我怀疑是系统问题,因为在别的机子上都很快的
    但我不想重装系统啊,好多配置的,而且服务器还没光驱,晕死
      

  2.   

    以下就是我的DLL中的检索函数,
    Public Function Run(ByVal nbh As String, Optional kh_mc As String) As String
    Dim rsA As New ADODB.Recordset
    Dim Fso As New FileSystemObject
    Dim Ts As TextStream
    Dim Filestring As String
    Set Ts = Fso.OpenTextFile(App.Path & "\comlog.txt", ForWriting, False)
    Ts.Write "conn开始:" & Now & vbCrLfSet ConnMain = New ADODB.Connection
    ConnMain.Open P_ADOConnOracle
    Ts.Write "conn完成:" & Now & vbCrLfrsA.Open "select khmc from yd_yhzl where bh='" & nbh & "'", ConnMain, adOpenStatic
    Ts.Write "select完成:" & Now & vbCrLfkh_mc = rsA!khmc
    Ts.Write "赋值完成:" & Now & vbCrLfEnd Function以下是LOG文件的内容:
    conn开始:2004-3-30 19:35:59
    conn完成:2004-3-30 19:36:03
    select完成:2004-3-30 19:36:05
    赋值完成:2004-3-30 19:36:06而我如果在别的机子上执行,只要不到半秒就出结果了
    服务器调用DLL出了什么问题啊!