Microsoft VBScript runtime error (0x800A01A8)
Missing object :''
The reason is that I didn't define the global variable when calling the function. The Starting program is like this. B _connect.asp file code is as follows.
Sub open_bbs ()
Set sqlrs = server. CreateObject ("adodb. recordset ")
Set sqlcn = server. createobject ("adodb. connection ")
Sqlconstr = "driver = {SQL server}; server = 5555555; uid = cdd3; pwd = dd0; database = cwddd3_db"
Sqlcn. open sqlconstr
End sub
Call code:
<%
B _ SQL = "select * from bbs_lm order by bbs_lm_order asc"
Call Open_bbs ()
Sqlrs. open B _ SQL, sqlcn, 1, 1
Do while not sqlrs. eof
%>
The following error message is displayed: Error type:
Microsoft VBScript runtime error (0x800A01A8)
Missing object :''
/Gero/bbs/index. asp, row 3
Browser type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon)
Webpage:
GET/gero/bbs/index. asp
After careful viewing, find the reason is open_bbs ()
Dim sqlrs, sqlcn // add here.
Sub open_bbs ()
Set sqlrs = server. CreateObject ("adodb. recordset ")
Set sqlcn = server. createobject ("adodb. connection ")
Sqlconstr = "driver = {SQL server}; server = 218.30.99.21; uid = cw58013; pwd = m9n6u3e0; database = cw58013_db"
Sqlcn. open sqlconstr
End sub
========================================================== ==========