Passing Data error

Results 1 to 2 of 2

Thread: Passing Data error

  1. #1
    Join Date
    Dec 1969

    Default Passing Data error

    Hi, The following is my code, the problem is whenever i wish to pass the a array variable to my com object, it occurs an error says that:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)<BR>[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near &#039;=&#039;.<BR>/aristo/Scripts/QPreview.asp, line 22<BR><BR>However if the variable is not an array, then it works... please help! Thanks<BR><BR>&#039;****************************** ***************<BR>Set AristoObj = Server.CreateObject("prjAristo.clsAristo")<BR>retV =AristoObj.RemoveDuplicate(session("SelectedQuesti on"))<BR>AristoObj.OpenDatabase<BR><BR><BR>r = Split(retV, ",")<BR>key=2<BR><BR>For i = LBound(r) To UBound(r)<BR> response.write r(i) <BR> set objRS=AristoObj.SearchByPrimaryKey("Question", key)<BR><BR><BR> set RS=AristoObj.GetSingleQuestion(""& r(i) & "") &#060;-- here is the error<BR><BR><BR> if not RS.eof then<BR> response.write RS("Question")<BR> end if<BR> objRS.close<BR> set objRS=Nothing<BR> RS.close<BR> set RS=Nothing<BR>Next<BR>&#039;********************** ***********************

  2. #2
    Join Date
    Dec 1969

    Default Ok even though you posted this 3 times...

    First, looking at your code it appears you are passing a single value and not the entire array:<BR><BR> set RS=AristoObj.GetSingleQuestion(""& r(i) & "") <BR><BR>Next did you write the COM object? <BR><BR>If you did, you can obviously look at the GetSingleQuestion function and make sure it is defined properly. If someone else wrote it(i.e. - third-party component), I would suggest going to their website and/or check their documentation for code examples to determine if you are using correctly.<BR><BR>Pete

Posting Permissions

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