親愛的親們都在這裏程序員,即時通訊在這裏全新的,我可能不知道如何正確的問題在這裏..ASP ADO連接Microsoft VBScript運行時錯誤「800a01a8」
如果我可以尋求幫助,你可以在這裏在這裏這裏... 即時通訊問題與簡單的asp與oop結構...
幫助我功能savedata請。在運行時,
call savedata("insert","test_","name, id","lalala, 222","User_ID=3")
遇到錯誤:
INSERT INTO TEST_(姓名,身份證)VALUES(LALALA,222)
... Microsoft VBScript運行時錯誤 '800a01a8'
對象要求:'康恩'
<%
function declare_conn(sql,atr)
dim conn, conn_
set conn = Server.CreateObject("ADODB.Connection")
conn = Connect()
set conn_ = Server.CreateObject("ADODB.Recordset")
strConnect = _T("Driver={MySQL ODBC 3.51 Driver};Server=localhost;"
"Database=MyDatabase;User=MyUserName;Password=MyPassword;Option=4;");
if Cstr(atr)="open" then
conn_.CursorLocation = adUseClient
conn_.Open sql, conn, 3, 2
set conn_.ActiveConnection = nothing
set declare_conn=conn_
else if Cstr(atr)="exec" then
conn.Open
conn.Execute sql
end if
end if
end function
function calldata(a,b,c,d)
dim conn_string, sql_string
if c<>"" and d<>"" then
sql_string="SELECT "&Cstr(a)&" FROM "&Cstr(b)&" WHERE "&Cstr(c)&" = '"&Cstr(d)&"'"
response.write(sql_string)
else
sql_string="SELECT "&Cstr(a)&" FROM "&Cstr(b)
response.write(sql_string)
end if
set conn_string = Server.CreateObject("ADODB.Recordset")
set conn_string = declare_conn(sql_string,"open")
set calldata = conn_string
end function
function savedata(a,b,c,d,e)
dim conn_string, sql_string, c_, d_, update_string
update_string = ""
if Cstr(a)="insert" then
sql_string="INSERT INTO "&Cstr(b)&" ("&Cstr(c)&") VALUES ("&Cstr(d)&")"
end if
response.write(sql_string)
'response.end
if Cstr(a)="update" then
c_ = split(c,", ",-1)
d_ = split(d,", ",-1)
response.write(c_)
response.end
if ubound(c_) = ubound(d_) then
do while not c_.eof
update_string=update_string&"("&Cstr(c_)&"="&Cstr(d_)&"),"
c_.MoveNext : d_.MoveNext
loop
else
%><script type="text/javascript">alert("save function error: array out of bound");</script> <%
end if
if Cstr(e)<>"" then
sql_string="UPDATE "&Cstr(b)&" SET "&update_string&" WHERE "&Cstr(e)
else
sql_string="UPDATE "&Cstr(b)&" SET "&update_string
end if
end if
'set conn_string = Server.CreateObject("ADODB.Recordset")
call declare_conn(sql_string,"exec")
end function
%>
這是錯誤的實際上是什麼意思?我創建
connect()
數據庫ADO連接不過,我可以毫無問題的
calldata()
編輯 - dwerty_weird
遺憾的運行騷動......
對於這個問題,我發現,我謂失蹤「集」:
set conn=Connect()
遺憾的麻煩,但是對於其他的問題,我與有問題
call savedata("update","test_","name, id","'lalala', 222","bil=1")
它會得到錯誤: Microsoft VBScript運行時錯誤 '800a01a8' 所需的對象 /bkpi-msn/SPPro/function.asp 56行 -
任何人都可以幫我?
對於這個問題,我發現,我謂失蹤「集」: 組參數conn =連接() 遺憾的麻煩... 但對於其他問題,我有問題與 呼叫SAVEDATA( 「更新」, 「測試_」, 「姓名,身份證」, 「 'LALALA',222」, 「BIL = 1」) 它會得到錯誤: Microsoft VBScript運行時錯誤 '800a01a8' 需要物體 /b kpi-msn/SPPro/function.asp,第56行 –