Login | |
|
 |
visual basic script runtime error - 2/16/2005 4:46:08 AM
|
|
 |
|
| |
zahid_a
Posts: 14
Score: 0
Joined: 2/16/2005
From: Canada
Status: offline
|
hi... i have the following code when run gives me Microsoft VBScript runtime error '800a000d' Type mismatch. the error is on line 35; i have worked on it for one week now..but cannot figure out the error... any help will be much appreciated.... Line 35 is bold... <% OPTION EXPLICIT %> <!-- #INCLUDE FILE = 'connection.asp' --> <!-- METADATA TYPE = "typelib" FILE = "C:\Program Files\Common Files\System\ado\msado15.dll" --> <HTML> <HEAD> </HEAD> <BODY> <% Dim objRS, strFolder, objCommand, strtemp Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open "mix", Conn, adOpenForwardOnly, adLockReadOnly, adCmdTable strFolder = Request.Form("FOLDER") Set objCommand = Server.CreateObject("ADODB.Command") objCommand.ActiveConnection = Conn objCommand.CommandText = "SELECT Folder, SeeAlso, FileSummary, subcontent FROM mix WHERE Folder LIKE '%" & strFolder & "%'" objCommand.CommandType = adCmdText Set objRS = objCommand.Execute strtemp =objRS("Folder") While Not objRS.EOF Response.Write "Folder: " & objRS("Folder") & "<br>" Response.Write "See Also: " & objRS("SeeAlso") & "<br>" Response.Write "File Summary: " & objRS("FileSummary") & "<br>" While objRS("Folder") = strtemp Response.Write "Subcontents: " & objRS("subcontent") & "<br>" objRS.MoveNext If objRS.EOF = True Then Set objRS = Nothing Else End If Wend Wend objRS.CLOSE Set objRS = Nothing %> </body> </html>
_____________________________
zahid
|
|
| |
|
|
|
 |
Re: visual basic script runtime error - 2/17/2005 4:12:30 AM
|
|
 |
|
| |
zahid_a
Posts: 14
Score: 0
Joined: 2/16/2005
From: Canada
Status: offline
|
hi... well i realized that the error is not on the line that i had previously mentioned. its on the line after it(bold line in the code below). the database has a one to many relationship and i want to display it in the manner as it is in access. each folder contains many subcontents and thats why i am evaluating the While objRS("Folder") = strtemp is there another way i could check and print out subcontents while the folder name remains the same. thanks... <% OPTION EXPLICIT %> <!-- #INCLUDE FILE = 'connection.asp' --> <!-- METADATA TYPE = "typelib" FILE = "C:\Program Files\Common Files\System\ado\msado15.dll" --> <HTML> <HEAD> </HEAD> <BODY> <% Dim objRS, strFolder, objCommand, strtemp Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open "mix", Conn, adOpenForwardOnly, adLockReadOnly, adCmdTable strFolder = Request.Form("FOLDER") Set objCommand = Server.CreateObject("ADODB.Command") objCommand.ActiveConnection = Conn objCommand.CommandText = "SELECT Folder, SeeAlso, FileSummary, subcontent FROM mix WHERE Folder LIKE '%" & strFolder & "%'" objCommand.CommandType = adCmdText Set objRS = objCommand.Execute strtemp =objRS("Folder") While Not objRS.EOF Response.Write "Folder: " & objRS("Folder") & "<br>" Response.Write "See Also: " & objRS("SeeAlso") & "<br>" Response.Write "File Summary: " & objRS("FileSummary") & "<br>" While objRS("Folder") = strtemp Response.Write "Subcontents: " & objRS("subcontent") & "<br>" objRS.MoveNext If objRS.EOF = True Then Set objRS = Nothing Else End If Wend Wend objRS.CLOSE Set objRS = Nothing %> </body> </html>
|
|
| |
|
|
|
 |
Re: visual basic script runtime error - 2/22/2005 6:10:32 AM
|
|
 |
|
| |
zahid_a
Posts: 14
Score: 0
Joined: 2/16/2005
From: Canada
Status: offline
|
This was my solution... <% OPTION EXPLICIT %> <!-- METADATA TYPE = "typelib" FILE = "C:\Program Files\Common Files\System\ado\msado15.dll" --> <HTML> <HEAD> <TITLE> TRYING THE SHAPE & APPEND </TITLE> </HEAD> <BODY> <% Dim strSQL, objRS, objChild, strConnection, strFolder, inti inti = 0 strFolder = Request.Form("FOLDER") strConnection = "Provider=MSDataShape;dsn=vertical;database=vertical final.mdb" strSQL = "SHAPE { SELECT folder, FileSummary, SeeAlso FROM folder WHERE folder LIKE '%" & strFolder & "%' ORDER BY folder}" & _ "APPEND ({ SELECT folder, subcontent FROM subcontents WHERE folder LIKE '%" & strFolder & "%' ORDER BY folder} AS Test RELATE folder to folder)" Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open strSQL, strConnection Set objChild = Server.CreateObject("ADODB.Recordset") objChild.Open "subcontents", strConnection, adOpenStatic, adLockReadOnly, adCmdTable While Not objRS.EOF Response.Write "<B>" & "Folder: " & "</B>" & objRS("folder") & "<BR>" Response.Write "<B>" & "File Summary: " & "</b>" & objRS("FileSummary") & "<BR>" Response.Write "<B>" & "See Also: " & "</b>" & objRS("SeeAlso") & "<BR>" Response.Write "<B>" & "Subcontents: " & "</b>" & "<BR>" Set objChild = objRS.Fields("Test").Value While Not objChild.EOF Response.Write " " & " " & " " & " " & objChild("subcontent") Response.Write "<br>" objChild.MoveNext Wend Response.Write "<br>" Response.Write "<hr>" inti = inti + 1 objRS.MoveNext Wend Response.Write "There are " & inti & " records on this page." objRS.Close Set objRS = Nothing %> </BODY> </HTML>
|
|
| |
|
|
|
| |
|
|
 |
|
 |
|
|