ASP - Creating a simple 'SELECT' functio

Results 1 to 2 of 2

Thread: ASP - Creating a simple 'SELECT' functio

  1. #1
    Join Date
    Dec 1969

    Default ASP - Creating a simple 'SELECT' functio

    Hey, a bit of a Newbie question here ... so stick with me ...<BR>Ok. I have a page, with a form, and a button on the form. This button performs:<BR> &#060;SCRIPT Language = "VBScript"&#062;<BR> &#060;!--<BR> Sub btnSearch_OnClick()<BR> Dim docID, revision<BR> Dim arrRecord<BR> docID = InputBox("Please enter a document id to search for:", 1, "Search Database")<BR> revision = InputBox("Please enter the Revision number for document " & docID & ".", 1, "Search Database")<BR> arrRecord = doSearch( docID, revision )<BR> MsgBox( arrRecord(0) )<BR> <BR>End Sub<BR>--&#062;<BR>&#060;/SCRIPT&#062;<BR><BR>This is run no problem ... up &#039;till the function call: doSearch. The doSearch() function is written in server-side script at the top of the page:<BR> &#060;%<BR> Function doSearch( aDoc, aRevision )<BR> set qrySearch = Server.CreateObject("ADODB.Recordset")<BR> qrySearch.ActiveConnection = MM_TestDocument_STRING<BR> qrySearch.Source = "SELECT * FROM dbo.Product WHERE ID = &#039;" & Cstr(aDoc) & "&#039; AND Revision = " & Cint(aRevision)<BR><BR> qrySearch.Open()<BR> <BR> Dim arrSearchResult<BR> arrSearchResult = qrySearch.GetRows()<BR> &#039;Response.Write(arrSearchResult(0))<BR> End Function<BR> %&#062;<BR> The table (dbo.Product) (SQL Server 2000) that the information is being retrieved from has variable types: ID(varchar), and Revision(int).<BR> Now the problem, when I run the page,I will be able to enter the InputBoxes - but after this I get the Internet Explorer error:<BR>-----------------<BR>Line: 14 (I know this part isn&#039;t helpful)<BR>Char: 2<BR>Error: Type Mismatch: &#039;doSearch&#039;<BR>Code: 0<BR>-----------------<BR> So?? Thnx.<BR><BR>G.J.

  2. #2
    Join Date
    Dec 1969

    Default first you really need to read<BR><BR>I think you now the anser then....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts