<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={Microsoft Excel Driver (*.xls)};ReadOnly=0;DBQ=" & Server.MapPath("emapgo.xls")
SQL1="select * from [sheet1$]"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open SQL1, conn, 3, 3
curDir = Server.MapPath("../Data/EMGWebMapCommision.mdb")
Set conn1 = Server.CreateObject("ADODB.Connection")
conn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curDir
Set rs1 = Server.CreateObject("ADODB.Recordset")
Set rs1.ActiveConnection = conn1
rs1.Source = "select * from MapCommision"
rs1.CursorType = 3 ' adOpenKeyset
rs1.LockType = 3 'adLockOptimistic
rs1.Open
Do While Not rs.Eof
rs1.AddNew
rs1(0)=j......................................................................第十二行
for i=0 to rs.Fields.Count-1
rs1(i)=Trim(rs(i))
Next
rs1.Update
rs.MoveNext
j=j+1
Loop
rs.Close
rs1.Close
conn.Close
conn1.Close
Set rs=nothing
Set conn=nothing
%>
错误类型:
Microsoft JET Database Engine (0x80040E21)
试图将 Null 值赋予一个非 Variant 数据类型的变量。
/asp/WebMap/Admin/Excel.asp, 第 22 行