Hey guys! I'm a beginner in ASP and I'm trying to figure out what this scripting language can give me, so I tried to develop a little web app. Here's my problem.
I'm just trying to access the sql server database to do some web base reporting but this bull-**** error always hinder me from looking at the result of my report.
"ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."
this is my code
Set objRS1=Server.CreateObject("ADODB.Recordset")objRS1.ActiveConnection=OpConn
objRS1.CursorType = adOpenKeyset
objRS1.LockType = adLockOptimistic
objRS1.Open strSQL <======THIS IS WHERE THE ERROR OCCURS
Number = objRS1.RecordCount
IF NOT objRS1.EOF THEN
objRS1.MoveFirst
ScriptName = request.servervariables("ScriptName")
Response.write "<TABLE WIDTH=""100%""><TR><TD><font size=1>"
response.write "Showing page <b>" & CurrentPage & "</b> of <b>" & TotalPages & "</b>: Entries " & NumPerPageOf & " - " & NumPerPageTo & " of <b>" & Number & "</b> Records...<br>"
Response.write "</font></TD><TD align=right>"
Response.Write "</TD></TR></TABLE>"
Response.Write ("<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=1 WIDTH=""100%""><TR>")
FOR i=0 to objRS1.fields.count-1
fname = objRS1.fields(i).Name
Response.Write ("<TH class=Header align=center><FONT SIZE=2 COLOR=white>")
Response.Write fname & "</a></FONT></TH>"
NEXT
Response.Write ("</TR>")
'This will display the field contents
WHILE NOT objRS1.EOF
count = count + 1
IF strClass = "odd" THEN
strClass = "even"
ELSE
strClass = "odd"
END IF
Response.Write ("<TR>")
FOR i=0 TO objRS1.fields.count-1
ThisRecord = objRS1(i)
IF isNull(ThisRecord) THEN
ThisRecord = " "
END IF
Response.Write ("<td valign=top CLASS=" & strClass & ">")
Response.Write ThisRecord
Response.Write ("</td>")
NEXT
Response.Write ("</TR>")
objRS1.MoveNext
WEND
Response.Write ("</TABLE>")
objRs1.close
Set objRs1 = NOTHING
END IF
The connection string is located in a separate ASP file which was included in this particular page. I already included the ADOVBS.INC and still receive the error. I also tried referencing ADO 2.7 in the PROJECTS --> REFERENCES but it didn't work too. I don't know what's going on? Please help me!!! Thanks in advance!






Bookmarks