PC Review


Reply
Thread Tools Rate Thread

can't find strSQL

 
 
susan
Guest
Posts: n/a
 
      6th Apr 2011
Hello,

I get following (Access 2003) error on code below:

Error 3078. Jet-engine can't find table or query strSQL.

What do I do wrong?

Thanks,


Susan



AANT = "25"

strSQL = "SELECT TOP " & AANT & " " & _
" QVarHitsSel.hit, QVarHitsSel.titelschoon, QVarHitsSel.lokkaal, " & _
"QVarHitsSel.lokatie, QVarHitsSel.titel, QVarHitsSel.volg, " & _
"QVarHitsSel.mijnchceck, VarTrackSpecs.toegevoegd " & _
"FROM QVarHitsSel INNER JOIN VarTrackSpecs " & _
"ON QVarHitsSel.titel=VarTrackSpecs.titel " & _
"ORDER BY VarTrackSpecs.toegevoegd DESC;"

' MsgBox strSQL


' XXX -----------
Dim dbsHuidig1 As Database
Dim rs1 As Recordset
Set dbsHuidig1 = CurrentDb()
Set rs1 = dbsHuidig1.OpenRecordset("strSQL")

' rs1.MoveFirst
Do Until rs1.EOF
MsgBox rs1!titelschoon
rs1.MoveNext

Loop
rs1.Close
' XXX -----------





 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      6th Apr 2011
susan wrote:
> Hello,
>
> I get following (Access 2003) error on code below:
>
> Error 3078. Jet-engine can't find table or query strSQL.
>
> What do I do wrong?
>


>
> strSQL = "SELECT TOP " & AANT & " " & _


> Set rs1 = dbsHuidig1.OpenRecordset("strSQL")
>

You executed a literal string containing the characters "strSQL" rather than
the content of your strSQL variable. It should look like this:

Set rs1 = dbsHuidig1.OpenRecordset(strSQL)



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: strSQL Lord Kelvan Microsoft Access Queries 1 21st Oct 2008 11:28 PM
Many strSQL Hiro Microsoft Access 14 21st Jan 2008 02:49 AM
Need help with strSQL nlburgess via AccessMonster.com Microsoft Access Getting Started 2 29th Oct 2007 06:51 PM
strSQL =?Utf-8?B?SmVuIEZpZWxkcw==?= Microsoft Access VBA Modules 1 26th Jun 2007 12:51 AM
need help with strSQL Russ via AccessMonster.com Microsoft Access Queries 4 19th Oct 2005 11:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:49 PM.