Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Wrox Announcements and Feedback > Wrox Book Feedback
|
Wrox Book Feedback A forum to submit feedback on Wrox books if other forums on P2P have been unable to address your book-specific needs. IF YOU ARE LOOKING FOR CODE DO NOT ASK "Where can I find the code for this book?" That question is answered here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Wrox Book Feedback section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 30th, 2004, 06:24 PM
Registered User
 
Join Date: Apr 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Syntax error (missing operator) in query expressio

This is part of the code. Error "Syntax error (missing operator) in query expression" is coming in the mentioned error line . When i am trying to print the value retrieved by the query its right. Even the other similar queries are working . I dont understand whats wrong with string 'strgc'. Please help.
In other part of code, same problem sometimes come with strfa,strec also but sometimes it works fine. Please help.


Dim get1 As New OleDbCommand(query1, myconnection)
                myreader = get1.ExecuteReader()
                While (myreader.Read())
                    rownew("RecordID") = myreader(0)
                    rownew("FundAgencyID") = myreader(1)
                    rownew("EngineeringID") = myreader(2)
                    rownew("GeotechCoID") = myreader(3)
                    rownew("DrillingCoID") = myreader(4)
                    rownew("ProjectNameID") = myreader(5)
                    rownew("HoleID") = myreader(6)
                    rownew("ReportNo") = myreader(7)
                    rownew("ContractNo") = myreader(8)
                    rownew("GeofileNo") = myreader(9)
                    rownew("DrillFileNo") = myreader(10)
                    rownew("BridgeNo") = myreader(11)
                    strfa = "Select [o.Name] from ORGANISATIONNAME o, BOREHOLEDATASOURCE bds where o.OrgID=bds.FundAgencyID and o.OrgCatID=2 and bds.FundAgencyID=" & myreader(1)
                    strec = "Select o.Name from ORGANISATIONNAME o, BOREHOLEDATASOURCE bds where o.OrgID = bds.EngineeringID and o.OrgCatID=3 and bds.EngineeringID=" & myreader(2)
                    strgc = "Select o.Name from ORGANISATIONNAME o, BOREHOLEDATASOURCE bds where o.OrgID = bds.GeotechCoID and o.OrgCatID=4 and bds.GeotechCoID=" & myreader(3)
                    'Response.Write("Value is" & strgc)
                    'Response.End()
                    strdc = "Select o.Name from ORGANISATIONNAME o, BOREHOLEDATASOURCE bds where o.OrgID = bds.DrillingCoID and o.OrgCatID=5 and bds.DrillingCoID=" & myreader(4)
                    strpn = "Select pu.ProjectName from PROJECTNAMELOOKUP pu, BOREHOLEDATASOURCE bds where pu.ProjectNameID = bds.ProjectNameID and bds.ProjectNameID=" & myreader(5)
                End While


 Dim comgc As New OleDbCommand(strgc, myconnection)
             'error line
**** myreader1 = comgc.ExecuteReader()***
                While (myreader1.Read())
                    gname = myreader1(0) & ""
                    'Response.Write(gname)
                    'Response.End()
                End While
                myreader1.Close()

Reply With Quote
  #2 (permalink)  
Old April 30th, 2004, 06:40 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

nidy_online,

I suggest posting in the forum made specially for the language you are using. You probably won't find many answers here.

HTH,

Snib

<><
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax error (missing operator) ppenn Classic ASP Basics 3 November 5th, 2007 02:26 PM
Syntax error (missing operator) in query expressio annwilly Classic ASP Databases 1 June 7th, 2006 09:53 AM
Error - Missing operator in query expression. akibaMaila VB.NET 2002/2003 Basics 1 January 18th, 2005 12:34 PM
Syntax Error /missing operator in Query Expression dsealer Classic ASP Databases 4 September 4th, 2004 07:19 PM
Syntax error (missing operator) in query expressio mvollmer Classic ASP Databases 7 December 5th, 2003 11:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.