gettingstarted
[Top] [All Lists]

RE: What is wrong with this code?

To: "'Getting Started'" <gettingstarted at lists dot realsoftware dot com>
Subject: RE: What is wrong with this code?
From: "Deane Venske" <deane dot venske at eduss dot com>
Date: Wed, 31 Mar 2004 20:30:57 +1000
Thread-index: AcQXV84QE0FnrSjdQ5WGeix/aEsrkwATVaXw
> >>> TheSQL = TheSQL + "from People where First Name = '" + 
> >>> FirstField.Text+"'"
> >>
> >> I assume that the FirstField.Text is a valid text variable.....?
> >
> > I tried your suggestion and it won't compile at all. When I 
> run DeBug 
> > it gives me a syntax error at this line.
> >
> 
> What kind of syntax error? It looks good to me. Make sure 
> you've got your single and double quotes in the right place:

That space in the column name just looks bad. I don't know of any SQL
language that would accept it. Not sure how REALdb works with that kind of
thing, but maybe try enclosing the column name in `` so :
TheSQL = TheSQL + "from People where `First Name` = '" + FirstField.Text +
"'"

Do yourself a favour though. Comment out everything and only do the
following :

Dim RS As RecordSet
Dim TheSQL As String

RS = new RecordSet //Not sure if you need to do a new here.

RS = DB.SQLSelect("SELECT firstName FROM People")

At least this is clean, you're just testing your connection to the DB here
and if it's all good and the table and field exist, this has to work. If not
the problem is not in your SQL but somewhere else.

Are you positive that DB has been declared and is globally available and has
actually connected to a database?

Deane Venske


 - - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>