Re: Works with runsql but not with .Execute

Tech-Archive recommends: Fix windows errors by optimizing your registry



No. Unfortunately it wasn't a typo in the newsgroup. Do you know of any
option that requires defining all variables. AutoCorrect?

"Gary Walter" <gary@xxxxxxxxxxx> wrote in message
news:OS4E8$yWIHA.5984@xxxxxxxxxxxxxxxxxxxxxxx
Hi Robert,

Was it just a typo to newsgroup that

you defined "strSQL"
but tried to execute "SQLstr"

good luck,

gary

"Robert" wrote:
I have the following code:

Dim db As DAO.Database
strSQL = "INSERT INTO tblRentaldetails ( Rentalid, Itemid ) "
strSQL = strSQL & "SELECT '177' As Expr1, modelid AS Expr2 FROM
tblReservations WHERE "
strSQL = strSQL & "tblReservations.reservationsmainid = 64"
Set db = CurrentDb
db.Execute SQLstr, dbFailonError

which generates the error:

The Microsoft Jet database engine cannot find the input table or query.
Make sure it exists and that its name is spelled correctly.

But if I chanage it to docmd.runsql it works fine. I have similar code
working elsewhere in the database and Microsoft 2.5/3.5 compatability
Library is checked on in tools/references. So why do I get this message
when i use .Execute?

Robert












.



Relevant Pages

  • Grouping & Formulas
    ... Please keep all correspondence within the NewsGroup, ... I also can't duplicate your posted formulas. ... >> I assume you have a typo, and left out the second set of quotes: ... >> With the correct formula: ...
    (microsoft.public.excel.programming)
  • Re: To the misc.writing party who emailed me about the "disturbed individual"
    ... Google hits, ... ... When you talk about newsgroup writing, ... errors, Bill. ... If there is one thing lamer than a typo lame it is ...
    (misc.writing)
  • Re: insert into error
    ... > Microsoft JET Database Engine ... > I've done a response.write with the SQL statement and I get this ... it's silly to be forced to worry about delimiters (let alone ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.db)
  • Re: Outlook Express Emails Does Not Open
    ... Typo, sorry. ... it helps immensely if you include all of previous messagein your replies to the newsgroup. ... ~Robear Dyer ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Redirect with variable
    ... > Microsoft JET Database Engine error '80040e14' ... sSQL = sSQL & StrRecid ... need something other than the default, server-side, forward-only cursor. ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.general)