日期:2014-05-17  浏览次数:21211 次

VB我一点不会用.我封装了数据库连接.但在asp里不会调用了.明白人帮我一把.谢谢
1.VB里封装成:shou.dll  

Public   Function   DBConn()

Dim   conn,   connstr,   db,   rs,   rs_s,   rs_s1
Dim   strSQLServerName
Dim   strSQLDBUserName
Dim   strSQLDBPassword
Dim   strSQLDBName

strSQLServerName   =   "21.122.33.112 "
strSQLDBUserName   =   "shouji "
strSQLDBPassword   =   "123456 "
strSQLDBName   =   "shouji "

Set   conn   =   Server.CreateObject( "ADODB.Connection ")
connstr   =   "Provider=SQLOLEDB.1;Persist   Security   Info=False;Server= "   &   strSQLServerName   &   ";User   ID= "   &   strSQLDBUserName   &   ";Password= "   &   strSQLDBPassword   &   ";Database= "   &   strSQLDBName   &   "; "
conn.open   connstr

DBConn   =   conn
End   Function


2.在asp里调用.

<%
Set   ObjReference   =   Server.CreateObject( "shouji.Class1 ")
%>

错误类型:
ADODB.Recordset   (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/sj/chkuser.asp,   第   21   行


第21行是:
rs.Open   "select   *   from   [sjuser]   where   username88= ' "&username88& " '   and   userpassword88= ' "&userpassword88& " ' ",conn,1,3


怎么修改啊.



------解决方案--------------------
1.VB里封装成:shou.dll

Public Function DBConn()

Dim conn, connstr, db, rs, rs_s, rs_s1
Dim strSQLServerName
Dim strSQLDBUserName
Dim strSQLDBPassword
Dim strSQLDBName

strSQLServerName = "21.122.33.112 "
strSQLDBUserName = "shouji "
strSQLDBPassword = "123456 "
strSQLDBName = "shouji "

Set conn = CreateObject( "ADODB.Connection ")
connstr = "Provider=SQLOLEDB.1;Persist Security Info=False;Server= " & strSQLServerName & ";User ID= " & strSQLDBUserName & ";Password= " & strSQLDBPassword & ";Database= " & strSQLDBName & "; "
conn.open connstr

DBConn = conn
End Function


2.在asp里调用.

<%
Set ObjReference = Server.CreateObject( "shouji.Class1 ")
%>
------解决方案--------------------
Public Function DBConn()

Dim conn, connstr, db, rs, rs_s, rs_s1
Dim strSQLServerName
Dim strSQLDBUserName
Dim strSQLDBPassword
Dim strSQLDBName

strSQLServerName = "21.122.33.112 "
strSQLDBUserName = "shouji "
strSQLDBPassword = "123456 "
strSQLDBName = "shouji "

Set conn = CreateObject( "ADODB.Connection ")
connstr = "Provider=SQLOLEDB.1;Persist Security Info=False;Server= " & strSQLServerName & ";User ID= " & strSQLDBUserName & ";Password= " & strSQLDBPassword & ";Database= " & strSQLDBName & "; "
conn.open connstr

Set DBConn = conn
End Function


<%dim conn
Set ObjReference = Server.CreateObject( "shouji.Class1 ")
set conn=ObjRefer