error using variable into query

  • This query is constructed into entreprise manager by insert of tables graphically, and returns correct result into manager, not into vb-script:

    strSQL = " SELECT dbo.Gruppe.navn AS Expr1, * " &_ "FROM Hovedtabel INNER JOIN " &_ " dbo.Ejer ON Hovedtabel.id = dbo.Ejer.id INNER JOIN " &_ " dbo.Leverandor ON Hovedtabel.id = dbo.Leverandor.Id INNER JOIN " &_ " dbo.Notat ON Hovedtabel.id = dbo.Notat.Id INNER JOIN " &_ " dbo.Opslag ON Hovedtabel.id = dbo.Opslag.id INNER JOIN " &_ " dbo.Placering ON dbo.Opslag.id = dbo.Placering.placering CROSS JOIN " &_ " dbo.Gruppe CROSS JOIN " &_ " dbo.Anvendelse CROSS JOIN " &_ " dbo.Undergruppe CROSS JOIN " &_ " dbo.Ops_overvkt CROSS JOIN " &_ " dbo.Ops_undervkt " &_ " WHERE dbo.Gruppe.navn = MultiGroove"

    The fault it returns are: Microsoft OLE DB Provider for SQL Server fejl '80040e14'

    Invalid column name 'MultiGroove'.

    /plvktsys/DB_IO/xml_vkt_m_querystring.asp, line 74

    Multgroove is not a Column, but object into column navn at table Gruppe.

    I would like to have an variable instead of Multigroove into the WHERE clause, but are not allowed to use a such, what is the syntax?

    If i use just one of 3 tables more, the result is zero, hve tried buth inner join and croosjoins on them. The tables are different, so it's not a special sort of table.

    Any ideas? 

  • use  'MultiGroove'




    My Blog: http://dineshasanka.spaces.live.com/

  • if I try this : 'Multigroove' = Gruppe.navn " it gives 1152 records returned. i'm not sure it's correct, but i cannot find out, because in the lines:

    Do While Not (oRs.EOF or oRs.BOF) AND NOT Crit_Error

    RStr = RStr & oRs / this line gives error

    Response.Write oRs(0).Name & ": " & oRs(0).Value & ": " & oRs(1).Name & ": " & oRs(1).Value

    oRs.MoveNext

    Loop

    I get a types mismatch error , microsoft VBScript error '800a000d'

    Why?

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply