-
Creating a Recordset
Why won't this allow me to create a recordset? Am I opening it in-correctly?
The Error I get is 'ADODB.Field error '800a0cb3'"
Object or provider is not capable of performing requested operation.
/ProjectMangement2/SaveCompany.asp, line 43
The purpose is to build a recordset and pass it into a DLL to be saved as
a record in the Database.
DIM saveRst, getRst, Comp 'Objects
DIM ctr 'Counter
DIM Info 'String
SET saveRst = Server.CreateObject("ADODB.Recordset")
SET getRst = Server.CreateObject("ADODB.Recordset")
SET Comp = Server.CreateObject("GSIDataAccess.clsCompany")
SET getRst = Comp.GetCompany(0) 'Get recordset Template
IF getRst.State = adStateClosed then
Response.Write "Get Recordset Closed"
ELSE
Response.Write " Get Recordset Open"
END IF
'Build Recordset out of Existing Recordset
FOR CTR = 0 TO getRst.Fields.Count -1
saveRst.Fields.Append getRst.Fields(ctr).Name,getRst.Fields(ctr).Type,
getRst.Fields(ctr).DefinedSize , getRst.Fields(ctr).Attributes
Response.Write saveRst.Fields(ctr).Name & "<BR>"
NEXT
saveRst.Open
IF saveRst.State = adStateClosed THEN
Response.Write "Recordset Closed"
Response.End
ELSE
Response.Write "Recordset Open"
END IF
'Add the records to the save Recordset
saveRst.AddNew
FOR ctr = 0 TO getRst.Fields.Count -1
IF UCASE(getRst.Fields(ctr).Name) = "COM_INACTIVE" THEN
IF UCASE(Request(getRst.Fields(ctr).Name)) = "CHECKED" THEN
getRst.Fields(ctr).Value = DATE
ELSE
getRst.Fields(ctr).Value = NULL
END IF
ELSE
'This is line 43
getRst.Fields(ctr).Value = Request(getRst.Fields(ctr).Name)
END IF
NEXT
'Pass the save recordset into method.
info = Comp.SaveCompany(saveRst)
IF info = "" THEN
Response.Write "Good Save"
ELSE
Response.Write "Bad Save"
END IF
Thank you
Scott
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|