建立臨時表的問題
Public Function CreateTempTable() As ObjectDim Table_Field As String
On Error GoTo ErrHandle
If Rpts Is Nothing Then
Set Rpts = CreateObject("RptServer.Service")
End If
Set RptRecordset = Rpts.CreateDestRst '要寫入的recordset
Table_Field = "ReportName varchar(10),sc_odno varchar(15),type varchar(6),sc_odnol varchar(15),sc_odnoh varchar(15)," & _
"el_no varchar(25),el_name varchar(30),size varchar(65),ET varchar(65),hole varchar(65),PCD varchar(65),hole_no varchar(65)," & _
"sc_qty number,od_qty number,color varchar(65),MO_M varchar(22),MO_MD varchar(22),MO_MD1 varchar(22),MO_MD2 varchar(22),MO_MC varchar(60),MS varchar(25),MS1 varchar(25),MS2 varchar(25),MC varchar(25),MC1 varchar(25),MC2 varchar(25),MC3 varchar(25),MC4 varchar(25),MD varchar(25),UAY varchar(25),MEE varchar(25)," & _
"sc_fdat varchar(12),cu_na varchar(22),ttype varchar(10),tsize varchar(30),aarim varchar(30),tet varchar(30),el_name1 varchar(25),el_name2 varchar(25),el_name3 varchar(25)," & _
"tpcd varchar(30),thole varchar(30),tcenter varchar(30),tprocess varchar(10),tcolor varchar(30),cu_elno varchar(22),cu_name varchar(50),prn_times number"
'以此Function先去建立TempTable給Asp中先行測試Connect是否會成功
hdlCUSC_P03 = RptRecordset.CreateStruct(Table_Field, "", "cusc_p03")
Set CreateTempTable = RptRecordset.Connection
Exit Function
ErrHandle:
Err.Raise Err.Number, "CreateTempTable", Err.Description
End Function
才學VB不知道哪時有問題,在自己電腦上按執行可順利通過,但把程序放到編譯的機器上執行時 執行到
'以此Function先去建立TempTable給Asp中先行測試Connect是否會成功
hdlCUSC_P03 = RptRecordset.CreateStruct(Table_Field, "", "cusc_p03")
就提示 [MICROSOFT][ODBC SQL Server][SQL Server]陳述式無法准備
請問這是什麼原因??
补充:VB , 基础类