Re: Works with runsql but not with .Execute
- From: "Robert" <cpq1bcle[REMOVE]@verizon.net>
- Date: Sun, 20 Jan 2008 13:02:23 -0500
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
.
- Follow-Ups:
- Re: Works with runsql but not with .Execute
- From: John Spencer
- Re: Works with runsql but not with .Execute
- References:
- Works with runsql but not with .Execute
- From: Robert
- Re: Works with runsql but not with .Execute
- From: Gary Walter
- Works with runsql but not with .Execute
- Prev by Date: Re: Copying using recordsets to new records
- Next by Date: Re: Using different form strings to filter
- Previous by thread: Re: Works with runsql but not with .Execute
- Next by thread: Re: Works with runsql but not with .Execute
- Index(es):
Relevant Pages
|