472,328 Members | 1,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

syntax error in query expression in vb.net

I am geting the following error while conv an asp to asp.net
Exception Details: System.Runtime.InteropServices.COMException: Syntax
error in query expression 'id =System.__ComObject'.

Source Error:

Line 196: for i = 0 to ubound(emaillist)
Line 197: selectsqlstatement = "select * from tblusers where id =" &
emaillist(i)

Line 198: rs_email = conn.execute(selectsqlstatement)
Line 199: tolist = tolist & rs_email("email") & ";"
Line 200:
Source File: C:\Documents and Settings\amit\WebSite1\email_form.aspx
Line: 198

Stack Trace:

[COMException (0x80040e14): Syntax error in query expression 'id
=System.__ComObject'.]
Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object o,
Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack) +965
Microsoft.VisualBasic.CompilerServices.NewLateBind ing.LateGet(Object
Instance, Type Type, String MemberName, Object[] Arguments, String[]
ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) +193727
ASP.email_form_aspx.__Render__control1(HtmlTextWri ter __w, Control
parameterContainer) in C:\Documents and
Settings\amit\WebSite1\email_form.aspx:198
System.Web.UI.Control.RenderChildrenInternal(HtmlT extWriter writer,
ICollection children) +98
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +20
System.Web.UI.Page.Render(HtmlTextWriter writer) +27
System.Web.UI.Control.RenderControlInternal(HtmlTe xtWriter writer,
ControlAdapter adapter) +53
System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
ControlAdapter adapter) +280
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24

The code for teh foll is,

<%
Dim counter,rs_email, tolist
Dim emaillist as string()
dim i as integer
emaillist = split(request.Form("c"), ",")
counter = 1
dim selectSqlStatement as string
for i = 0 to ubound(emaillist)
selectsqlstatement = "select * from tblusers where id =" &
emaillist(i)
rs_email = conn.execute(selectsqlstatement)
tolist = tolist & rs_email("email") & ";"

response.Write(rs_email("email")&";")

if counter = 3 then
response.Write("<br>")
counter = 1
end if

counter = counter + 1
next
%>

Nov 19 '05 #1
1 2207
three syntax errors in a row... Impressive.
clearly, the value of the expression emaillist(i) isn't what you expect it
to be.

why not run through a debugger and see what the values are and compare them
to what you'd expect them to be?

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
<am*******@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I am geting the following error while conv an asp to asp.net
Exception Details: System.Runtime.InteropServices.COMException: Syntax
error in query expression 'id =System.__ComObject'.

Source Error:

Line 196: for i = 0 to ubound(emaillist)
Line 197: selectsqlstatement = "select * from tblusers where id =" &
emaillist(i)

Line 198: rs_email = conn.execute(selectsqlstatement)
Line 199: tolist = tolist & rs_email("email") & ";"
Line 200:
Source File: C:\Documents and Settings\amit\WebSite1\email_form.aspx
Line: 198

Stack Trace:

[COMException (0x80040e14): Syntax error in query expression 'id
=System.__ComObject'.]
Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object o,
Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack) +965
Microsoft.VisualBasic.CompilerServices.NewLateBind ing.LateGet(Object
Instance, Type Type, String MemberName, Object[] Arguments, String[]
ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) +193727
ASP.email_form_aspx.__Render__control1(HtmlTextWri ter __w, Control
parameterContainer) in C:\Documents and
Settings\amit\WebSite1\email_form.aspx:198
System.Web.UI.Control.RenderChildrenInternal(HtmlT extWriter writer,
ICollection children) +98
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +20
System.Web.UI.Page.Render(HtmlTextWriter writer) +27
System.Web.UI.Control.RenderControlInternal(HtmlTe xtWriter writer,
ControlAdapter adapter) +53
System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
ControlAdapter adapter) +280
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24

The code for teh foll is,

<%
Dim counter,rs_email, tolist
Dim emaillist as string()
dim i as integer
emaillist = split(request.Form("c"), ",")
counter = 1
dim selectSqlStatement as string
for i = 0 to ubound(emaillist)
selectsqlstatement = "select * from tblusers where id =" &
emaillist(i)
rs_email = conn.execute(selectsqlstatement)
tolist = tolist & rs_email("email") & ";"

response.Write(rs_email("email")&";")

if counter = 3 then
response.Write("<br>")
counter = 1
end if

counter = counter + 1
next
%>

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched...
24
by: deko | last post by:
I'm trying to log error messages and sometimes (no telling when or where) the message contains a string with double quotes. Is there a way get the...
1
by: amitbadgi | last post by:
I am gettign this error while converting an asp application to asp.net , its a query syntax error, Exception Details:...
4
by: T. Wintershoven | last post by:
Hi Can someone please tell me whats wrong with the last line of the query below. The first three lines work fine but when i add the fourth line i...
7
by: John Øllgård Jensen | last post by:
Hi Using MS Asccess 2000: In a query I'm trying to create a new field with following expression: FilmDate: Left(,4) The field "FilmNo" is...
7
by: bryant | last post by:
Hi all. I am new to ASP and working in Expression Web. The following query displays the information I need in the gridview for a single record....
4
by: srinathvs | last post by:
Hi, I have an access db that I am trying to query from a vb6 program. I've the following code: Dim sSQLQuery As String sSQLQuery = "SELECT...
7
by: Yesurbius | last post by:
I am receiving the following error when attempting to run my query. In my mind - this error should not be happening - its a straight-forward query...
5
by: rolltide | last post by:
I've seen many similar threads, but despite repeated efforts I cannot figure out my problem. I am running Access 2003, VB 6.5, Office XP Pro. Code...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.